Locate A SNP Number of Reads for Variance and References using Pysam
1
0
Entering edit mode
9.6 years ago

Hi guys,

Quick question please. I have a snp with a chromosome number and location and would like to access the bam file for that particular snp in search for read numbers of reference and variance forward and reverse. How would I do that using python module pysam?

Thanks a lot in advance,

best.

SNP pysam python • 2.8k views
ADD COMMENT
0
Entering edit mode

Why the pysam restriction, if I may ask?

ADD REPLY
0
Entering edit mode

Hi Ram,

Could you please explain to me what do you mean ?

Thanks

ADD REPLY
0
Entering edit mode

Why does the problem need to be solved only using pysam? There has to be some reason to exclude possibly easier solutions that would involve just plain samtools, right?

ADD REPLY
0
Entering edit mode

I want to access the original read count numbers of a particular snp within the bam and to be able to compare the read count numbers with the read numbers in the Variant Calling File for that snp.

ADD REPLY
0
Entering edit mode

You might look at compartmentalizing the problem a bit differently: a tool/pipeline-section (I'll call it a segment) to get read counts for a variant, a segment to fetch the read counts from a VCF file given a variant, and a segment to compare these values. That way, you might use the best tool for each task and get your task done with the least programming required.

Disclaimer: This is my reductionist approach, you are free to experiment with others, of course.

ADD REPLY
0
Entering edit mode

I am working with python and my project is all based on programming that is why I asked for some illustration of using pysam to get the read numbers.

ADD REPLY
0
Entering edit mode

I see. I was just curious :)

ADD REPLY
0
Entering edit mode
9.6 years ago
Ying W ★ 4.3k

Look in the pysam documentation at how to use the pileup function

ADD COMMENT

Login before adding your answer.

Traffic: 1667 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6