Unconfigured Ad

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

    #1

    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

          • kinpict.com
            Reply to 16S/ITS Profiling vs. Shotgun Metagenomics: What Changes in Your Workflow?
            by kinpict.com
            The part about this topic feels surprisingly grounded, and the details on the page is the bit that made me slow down. I’d keep <a href="https://kinpict.com/">ai family photo generator</a> bookmarked for later.
            Today, 06:37 PM
          • 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,...
            10-30-2026, 06:46 AM

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by SEQadmin2, 11-12-2026, 07:59 AM
          0 responses
          27 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 11-05-2026, 09:25 AM
          0 responses
          35 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 11-03-2026, 11:54 AM
          2 responses
          56 views
          0 reactions
          Last Post kinpict.com  
          Started by SEQadmin2, 10-28-2026, 09:57 AM
          0 responses
          175 views
          0 reactions
          Last Post SEQadmin2  
          Working...