Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • frymor
    Senior Member
    • May 2010
    • 151

    #1

    samtools merge

    Hallo everybody,

    I am running a bowtie assembly for drosophila.
    After the bowtie is finished I'm piping the unmapped reads to tophat to see if I can map some more reads onto the same reference genome.

    The sam out from bowtie I than convert into bam and tophat make automatically a bam file
    After finishing both runs, I would like to combine both bam files with the samtools merge command:

    Code:
    samtools merge -h dilptotal.sam dilptotal_2.bam dilptotal_bowtie.bam dilp_tophat.bam
    but I'm keep getting this error message:
    Code:
    [bam_merge_core] different target sequence name: 'YHet' != '2L' in file 'dilp_tophat.bam'
    I don't exactly understand what this error means.

    I used for both runs the same reference genome. in both there are the chromosomes "2L' and 'YHet'.
    YHet is the heterochromatin part of the Y chromosome. It comes 4 times in the sorted bowtie bam file but over 4500 times in the sorted tophat bam file.
    '2L' reads I have many millions in both files.

    why does it has this problem? Is it because I don't have a header in my tophat output file with the chromosomes (@SQ)?

    can I set tophat to have an header in the sam or bam files?

    Thanks for ant advice,

    Assa
  • nilshomer
    Nils Homer
    • Nov 2008
    • 1283

    #2
    Make sure that the SQ lines in the header are the same (use samtools view -H). You will also need to sort them before merging (samtools sort).

    Comment

    • frymor
      Senior Member
      • May 2010
      • 151

      #3
      Originally posted by nilshomer View Post
      Make sure that the SQ lines in the header are the same (use samtools view -H). You will also need to sort them before merging (samtools sort).
      This is exactly my problem. tophat produces no header in the bam file.

      Can I change the setting so that tophat will create a header?
      Is there a header in the (temporary) sam files from tophat?

      Is it enough just to copy paste the header from the bam file from bowtie into the one from tophat?

      Comment

      • hbt
        Member
        • Jan 2011
        • 20

        #4
        Originally posted by frymor View Post
        This is exactly my problem. tophat produces no header in the bam file.

        Can I change the setting so that tophat will create a header?
        Is there a header in the (temporary) sam files from tophat?

        Is it enough just to copy paste the header from the bam file from bowtie into the one from tophat?
        I'd love to know the answers to this too!

        cheers

        Comment

        • ozs2006
          Member
          • May 2010
          • 21

          #5
          I got similar problem:

          I downloaded sam files from recent published study.
          Each sam file contains alignments of the reads to a single chromosome (hg19).
          I want to merge alignments into one file.
          Every sam file have only @SQ as header of its chromosome.

          For example:
          in chrY.sam
          @SQ SN:chrY LN:59373566
          in chrM.sam
          @SQ SN:chrM LN:16571

          I used:
          samtools view -T /data/pipeline_in/Genomes/Human_GRCh37/all.fa -Sb chrY.sam | samtools sort - chrY.sam.sorted
          samtools view -T /data/pipeline_in/Genomes/Human_GRCh37/all.fa -Sb chrM.sam | samtools sort - chrM.sam.sorted

          Then in order to merge them:
          samtools merge out chrM.sam.sorted.bam chrY.sam.sorted.bam

          I got this error:
          [bam_merge_core] different target sequence name: 'chrM' != 'chrY' in file 'chrY.sam.sorted.bam'

          What I need to do?
          from searching the net I got some clues this error is connected to the header?
          Do I need to replace the headers of the primary sam files?
          Where I find proper example for header?

          Thanks in advance,
          Oz Solomon

          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

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by SEQadmin2, 08-11-2026, 10:35 AM
          0 responses
          10 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 08-06-2026, 07:41 AM
          0 responses
          29 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 08-03-2026, 10:13 AM
          0 responses
          48 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 07-31-2026, 02:55 AM
          0 responses
          48 views
          0 reactions
          Last Post SEQadmin2  
          Working...