Notice:
If you happen to see a question you know the answer to, please do chime in and help your fellow community members. We encourage our fourm members to be more involved, jump in and help out your fellow researchers with their questions. GATK forum is a community forum and helping each other with using GATK tools and research is the cornerstone of our success as a genomics research community.We appreciate your help!

Test-drive the GATK tools and Best Practices pipelines on Terra


Check out this blog post to learn how you can get started with GATK and try out the pipelines in preconfigured workspaces (with a user-friendly interface!) without having to install anything.

picard.sam.MergeBamAlignment fails

concon PennsylvaniaMember

Hello,

I'm a new user to Picard. I am running Picard as part of a pipeline in Drop-Seq.

My command is [Thu Nov 24 08:22:35 EST 2016] picard.sam.MergeBamAlignment UNMAPPED_BAM=/tmp/tmp.LZCO41Qe19/unaligned_mc_tagged_polyA_filtered.bam ALIGNED_BAM=[/tmp/tmp.LZCO41Qe19/aligned.sorted.bam] OUTPUT=/dev/stdout REFERENCE_SEQUENCE=/mnt/data/con/Alex/mm10/mm10.fasta PAIRED_RUN=false INCLUDE_SECONDARY_ALIGNMENTS=false COMPRESSION_LEVEL=0 CLIP_ADAPTERS=true IS_BISULFITE_SEQUENCE=false ALIGNED_READS_ONLY=false MAX_INSERTIONS_OR_DELETIONS=1 READ1_TRIM=0 READ2_TRIM=0 ALIGNER_PROPER_PAIR_FLAGS=false SORT_ORDER=coordinate PRIMARY_ALIGNMENT_STRATEGY=BestMapq CLIP_OVERLAPPING_READS=true ADD_MATE_CIGAR=true VERBOSITY=INFO QUIET=false VALIDATION_STRINGENCY=STRICT MAX_RECORDS_IN_RAM=500000 CREATE_INDEX=false CREATE_MD5_FILE=false GA4GH_CLIENT_SECRETS=client_secrets.json
[Thu Nov 24 08:22:35 EST 2016] Executing as [email protected] on Linux 3.16.0-77-generic amd64; OpenJDK 64-Bit Server VM 1.7.0_111-b01; Picard version: 1.138(89618e408692ff6288c7c880658f32f16fcbec53_1441135673) IntelDeflater
INFO 2016-11-24 08:22:35 SamAlignmentMerger [/tmp/tmp.LZCO41Qe19/aligned.sorted.bam]
[Thu Nov 24 08:22:35 EST 2016] picard.sam.MergeBamAlignment done. Elapsed time: 0.00 minutes

and the error is

Exception in thread "main" java.lang.NullPointerException
at picard.sam.AbstractAlignmentMerger.createNewCigarIfMapsOffEndOfReference(AbstractAlignmentMerger.java:631)
at picard.sam.AbstractAlignmentMerger.createNewCigarsIfMapsOffEndOfReference(AbstractAlignmentMerger.java:654)
at picard.sam.AbstractAlignmentMerger.updateCigarForTrimmedOrClippedBases(AbstractAlignmentMerger.java:686)
at picard.sam.AbstractAlignmentMerger.transferAlignmentInfoToFragment(AbstractAlignmentMerger.java:514)
at picard.sam.AbstractAlignmentMerger.mergeAlignment(AbstractAlignmentMerger.java:410)
at picard.sam.SamAlignmentMerger.mergeAlignment(SamAlignmentMerger.java:138)
at picard.sam.MergeBamAlignment.doWork(MergeBamAlignment.java:248)
at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:206)
at picard.cmdline.PicardCommandLine.instanceMain(PicardCommandLine.java:95)
at picard.cmdline.PicardCommandLine.main(PicardCommandLine.java:105)
INFO 2016-11-24 08:22:35 TagReadWithGeneExon TOTAL READS [0] CORRECT_STRAND [0] WRONG_STRAND [0] AMBIGUOUS_STRAND_FIXED [0] AMBIGUOUS REJECTED READS [0]
[Thu Nov 24 08:22:35 EST 2016] org.broadinstitute.dropseqrna.metrics.TagReadWithGeneExon done. Elapsed time: 0.01 minutes

I don't know what else to say than it didn't work, how can I fix this?

Issue · Github
by Sheila

Issue Number
1475
State
closed
Last Updated
Assignee
Array
Milestone
Array
Closed By
vdauwera

Answers

  • shleeshlee CambridgeMember, Broadie ✭✭✭✭✭
    edited November 2016

    Hi @con,

    You are using Picard version 1.138 from last year. Can you update to the latest v2.7.1 and try again? The new version requires Java v1.8.

  • shleeshlee CambridgeMember, Broadie ✭✭✭✭✭

    Hi @con,

    If you still get an error with the updated tool, then be sure to validate your BAM with ValidateSamFile as outlined here.

  • concon PennsylvaniaMember

    unfortunately, I am not able to update the Picard installation on this system. I have since found a way around this problem without using Picard.

  • shleeshlee CambridgeMember, Broadie ✭✭✭✭✭

    Great to hear you found a solution @con. If you are in a sharing mood, your workaround could benefit others in the GATK community.

  • concon PennsylvaniaMember

    @shlee said:
    Great to hear you found a solution @con. If you are in a sharing mood, your workaround could benefit others in the GATK community.

    The pipeline is part of a single-cell sequencing project. The authors didn't respond for requests for help, so I'm avoiding their pipeline entirely, reading the fastqs manually and processing the data from there. I'm happy to share my workaround, I'm not sure how, I completely avoided anything like this step in the workaround.

  • shleeshlee CambridgeMember, Broadie ✭✭✭✭✭

    Are you saying you are skipping the MergeBamAlignment step from your workflow? If so, I just want to mention that although the name of the tool implies a simple merging of information from two BAMs, MergeBamAlignment does much more than its name implies. For example, PRIMARY_ALIGNMENT_STRATEGY=BestMapq has the tool reassess and possibly reassign primary versus secondary/supplementary alignment flags based on MAPQ scores. If you are interested, the most detailed documentation on MergeBamAlignment features are in Section 3C of this document.

    If you are new to Picard/GATK tools, be sure to check out our Best Practices Workflows for our proven recommendations. Good luck.

  • concon PennsylvaniaMember

    Hi Shlee,

    I've just found that my workaround does not work, do you have any suggestions for how to debug this? Colleagues have no idea how to fix this.

    -Dave

    Issue · Github
    by Sheila

    Issue Number
    1803
    State
    open
    Last Updated
    Assignee
    Array
    Milestone
    Array
  • shleeshlee CambridgeMember, Broadie ✭✭✭✭✭

    Hi @con,

    Can you be more specific when you say that your workaround does not work? Did you get an error message or do you get unexpected results? This blogpost describes some guidelines for asking questions on the forum that may help us speed things up here.

Sign In or Register to comment.