Question: pysam: Use read ID to access location
0
gravatar for bd2810
2.7 years ago by
bd28100
bd28100 wrote:

I know the read_ids of my reads, but I want to know, i.e. "chr1:100-120". Therefore I'm trying to access the read from a bam/sam file using the read id but I have not had any luck with pysam so far. Does anyone know how I could do this?

bam file pysam python • 1.1k views
ADD COMMENTlink modified 2.7 years ago • written 2.7 years ago by bd28100

It's always clearer with an example. Do you want to access the sequence of your read using chr1:100-120 or the possible gene at this position ?

Could you detailed this please :

I want to know the location

ADD REPLYlink written 2.7 years ago by Bastien Hervé4.9k
1
gravatar for Devon Ryan
2.7 years ago by
Devon Ryan98k
Freiburg, Germany
Devon Ryan98k wrote:

You can't do that, you can only iterate over all of the reads and check if they match your read_ids. Note that this is not a limitation of pysam, it's implicitly not meant to work in the BAM and CRAM formats.

ADD COMMENTlink modified 2.7 years ago • written 2.7 years ago by Devon Ryan98k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2153 users visited in the last hour
_