Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dnusol
    Senior Member
    • Jul 2009
    • 136

    #1

    merging bam files with different headers

    Hi,

    Is it possible to merge bam files from the same sample but different reference sequence and thus different headers, so that I work with one single alignment file instead of two?.

    I tried

    Code:
    java -Xmx4g -jar ~/picard-tools-1.61/MergeSamFiles.jar  INPUT=Sample1_exon1.bam INPUT=Sample1_exon2.bam OUTPUT=Sample1_merged.bam ASSUME_SORTED=true USE_THREADING=true VALIDATION_STRINGENCY=LENIENT
    but I got the following error:

    Exception in thread "main" net.sf.samtools.util.SequenceUtil$SequenceListsDifferException: Sequences at index 0 don't match

    Cheers,

    Dave

    p.s.: I must say that the MERGE_SEQUENCE_DICTIONARIES flag seems to be related to this task but I am not sure what it actually means
    Last edited by dnusol; 02-06-2012, 08:14 AM.
  • Richard Finney
    Senior Member
    • Feb 2009
    • 701

    #2
    Even it if were possible, it wouldn't be a good idea.

    Check samtools merge documentation at http://samtools.sourceforge.net/samtools.shtml

    merge samtools merge [-nur1f] [-h inh.sam] [-R reg] <out.bam> <in1.bam> <in2.bam> [...]

    Merge multiple sorted alignments. The header reference lists of all the input BAM files, and the @SQ headers of inh.sam, if any, must all refer to the same set of reference sequences. The header reference list and (unless overridden by -h) ‘@’ headers of in1.bam will be copied to out.bam, and the headers of other files will be ignored.

    Comment

    • dnusol
      Senior Member
      • Jul 2009
      • 136

      #3
      Thanks Richard,

      I was afraid of that. I see it as doing two steps of alignment against two different reference files instead of doing one single alignment against a file with two fasta entries. I guess the issue here is that you loose the ability of finding reads if multiple alignment is taking place. Unless this is done in a late step. But why a bad idea? to me it seems just a technical issue (samtools will only take into account headers of first in.bam file)

      Comment

      Latest Articles

      Collapse

      • SEQadmin2
        Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
        by SEQadmin2



        Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

        Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
        ...
        10-14-2026, 09:55 AM
      • SEQadmin2
        New Genomics Technologies Take Aim at Long-Standing Limits
        by SEQadmin2


        Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

        We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
        ...
        09-28-2026, 10:25 AM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by SEQadmin2, 10-22-2026, 11:13 AM
      0 responses
      23 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 10-22-2026, 10:48 AM
      0 responses
      20 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 10-15-2026, 10:52 AM
      0 responses
      36 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 10-14-2026, 05:39 AM
      0 responses
      42 views
      0 reactions
      Last Post SEQadmin2  
      Working...