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

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

Hi,

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?

Thanks!

Command:
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:
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(SAMTextReader.java:169)
at net.sf.samtools.SAMTextReader.access$400(SAMTextReader.java:40)
at net.sf.samtools.SAMTextReader$RecordIterator.parseLine(SAMTextReader.java:261)
at net.sf.samtools.SAMTextReader$RecordIterator.next(SAMTextReader.java:224)
at net.sf.samtools.SAMTextReader$RecordIterator.next(SAMTextReader.java:196)
at net.sf.picard.sam.SamFormatConverter.doWork(SamFormatConverter.java:64)
at net.sf.picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:150)
at net.sf.picard.sam.SamFormatConverter.main(SamFormatConverter.java:72)
Bio.X2Y is offline   Reply With Quote