View Single Post
Old 06-14-2010, 06:22 AM   #1
Location: Europe

Join Date: Apr 2010
Posts: 46
Default samtools picard SamFormatConverter


I'm trying to run SamFormatConverter to convert a BAM to a SAM, and I'm getting an error (see below).

The text suggests that samtools is trying to parse my BAM as a SAM. However, the file is definitely a BAM, has a '.bam' extension, and appears to have the necessary "magic number" at the top.

Any ideas if I might be doing something wrong?


java -jar <location>/SamFormatConverter.jar I=in.bam O=out.sam

Head in.bam:
BAM?@HD VN:1.0 GO:none SO:unsorted
@SQ SN:chrM LN:16571 AS:HG18 UR:/seq/references/Homo_sapiens_assembly18/v0/Homo_sapiens_assembly18.fasta M5:d2ed829b8a1628d16cbeee88e88e39eb SP:Homo sapiens

Exception in thread "main" net.sf.samtools.SAMFormatException: Error parsing text SAM file. Not enough fields; Line 1
Line: BAM?@HD VN:1.0 GO:none SO:unsorted
at net.sf.samtools.SAMTextReader.reportFatalErrorParsingLine(
at net.sf.samtools.SAMTextReader.access$400(
at net.sf.samtools.SAMTextReader$RecordIterator.parseLine(
at net.sf.samtools.SAMTextReader$
at net.sf.samtools.SAMTextReader$
at net.sf.picard.sam.SamFormatConverter.doWork(
at net.sf.picard.cmdline.CommandLineProgram.instanceMain(
at net.sf.picard.sam.SamFormatConverter.main(
Bio.X2Y is offline   Reply With Quote