Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.

  • #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


    • #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

      • seqadmin
        Current Approaches to Protein Sequencing
        by seqadmin


        Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
        04-04-2024, 04:25 PM
      • seqadmin
        Strategies for Sequencing Challenging Samples
        by seqadmin


        Despite advancements in sequencing platforms and related sample preparation technologies, certain sample types continue to present significant challenges that can compromise sequencing results. Pedro Echave, Senior Manager of the Global Business Segment at Revvity, explained that the success of a sequencing experiment ultimately depends on the amount and integrity of the nucleic acid template (RNA or DNA) obtained from a sample. “The better the quality of the nucleic acid isolated...
        03-22-2024, 06:39 AM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by seqadmin, 04-11-2024, 12:08 PM
      0 responses
      18 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-10-2024, 10:19 PM
      0 responses
      22 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-10-2024, 09:21 AM
      0 responses
      17 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-04-2024, 09:00 AM
      0 responses
      49 views
      0 likes
      Last Post seqadmin  
      Working...
      X