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

                    • 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
                    • SEQadmin2
                      Nine Things a Sample Prep Scientist Thinks About Before Sequencing
                      by SEQadmin2


                      I’m not a sequencing expert. I’m a purification scientist who uses NGS to evaluate workflows my group develops. With this perspective, we think about the sample first and the NGS workflow second. The sequencer is an exceptionally honest reporter, but it can only report on what you give it, so whether you get clean, interpretable data from an NGS workflow is largely determined before you begin.

                      Here are nine questions we think about, in roughly the order they matter, before...
                      06-18-2026, 07:11 AM

                    ad_right_rmr

                    Collapse

                    News

                    Collapse

                    Topics Statistics Last Post
                    Started by SEQadmin2, 07-02-2026, 11:08 AM
                    0 responses
                    19 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 06-30-2026, 05:37 AM
                    0 responses
                    20 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 06-26-2026, 11:10 AM
                    0 responses
                    21 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 06-17-2026, 06:09 AM
                    0 responses
                    54 views
                    0 reactions
                    Last Post SEQadmin2  
                    Working...