Question: Fatal error with SamToFastq using BAM files
0
gravatar for jrmeirin
2.7 years ago by
jrmeirin0
United States
jrmeirin0 wrote:

Hello Biostars,

I am a new Galaxy user and have some bam files that I need to run through RNA seq analyses.  I have read that the first step is to convert my bam files to Fastq, using the NGS: Picard --> SamToFastq tool, but when I try this I am repeatedly getting fatal errors:

Fatal error: Exit code 1 ()
Picked up _JAVA_OPTIONS: -Djava.io.tmpdir=/galaxy-repl/main/scratch
Exception in thread "main" picard.PicardException: Illegal mate state: HWI-D00569:30:C5UBTANXX:1:1201:15460:51543
	at picard.sam.SamToFastq.assertPairedMates(SamToFastq.java:345)
	at picard.sam.SamToFastq.doWork(SamToFastq.java:168)
	at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:187)
	at picard.cmdline.PicardCommandLine.instanceMain(PicardCommandLine.java:89)
	at picard.cmdline.PicardCommandLine.main(PicardCommandLine.java:99)

Before attempting this, I ran the bam file through FastQC, which showed good results.  Can anyone help me figure out how to get this to convert?  I appreciate any assistance!

 

-Joe

galaxy bam • 957 views
ADD COMMENTlink modified 2.7 years ago by Jennifer Hillman Jackson25k • written 2.7 years ago by jrmeirin0
0
gravatar for Jennifer Hillman Jackson
2.7 years ago by
United States
Jennifer Hillman Jackson25k wrote:

Hello,

The source BAM dataset likely has non-unique names for pairs. This must be corrected first. It is was a merged dataset, try executing this conversation tool before merging BAMs. If you received it merged and read groups were assigned, Samtools Split could resolve the problem.

Thanks, Jen, Galaxy team

 

ADD COMMENTlink written 2.7 years ago by Jennifer Hillman Jackson25k

Hi Jen,

Thank you for the quick reply.  I split the bam file and then tried converting it to fastq, but I am still getting an error:

Fatal error: Exit code 1 () Picked up _JAVA_OPTIONS: -Djava.io.tmpdir=/galaxy-repl/main/scratch Exception in thread "main" picard.PicardException: Illegal mate state: HWI-D00569:30:C5UBTANXX:1:1201:15460:51543 at picard.sam.SamToFastq.assertPairedMates(

I am little confused with the split function, I was expecting to get two outputs for that, but only got one.  I was wondering if after splitting I should re-merge with the NGS: Bam Tools, but I couldn't do that since I only had one output file from the split.  Again, I appreciate the help!

-Joe

ADD REPLYlink written 2.7 years ago by jrmeirin0

It sounds as if there was only one read group or possibly no read groups assigned to split on.

Duplicates are the main reported reason for this tool error, but you could confirm this in an issue with your data by using the Group then Sort tools ("count distinct" on the identifier, then reverse sort the count to see which/how many are duplicated).

The problem is not with Galaxy, but with the original file content and how some Picard functions work. Galaxy can only repair upstream inputs that do not meet tool input criteria in certain cases. If this was my data, I would probably run another Picard tool like FixMateInformation to see if that errored, too, for the same reason, as a test. 

There are several line-command/utility fixes reported online. I cannot endorse any in particular, but you could definitely test those that seem reasonable to see if it clears up the duplicates (if that is in fact the problem). Just do a google with "Picard" and "Illegal mate state" to see public reports/descriptions/fixes for the error.

Sorry I could not help fully resolve this. But others may also still post a reply.

ADD REPLYlink modified 2.7 years ago • written 2.7 years ago by Jennifer Hillman Jackson25k

Ok I'll keep working at it and dig around more for other similar reported issues.  Thanks!

ADD REPLYlink written 2.7 years ago by jrmeirin0
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 16.09
Traffic: 79 users visited in the last hour