Question: AddOrReplaceReadGroups errors with BWA-MEM input
1
gravatar for Beeta Masoumi
7 months ago by
United States
Beeta Masoumi30 wrote:

Hello, I appreciate if someone can help me figure out why I get this error.

 Could not display BAM file, error was:file has no sequences defined (mode='rb') - is it SAM/BAM format? Consider opening with check_sq=False

Here are the steps so far:

  1. uploaded and checked the quality of 3 FASTQ sequences (FASTqSanger, paired-end, with ref genome:hg19)
  2. Mapped using BWA-MEM tool (now I have 3 BAM files)
  3. when I use AddOrReplaceReadGroups it immediately generates this error:

    QNAME FLAG RNAME POS MAPQ CIGAR MRNM MPOS ISIZE SEQ QUAL OPT Could not display BAM file, error was: file has no sequences defined (mode='rb') - is it SAM/BAM format? Consider opening with check_sq=False

I have tried the followings ways of running AddorReplace... tool:

  1. With only one file, that is the output from BWA-MEM which is a BAM file and without any auto-assign. Then it won't let me execute unless I enter a value for Library name(LB) for which I entered Coriell (don't know if this is correct). It also asked for Read Group Identifier(ID) for which I entered 1

  2. With only one file and all auto-signs on, same error.

  3. With all 3 files (batch), same error

Should I modify the output BAM file from BWA-MEM tool to be able to use it with AddorReplace?

Thank you so much, Beeta

(admin: text display reformatted)

bwa-mem format sam galaxy bam • 499 views
ADD COMMENTlink modified 7 months ago • written 7 months ago by Beeta Masoumi30
1
gravatar for Beeta Masoumi
7 months ago by
United States
Beeta Masoumi30 wrote:

I figured it, and I thought I should add the answer here in case someone else bumps into the same issue:

In BWA-MEM tool you should set the Read Group Identifier so that later you would be able to merge the BAM files.

Cheers, Beeta

ADD COMMENTlink written 7 months ago by Beeta Masoumi30

This is definitely a faster way to get the extra metadata adding in when merging BAMs. But, you should be able to do this either with BWA-MEM or AddOrReplaceReadGroups. Please see my other reply for more details.

ADD REPLYlink written 7 months ago by Jennifer Hillman Jackson25k
1
gravatar for Jennifer Hillman Jackson
7 months ago by
United States
Jennifer Hillman Jackson25k wrote:

Thanks Beeta,

I cannot reproduce this particular error with the most current version of both tools at Galaxy main https://usegalaxy.org. Perhaps you need to upgrade the tools (if working at your own server) or upgrade a workflow to use these versions (when already on the server)? Also be sure that your server is current (Galaxy version 18.01) https://docs.galaxyproject.org/en/master/releases/.

If working at a different public server, the administrators can be contacted about the problem, assuming that the checks below show that the BAM is intact.

BAM QA: Double check that these actually contain alignment results (mapping was successful) and that there are no metadata warnings inside the dataset (will be in a yellow box at the top). Converting BAM-to-SAM is one way to test/review results. If that tool also fails, then you'll know there is a BAM format/content problem.

For others reading, a related problem that can come up is when missing required fields are not filled out on the AddOrReplaceReadGroups tool form. If only the auto-assign values are used, please note that these do not cover all required fields. The "Platform unit (PU)" value needs to be manually assigned.

If you see this message inside of the red error dataset, then the missing PU field is definitely the problem:

Fatal error: Exit code 1 ()
Picked up _JAVA_OPTIONS: -Djava.io.tmpdir=/galaxy-repl/main/jobdir/XXX/XXX/XXX/_job_tmp -Xmx7g -Xms256m
ERROR: Option 'RGPU' is required.

Thanks! Jen, Galaxy team

ADD COMMENTlink modified 7 months ago • written 7 months ago by Jennifer Hillman Jackson25k
1
gravatar for Beeta Masoumi
7 months ago by
United States
Beeta Masoumi30 wrote:

Thanks so much, Jen!

Yes, I believe I got the error because:

1- I didn't set the Read Group Identifier in BWA-MEM tool AND 2- I didn't set ID SM LB PU in AddOrReplaceReadGroup. Previously I left SM and PU blank/auto-assign hence got the error.

Now everything is working fine! Many thanks, Beeta

ADD COMMENTlink written 7 months ago by Beeta Masoumi30
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: 165 users visited in the last hour