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

                    ad_right_rmr

                    Collapse

                    News

                    Collapse

                    Topics Statistics Last Post
                    Started by SEQadmin2, Yesterday, 10:09 AM
                    0 responses
                    10 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 06-04-2026, 08:59 AM
                    0 responses
                    17 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 06-02-2026, 12:03 PM
                    0 responses
                    26 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 06-02-2026, 11:40 AM
                    0 responses
                    21 views
                    0 reactions
                    Last Post SEQadmin2  
                    Working...