Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Giffredo
    Member
    • Feb 2014
    • 36

    SAMtool merge/cat problem

    Hi guys,

    I d like to cat or merge 2 BAMs file. My problem is that I try to cat the two BAMs but when I ve used IGV to see the result the file doesn t work well. the 2 BAMs file instead (after sorted and indexed of course) work normally.
    I concluded that likely the problem is in cat process so I try merge command, but the program give me error: "different target sequence name".
  • Giffredo
    Member
    • Feb 2014
    • 36

    #2
    I read http://seqanswers.com/forums/showthr...153#post126153

    my problem is different in the head of .sam I have 4 "@" in which 2@SQ
    SN:chrM LN: ......
    SN:chrC LN: ......

    But both SAMs have the same "head" so why samtool merge BAMs:
    "samtools merge output.bam 1input.bam 2input.bam&"
    gives me error:
    different target sequence name ifferent target sequence name: 'chrC' != 'chrM' in file 2input.bam
    Could be happen something during the conversion from sam to bam?

    Comment

    • dpryan
      Devon Ryan
      • Jul 2011
      • 3478

      #3
      You can't merge BAM files that don't contain sequences mapped to the same reference (well, technically you can, but the result would be useless). (1) How did you create the BAM files? (2) Given that they seem to be mapped to different things, why do you want to merge them to begin with?

      Comment

      • Giffredo
        Member
        • Feb 2014
        • 36

        #4
        Thanks for the reply :-)
        The BAMs come from bowtie and tophat used on the same references. They maps the same things... Bowtie maps only a part of the total submitted to tophat.
        I want to merge these 2 output to reach the max yield in term of reads mapped possible.

        Maybe Can I merge the SAMs file but I don t know how.. :-/

        Comment

        • dpryan
          Devon Ryan
          • Jul 2011
          • 3478

          #5
          What do the headers of each BAM look like? Do they each contain the same contigs, but just in a different order?

          Comment

          • Giffredo
            Member
            • Feb 2014
            • 36

            #6
            the first line is: ÿBCsrôeLc``pðpá

            they contain contings from the same genome but the 2 programs use different mapping method. So I mapped the reads with one program, and by the second program I mapped all the reads that the first one didn t map..

            Comment

            • dpryan
              Devon Ryan
              • Jul 2011
              • 3478

              #7
              If that's from "samtools view -H" then it looks like the file is corrupted.

              Comment

              • Giffredo
                Member
                • Feb 2014
                • 36

                #8
                Sorry I make a mistake..

                samtools view -H 1.bam&

                @HD VN:1.0 SO:unsorted
                @SQ SN:chr2 LN:3......
                @SQ SN:chr1 LN:1......
                @PG ID:bowtie2 PN:bowtie2 VN:2.1.0


                samtools view -H 2.bam&

                @HD VN:1.0 SO:coordinate
                @SQ SN:chr1 LN:1.....
                @SQ SN:chr2 LN:3.....
                @PG ID:TopHat VN:2.0.9

                Comment

                • dpryan
                  Devon Ryan
                  • Jul 2011
                  • 3478

                  #9
                  So yes, the chromosomes are just in a different order. Just coordinate sort the bowtie results and make sure the chromosomes are in the same order in the header. Then you'll be able to merge things.

                  Comment

                  • Giffredo
                    Member
                    • Feb 2014
                    • 36

                    #10
                    Thank you very much Dpryan! I will try!

                    Comment

                    Latest Articles

                    Collapse

                    • 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
                    • SEQadmin2
                      Cancer Drug Resistance: The Lingering Barrier to Rising Survival
                      by SEQadmin2



                      Cancer survival rates have significantly increased in the last few decades in the United States, reaching a combined 70% 5-year survival rate by 2021. Behind this number, there are years of research to find new therapies, drug targets, and early detection methods. But there is one core challenge that keeps slowing down these advances, and it’s about drug resistance.

                      There is no single reason why many patients don’t respond to treatment as expected. Cancer is...
                      07-08-2026, 05:17 AM
                    • GATTACAT
                      Reply to Nine Things a Sample Prep Scientist Thinks About Before Sequencing
                      by GATTACAT
                      Love this - good data definitely starts from good input, and poor input can only give relatively poor data. I particularly like the mention of Nanodrop/absorbance based methods for quantification. It's such a toss up if you'll get an accurate reading or what amounts to a randomly generated number, and a lot of library/sequencing related issues can be traced back to poor quant.
                      07-01-2026, 11:43 AM

                    ad_right_rmr

                    Collapse

                    News

                    Collapse

                    Topics Statistics Last Post
                    Started by SEQadmin2, 07-13-2026, 10:26 AM
                    0 responses
                    24 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 07-09-2026, 10:04 AM
                    0 responses
                    33 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 07-08-2026, 10:08 AM
                    0 responses
                    21 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 07-07-2026, 11:05 AM
                    0 responses
                    34 views
                    0 reactions
                    Last Post SEQadmin2  
                    Working...