Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • NitaC
    Member
    • Apr 2013
    • 17

    #1

    Picard MergeBam Alignment issue

    Hello everyone. I've scourged the internet and this forum in particular and I have not been able to get past this problem. Ultimately, I want to be able to use Picard's Mark Dups.

    I have paired-end reads aligned to the human genome using GSnap. From previous experience, I already know that to use MarkDups I had to go through all of the pre-processing just to get the bam file up to Picard's standards. And so, I used FastQtoSam to make an unaligned bam file (queryname sorted). I then went to merge this unaligned file with my original GSnap output. I get this error:
    Exception in thread "main" java.lang.IllegalStateException: Aligned record iterator (HWI-ST970:586:C2PY6ACXX:1:1115:10000:27368) is behind t
    he unmapped reads (HWI-ST970:586:C2PY6ACXX:1:1115:10000:3435)
    at net.sf.picard.sam.AbstractAlignmentMerger.mergeAlignment(AbstractAlignmentMerger.java:332)
    at net.sf.picard.sam.SamAlignmentMerger.mergeAlignment(SamAlignmentMerger.java:156)
    at net.sf.picard.sam.MergeBamAlignment.doWork(MergeBamAlignment.java:236)
    at net.sf.picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:177)
    at net.sf.picard.sam.MergeBamAlignment.main(MergeBamAlignment.java:205)

    I even tried merging my unaligned bam file with a sorted version of my aligned bam file (I tried both using coordinate sorted and queryname). In each try I get the same exact error. I am using the latest version of Picard and I can find nothing else on the internet that has solved my problem. Thanks in advance for any suggestions.
  • NitaC
    Member
    • Apr 2013
    • 17

    #2
    I moved my files to a different server, used the same commands, with the same version of picard and now I am getting a different error.

    It appears that the merge almost finishes but then something happens.

    [Mon Nov 18 10:15:34 EST 2013] net.sf.picard.sam.MergeBamAlignment done. Elapsed time: 27.55 minutes.
    Runtime.totalMemory()=5144641536
    To get help, see http://picard.sourceforge.net/index.shtml#GettingHelp
    Exception in thread "main" java.lang.NullPointerException
    at net.sf.picard.sam.AbstractAlignmentMerger.updateCigarForTrimmedOrClippedBases(AbstractAlignmentMerger.java:529)
    at net.sf.picard.sam.AbstractAlignmentMerger.transferAlignmentInfoToFragment(AbstractAlignmentMerger.java:418)
    at net.sf.picard.sam.AbstractAlignmentMerger.transferAlignmentInfoToPairedRead(AbstractAlignmentMerger.java:432)
    at net.sf.picard.sam.AbstractAlignmentMerger.mergeAlignment(AbstractAlignmentMerger.java:274)
    at net.sf.picard.sam.SamAlignmentMerger.mergeAlignment(SamAlignmentMerger.java:156)
    at net.sf.picard.sam.MergeBamAlignment.doWork(MergeBamAlignment.java:236)
    at net.sf.picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:177)
    at net.sf.picard.sam.MergeBamAlignment.main(MergeBamAlignment.java:205)

    Please help. I am out of ideas for this.

    Comment

    • EricHaugen
      Member
      • Sep 2009
      • 13

      #3
      At least one of the bam files may not be sorted in precisely the manner Picard expects. You could try removing that assumption with the Picard parameter "ASSUME_SORTED=false".

      Or try "samtools sort" on each bam followed by a "samtools merge", instead of Picard.

      Only the GSnap alignment, and not the unaligned reads, will be relevant when running Picard's MarkDuplicates anyway. Duplicates are calculated from aligned positions, not the content of the sequences.

      Comment

      Latest Articles

      Collapse

      • SEQadmin2
        Beyond CRISPR/Cas9: Understand, Choose, and Use the Right Genome Editing Tool
        by SEQadmin2



        CRISPR/Cas9 sparked the gene editing revolution for both research and therapeutics.1 But this system still showed severe issues that limited its applications. The most prominent were the heavy reliance on PAM sequences, delivery limitations, double-stranded breaks that prompt unintended edits and cell death, and editing inefficiency (both in targeting and in knock-in reliability).

        Despite this, “CRISPR helped turn genome editing from a specialized technique into
        ...
        07-31-2026, 11:01 AM
      • SEQadmin2
        Proteomic Platforms: How to Choose the Right Analytical Strategy to Improve Detection and Clinical Applications
        by SEQadmin2


        Proteomics platforms are evolving rapidly, with advances in mass spectrometry and affinity-based approaches expanding what researchers can detect and at what scale. As the field moves toward deeper proteome coverage and clinical applications, scientists face an increasingly complex landscape of tools. This article will explore how researchers are navigating these choices to find the right platform for their work.

        The systematic characterization of the human proteome has
        ...
        07-20-2026, 11:48 AM
      • SEQadmin2
        Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
        by SEQadmin2



        Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
        ...
        07-09-2026, 11:10 AM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by SEQadmin2, Today, 10:13 AM
      0 responses
      9 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 07-31-2026, 02:55 AM
      0 responses
      21 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 07-24-2026, 12:17 PM
      0 responses
      18 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 07-23-2026, 11:41 AM
      0 responses
      17 views
      0 reactions
      Last Post SEQadmin2  
      Working...