Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Carlo
    Junior Member
    • Oct 2010
    • 4

    #1

    Tool for parsing mismatches out of a SAM file...

    Hi all, I'm looking for a tool or PERL module that could take each line from a SAM file and parse the CIGAR + MD strings to output the genomic coordinates of all mismatches (specifically SNPs). I know of multiple tools that will tally up the number and type of mismatches at each position in a genome, but what I need is the reference position of all SNPs within each pair of mates in my SAM files.

    I can write a PERL script to do this, but I'm hoping that I'm not the first person to encounter this issue!

    Thanks,

    Carlo
  • SNPsaurus
    Registered Vendor
    • May 2013
    • 525

    #2
    Do you care if these mismatches are real or sequencing errors? I would think starting from a vcf file or pileup, derived from the sam file, would be both easier to parse and eliminate many of the sequencing artifacts.
    Providing nextRAD genotyping and PacBio sequencing services. http://snpsaurus.com

    Comment

    • lindenb
      Senior Member
      • Apr 2010
      • 143

      #3
      I wrote SAM2Tsv : https://github.com/lindenb/jvarkit/wiki/SAM2Tsv

      Code:
      $ java -jar dist/sam2tsv.jar -A  \
          -r samtools-0.1.18/examples/toy.fa 
            samtools-0.1.18/examples/toy.sam
      r001    163 ref 0   T   .   7   T   M
      r001    163 ref 1   T   .   8   T   M
      r001    163 ref 2   A   .   9   A   M
      r001    163 ref 3   G   .   10  G   M
      r001    163 ref 4   A   .   11  A   M
      r001    163 ref 5   T   .   12  T   M
      r001    163 ref 6   A   .   13  A   M
      r001    163 ref 7   A   .   14  A   M
      r001    163 ref 8   A   .   .   .   I
      r001    163 ref 9   G   .   .   .   I
      r001    163 ref 10  A   .   .   .   I
      r001    163 ref 11  G   .   .   .   I
      r001    163 ref 12  G   .   15  G   M

      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
      39 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 11-17-2026, 06:27 AM
      0 responses
      47 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 11-12-2026, 07:59 AM
      0 responses
      68 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 11-05-2026, 09:25 AM
      0 responses
      68 views
      0 reactions
      Last Post SEQadmin2  
      Working...