Question: failed to convert from cram to bam
0
gravatar for kygppyou
3.0 years ago by
kygppyou0
kygppyou0 wrote:

I got a cram file, and want to convert it to bam file. Here's the command I use and error I got

samtools view -b -T human_g1k_v37.fasta lucky.cram > lucky.bam
[sam_header_read2] 84 sequences loaded.
[sam_read1] reference 'Wm�;�����e��i���f�[�=���~��Ç߼���U��/���>���Q���O����n����O��' is recognized as '*'.
Parse error at line 1: invalid CIGAR character

I don't know what to do with this. Please help~

cram bam • 3.1k views
ADD COMMENTlink modified 3.0 years ago by genomax74k • written 3.0 years ago by kygppyou0

Convert a CRAM file to a BAM file

ADD REPLYlink written 3.0 years ago by venu6.3k

Is cram-tools even still supported?

ADD REPLYlink written 3.0 years ago by Devon Ryan92k

This suggests that there's a mismatch between the fasta file and what the CRAM file was created with. I'd double check that before proceeding.

ADD REPLYlink written 3.0 years ago by Devon Ryan92k
2
gravatar for John Marshall
3.0 years ago by
John Marshall1.8k
Glasgow, Scotland
John Marshall1.8k wrote:

You are using a prehistoric version of samtools, one that predates the CRAM format by several years, so of course it has no support for CRAM files. (The error messages shown indicate that it is attempting to parse the input as a SAM file, and failing miserably.)

You need at least samtools 1.0 to read CRAM files, and many CRAM-related improvements were made in 1.2. Of course, what you really want to install is the most up-to-date version of samtools, which is 1.3.1 at the time of writing.

ADD COMMENTlink written 3.0 years ago by John Marshall1.8k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 675 users visited in the last hour