Editing
Dinh/Dinh 2014/NOTES/2014-1-23
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== SAM record parser === * In order to perform haplotype analysis, I needed to write a SAM record parser so that I can analyze each read and determine the CG positions and their methylation status. This works like samtools pileup but since the current version of samtools mpileup requires a bam file as input and a reference fasta file as input, it is probably more efficient to skip using samtools mpileup. * The SAM parser needs to identify the position of each read base, and the mismatch positions. Since there are INDELS and H/S clippings, it needs to integrate both the CIGAR and MD:Z fields. * Script for finding mismatch positions in SAM file: [[File:ddSAMparse.txt]] * Script for counting the CpG locus alleles (also makes BED): [[File:cgLocusAlleles.txt]] * To compare the parsing results, use sam parser to generate a BED format file for CpG positions & compare with results obtained from samtools pileup -> methylFreq -> BED NP-GP1V6-Ind1-16-Dec26-Ind10_S10.BED.txt : cor = 0.9999383 NP-GP1V6-Ind1-16-Dec26-Ind11_S11.BED.txt : cor = 0.9999235 NP-GP1V6-Ind1-16-Dec26-Ind12_S12.BED.txt : cor = 0.9999451 NP-GP1V6-Ind1-16-Dec26-Ind13_S13.BED.txt : cor = 0.9999285 NP-GP1V6-Ind1-16-Dec26-Ind14_S14.BED.txt : cor = 0.9998338 NP-GP1V6-Ind1-16-Dec26-Ind15_S15.BED.txt : cor = 0.9999977 NP-GP1V6-Ind1-16-Dec26-Ind16_S16.BED.txt : cor = 0.9999913 NP-GP1V6-Ind1-16-Dec26-Ind9_S9.BED.txt : cor = 0.9999657 * There are some positions where in the SAM record parsing produced slightly different results from samtools pileup. An example of non-concordance call: samtools pileup: chr9 100610863 100610864 '9/19' 19 + 100610863 100610864 90,150,0 sam parser: chr9 100610863 100610864 '9/49' 49 + 100610863 100610864 30,210,0 * Fixed an error with extractMethyl.pl, the Regex for indels can't be used to remove them. Regex for indels: \+[0-9]+[ACGTNacgtn]+' \-[0-9]+[ACGTNacgtn]+' Example: ...TTTT.T.T..TTT-1GTT-1GT-1GTTTTT-1GTTTTT-1GT-1GTT-1GTTTTTTTTTTTTTT..T --------------------------------------------------- *** *** *** *** *** *** *** The positions marked with dashes at the bottom were removed using the regex for indels. However, only the positions marked with stars should be removed. * Also, samtools pileup always convert 64 to 33 (even when the base quality is already in 33). * Re-generate BED files from extractMethyl & calculated the correlation again. They are improved slightly and even have perfect correlation for some data files.
Summary:
Please note that all contributions to ZhangLabWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
ZhangLabWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main Page
Current events
Recent changes
Random page
Investigators
Matt Cai
Song Chen
Eric Chu
Dinh Diep
Elizabeth Duong
Shicheng Guo
Alan Fung
Daniel Jacobsen
Blue Lake
Huy Lam
Alice Li
Andrew Richards
Brandon Sos
Chris Wei
Yan Wu
Kun Zhang
Tools
What links here
Related changes
Special pages
Page information