Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dpryan
    Devon Ryan
    • Jul 2011
    • 3476

    #16
    Originally posted by capricy View Post
    looks like most of my alignment has ~60% properly paired reads. I wonder if there is way to filter the bam bile and separate the paired reads/singleton... to feed the dexseq...
    Was that meant to be a challenge ?

    Code:
    #!/usr/bin/env python
    import csv
    import sys
    
    f = csv.reader(sys.stdin, dialect="excel-tab")
    of = csv.writer(sys.stdout, dialect="excel-tab")
    previous = None
    for line in f :
        if((int(line[1]) & 0x100) != 0) :
            #Don't output secondary alignments
            continue 
        if((int(line[1]) & 0x2) == 0) :
            #Skip anything not properly paired
            continue
        if(previous != None and line[0] == previous[0]) :
            of.writerow(previous)  
            of.writerow(line)
            previous = None
        else :
            previous = line
    Usage would be something like:
    Code:
    samtools view namesorted.bam | filter.py | dexseq_count.py ....
    That will filter out anything that's not properly paired, has is a secondary alignment, or is missing its mate. You can use that as a basis if you want to filter in a different way.

    Comment

    Latest Articles

    Collapse

    • SEQadmin2
      The Factors Reshaping Genome Assembly
      by SEQadmin2



      When the Human Genome Project declared the human genome finished in 2003, portions of the sequence were still missing, including many of its most repetitive and structurally complex regions.1 Still, for the next two decades, researchers analyzed their sequencing data against the single linear reference that came out of this effort. Released in 2013 as GRCh38, that reference has powered countless discoveries, but it has gaps and cannot capture the genetic diversity of the world’s...
      11-24-2026, 07:04 AM
    • 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-23-2026, 11:11 AM
    0 responses
    32 views
    0 reactions
    Last Post SEQadmin2  
    Started by SEQadmin2, 11-17-2026, 06:27 AM
    0 responses
    42 views
    0 reactions
    Last Post SEQadmin2  
    Started by SEQadmin2, 11-12-2026, 07:59 AM
    0 responses
    65 views
    0 reactions
    Last Post SEQadmin2  
    Started by SEQadmin2, 11-05-2026, 09:25 AM
    0 responses
    67 views
    0 reactions
    Last Post SEQadmin2  
    Working...