Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • desmo
    Member
    • Nov 2011
    • 25

    Extract reads with a specific mutation

    Hi everyone,
    I would like to extract from a bam file all the reads that are carrying a specific mutation.
    I know that samtools give the possibility to extract reads in a specific region, but if I would like to extract just these one that have a mutation what can I do?
    I would really appreciate any kind of help
    Thanks in advance
  • maasha
    Senior Member
    • Apr 2009
    • 153

    #2
    I am not quite sure, if this is what you want, but with Biopieces (www.biopieces.org) you can read in a SAM file and grab for a specific position, and then a specific event like this:

    Code:
    read_sam -i input.sam |
    find_SNPs |
    grab -e 'POS == 1234' |
    grab -e 'EVENT eq 'G>C'
    Unfortunately Biopieces cannot write SAM format (which is evil), but you can dump a table with write_tab.

    Comment

    • desmo
      Member
      • Nov 2011
      • 25

      #3
      Thanks Maasha,
      your suggestion was really good. I've installed biopieces and it works great but I have one more question. Do you know how to run biopieces from a perl script? I need it to solve my problem. I don't know if you use perl. If yes do you know why it doesn't work with the command system?

      $cmd='read_sam -i FileIN.txt -O FileOUT.txt';
      #system($cmd);

      Comment

      • maasha
        Senior Member
        • Apr 2009
        • 153

        #4
        That should work just fine. This does:

        Code:
        perl -e '$cmd = "read_sam -n 1 -i test.sam | count_records"; system($cmd);'

        Comment

        • desmo
          Member
          • Nov 2011
          • 25

          #5
          Thanks. It works great. And thanks for let me know about biopieces, it looks really helpful.

          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, Yesterday, 11:08 AM
          0 responses
          7 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 06-30-2026, 05:37 AM
          0 responses
          12 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 06-26-2026, 11:10 AM
          0 responses
          20 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...