SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem removing duplicate reads? (samtools and picard) cbl Bioinformatics 19 09-17-2015 11:01 AM
About Picard Jin Pan Bioinformatics 8 07-15-2014 04:55 AM
Picard bair Bioinformatics 2 07-15-2014 04:45 AM
Samtools's rmdup vs. Picard's MarkDuplicates fah Bioinformatics 30 10-28-2013 12:28 AM
samtools vs picard index pallo Bioinformatics 1 04-11-2011 03:59 PM

Reply
 
Thread Tools
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
Old 04-26-2011, 11:16 AM   #2
bh1
Junior Member
 
Location: SF

Join Date: Feb 2011
Posts: 1
Default

Hi,
Did you figure a solution for this problem? I'm getting exactly the same error message.
thanks.
bh1 is offline   Reply With Quote
Old 04-26-2011, 01:19 PM   #3
Richard Finney
Senior Member
 
Location: bethesda

Join Date: Feb 2009
Posts: 700
Default Validation_stringency=lenient

Try VALIDATION_STRINGENCY=LENIENT in the java invocation.

Example:

java-Xmx67T -jar wherever/SamTowhatevernameis.jar \
VALIDATION_STRINGENCY=LENIENT \ INPUT=uncle.sam O=nephew.sam


That might shut up the error message and get Picard to accept the input.
Richard Finney is offline   Reply With Quote
Old 07-08-2013, 07:46 AM   #4
bw.
Member
 
Location: San Francisco, CA

Join Date: Mar 2012
Posts: 21
Default

In this case the issue is probably the
"BAM?" on the 1st line in front of "@HD VN:1.0 GO:none SO:unsorted"
I would try deleting it.
bw. is offline   Reply With Quote
Reply

Tags
samtools picard

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 11:34 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO