Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • prs321
    Member
    • Jun 2013
    • 96

    #1

    bamToFastq not working with .bam file from bwa-mem

    I have aligned my paired end reads using bwa mem. I then filtered my .bam file in order to obtain a .bam file that has all the unmapped reads.

    When I tried to take this .bam file and convert it into 2 .fq reads for each replicate, i kept getting this error:

    *****WARNING: Query M00532:8:000000000-A17VF:1:2114:24702:5749 is marked as paired, but it's mate does not occur next to it in your .bam file. Skipping.


    What do I do?
  • DeeDeeBSE
    Junior Member
    • Jan 2012
    • 3

    #2
    Which bamToFastq tool are you using?

    Comment

    • prs321
      Member
      • Jun 2013
      • 96

      #3
      bedtools bamToFastq

      Comment

      • GenoMax
        Senior Member
        • Feb 2008
        • 7142

        #4
        When you filtered the data did you keep the other read if only one out of the pair was mapped? Looks like you did not do that.

        Comment

        • prs321
          Member
          • Jun 2013
          • 96

          #5
          Here is an example:

          M00532:8:000000000-A17VF:1:2110:8760:26938 121 NODE_140_length_92945_cov_15.514477 91194 60 28S101M126S = 91194 0 AATGTCGCCTCGGTCCGCCGACTCCCAGCCGCACCTACCTGACCGATGAACAGATCAATGGCGACTGTGCGGCGCTGCTGACGGCGCTGGCTTCGCGGTTGACCCCTGGCGAGAAGGTGAACGCCGAGTCTCCTTCCTCCTTCCCTCCCTCCTTTCCTCCTTCTCAGTGCGCACTTCGCCAGCATTCCTTCTCTTACCCCTTACTCTCTGACCCCTTCCACCCCGCGCTGCCGCAGGACGGGCTGTTGGTGCGCT //''-''-''''''.'.-.((((((.''-'<6/(.....(/(6=;;6.((/(EEEE?96<46.(6;2'45';5/<66/-'..5'2<<;6.-'''64/(6/((;6<;?269/((.6(669;42?6(///((((((((((((((''(('((.((((((-((/(((((-.'-'6/(1))@E@9*110***********<3+++++2++++++33)+43+5))55**5+5+CC5CAEC>>>CC@@@@@<@@<+===<5, NM:i:4 MD:Z:5A7G49G0G36 AS:i:81 XS:i:0 RG:Z:cof1 SA:Z:NODE_140_length_92945_cov_15.514477,91388,-,222S33M,60,1;
          M00532:8:000000000-A17VF:1:2110:8760:26938 2169 NODE_140_length_92945_cov_15.514477 91388 60 222H33M = 91388 0 CCGCGCTGCCGCAGGACGGGCTGTTGGTGCGCT *5+5+CC5CAEC>>>CC@@@@@<@@<+===<5, NM:i:1 MD:Z:32G0 AS:i:32 XS:i:0 RG:Z:cof1 SA:Z:NODE_140_length_92945_cov_15.514477,91194,-,28S101M126S,60,4;
          M00532:8:000000000-A17VF:1:2110:8760:26938 181 NODE_140_length_92945_cov_15.514477 91194 0 * = 91194 0 TGCTGCAGCGGATTACGCTTCACCGTCTGCCGTGCAGTTCGCAATTTCTCCACACGGCCCCGCCAGTGCATGCGGCCTGTTCCGGGTTTCCTACCTGCCCTGCCCCAACCCGTCCCCCGTCTCCGGGTGCCACTCCGTCGGATCCGCTTAACTCCTGGTGGATTTGTTGACCGCCCCCTGCTTCCGCGGTTGCTTGTCCGCCTGAATCCCCCCCCCTTGGGTTTTGGTTTTCCCCTCCACGCCGTCGTCCGCCA (((.''((((((((/'((((((('(('''.(/((/(''-(((((/(((((((''44'-'''/(.((((-('''(((((.'-'-(((;(/((.('(((''6-(''.'(.'-'.'4.'-((-'''.(/((((-(.-'.'9/..'''.(6./(/((((((((((.//(/.(-''.''-'((((('''-''(((6/(('--4..((((((-.'''5)<95+9E5+5++C5--5++*+5++>55<5555+55==<<=<, AS:i:0 XS:i:0 RG:Z:cof1



          Here is the command line i used after mapping my reads in order to filter:


          samtools view -u -f 4 –F 264 alignments.bam > tmps1.bam
          samtools view -u -f 8 -F 260 alignments.bam > tmps2.bam
          samtools view -u -f 12 -F 256 alignments.bam > tmps3.bam
          samtools merge –u output.bam input1.bam input2.bam input3.bam
          samtools sort –n input.bam output

          bamToFastq –i unmapped.bam –fq unmapped_reads1.fastq –fq2 unmapped_reads2.fastq

          Comment

          • prs321
            Member
            • Jun 2013
            • 96

            #6
            bump still need help

            Comment

            • prs321
              Member
              • Jun 2013
              • 96

              #7
              bump still need help

              Comment

              • prs321
                Member
                • Jun 2013
                • 96

                #8
                bump still need help

                Comment

                • prs321
                  Member
                  • Jun 2013
                  • 96

                  #9
                  bump still need help

                  Comment

                  • dpryan
                    Devon Ryan
                    • Jul 2011
                    • 3478

                    #10
                    I don't know that bamToFastq supports chimeric alignments, such as the one you showed.

                    Comment

                    • prs321
                      Member
                      • Jun 2013
                      • 96

                      #11
                      Originally posted by dpryan View Post
                      I don't know that bamToFastq supports chimeric alignments, such as the one you showed.
                      When I used novoalign and then converted my bam file into the unmapped fastq files, the unmapped fastq files did not contain any chimeric reads.

                      But the BWA one does. Is it better to just to leave these reads out?

                      Comment

                      • dpryan
                        Devon Ryan
                        • Jul 2011
                        • 3478

                        #12
                        Given that novoalign at least used to not produce chimeric alignments, that's not surprising. You can just filter out the reads with the 0x800 bit set in the flag and then things should work.

                        Comment

                        • prs321
                          Member
                          • Jun 2013
                          • 96

                          #13
                          So essentially get rid of the chimeric alignments? How do I "filter" them using BWA? or what program will I end up using?

                          Comment

                          • dpryan
                            Devon Ryan
                            • Jul 2011
                            • 3478

                            #14
                            Code:
                            samtools view -bF 0x800 foo.bam > foo.filtered.bam

                            Comment

                            Latest Articles

                            Collapse

                            • SEQadmin2
                              16S/ITS Profiling vs. Shotgun Metagenomics: What Changes in Your Workflow?
                              by SEQadmin2




                              NGS has revolutionized clinical microbiology by offering new ways to identify and surveil pathogens without prior knowledge of the target. One popular approach is 16S rRNA and ITS amplicon sequencing, which targets specific microbial markers. But studies are increasingly incorporating shotgun metagenomics, a technique that sequences all DNA from a sample without targeting specific microbial markers. This approach allows more detailed taxonomic classification, detection...
                              Today, 06:46 AM
                            • SEQadmin2
                              Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
                              by SEQadmin2



                              Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

                              Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
                              ...
                              10-14-2026, 09:55 AM

                            ad_right_rmr

                            Collapse

                            News

                            Collapse

                            Topics Statistics Last Post
                            Started by SEQadmin2, 10-28-2026, 09:57 AM
                            0 responses
                            22 views
                            0 reactions
                            Last Post SEQadmin2  
                            Started by SEQadmin2, 10-28-2026, 09:51 AM
                            0 responses
                            14 views
                            0 reactions
                            Last Post SEQadmin2  
                            Started by SEQadmin2, 10-22-2026, 11:13 AM
                            0 responses
                            67 views
                            0 reactions
                            Last Post SEQadmin2  
                            Started by SEQadmin2, 10-22-2026, 10:48 AM
                            0 responses
                            47 views
                            0 reactions
                            Last Post SEQadmin2  
                            Working...