Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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?

  • #2
    Which bamToFastq tool are you using?

    Comment


    • #3
      bedtools bamToFastq

      Comment


      • #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


        • #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


          • #6
            bump still need help

            Comment


            • #7
              bump still need help

              Comment


              • #8
                bump still need help

                Comment


                • #9
                  bump still need help

                  Comment


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

                    Comment


                    • #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


                      • #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


                        • #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


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

                            Comment

                            Latest Articles

                            Collapse

                            • seqadmin
                              Advancing Precision Medicine for Rare Diseases in Children
                              by seqadmin




                              Many organizations study rare diseases, but few have a mission as impactful as Rady Children’s Institute for Genomic Medicine (RCIGM). “We are all about changing outcomes for children,” explained Dr. Stephen Kingsmore, President and CEO of the group. The institute’s initial goal was to provide rapid diagnoses for critically ill children and shorten their diagnostic odyssey, a term used to describe the long and arduous process it takes patients to obtain an accurate...
                              12-16-2024, 07:57 AM
                            • seqadmin
                              Recent Advances in Sequencing Technologies
                              by seqadmin



                              Innovations in next-generation sequencing technologies and techniques are driving more precise and comprehensive exploration of complex biological systems. Current advancements include improved accessibility for long-read sequencing and significant progress in single-cell and 3D genomics. This article explores some of the most impactful developments in the field over the past year.

                              Long-Read Sequencing
                              Long-read sequencing has seen remarkable advancements,...
                              12-02-2024, 01:49 PM

                            ad_right_rmr

                            Collapse

                            News

                            Collapse

                            Topics Statistics Last Post
                            Started by seqadmin, 12-17-2024, 10:28 AM
                            0 responses
                            24 views
                            0 likes
                            Last Post seqadmin  
                            Started by seqadmin, 12-13-2024, 08:24 AM
                            0 responses
                            42 views
                            0 likes
                            Last Post seqadmin  
                            Started by seqadmin, 12-12-2024, 07:41 AM
                            0 responses
                            28 views
                            0 likes
                            Last Post seqadmin  
                            Started by seqadmin, 12-11-2024, 07:45 AM
                            0 responses
                            42 views
                            0 likes
                            Last Post seqadmin  
                            Working...
                            X