Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • filtering properly paired reads and flagstat output

    Hi,

    i wanted to extract all reads out of my bam file, created with BWA2, having the flag: properly paired.
    To do this, I used: samtools view -f P my.bam > my_propPaired.bam
    To check if the filtering worked, I created also for my_propPaired.bam the samtools flagstat output with the expectation of getting 100% properly paired reads.
    What I actually get was the identical flagstat output as for the original file (my.bam)

    I compared the size of both bam-files and actually the my_propPaired.bam is smaller.

    does anyone has an idea what happend here?

    Many, many thanks in advance!!!

  • #2
    Passing "P" to "-f" won't work, try "samtools view -o my_propPaired.bam -hbf 0x2 my.bam". I don't actually know if the "h" option is needed when you output to a bam, but you might throw it in there anyway (I'm assuming that you actually wanted a BAM file, since that's the extension you used in your example).

    Comment


    • #3
      Thanks dpryan for the fast reply!

      actually I used the -b option, just fogott to post it... :/ SORRY!!!!

      i will try if it helps to change from P to 0x2 and using h.

      Comment


      • #4
        solution found

        it worked
        so one should not use P! Using -f 0x2 resulted in 100% properly paired reads

        Comment


        • #5
          Originally posted by volavii View Post
          it worked
          so one should not use P! Using -f 0x2 resulted in 100% properly paired reads
          Never discount the power of hexadecimal!

          Comment

          Latest Articles

          Collapse

          • seqadmin
            Essential Discoveries and Tools in Epitranscriptomics
            by seqadmin




            The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist...
            04-22-2024, 07:01 AM
          • seqadmin
            Current Approaches to Protein Sequencing
            by seqadmin


            Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
            04-04-2024, 04:25 PM

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by seqadmin, 04-11-2024, 12:08 PM
          0 responses
          59 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 04-10-2024, 10:19 PM
          0 responses
          57 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 04-10-2024, 09:21 AM
          0 responses
          51 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 04-04-2024, 09:00 AM
          0 responses
          55 views
          0 likes
          Last Post seqadmin  
          Working...
          X