This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Extract read positions from a bas file and use as a list in Python

I would like to extract all the positions of the reads from a specific contig in a bam file and import them as a list in python for downstream analysis. Can someone recommend how to do that?

bam python

What have you tried?

Used samtools to extract positions of the reads of the contigs I need, directed that into a csv file and now I am stuck. I tried to read that file using read_csv in python, but it does not work.

I guess the reason for that is this is the first time I am working in Azure, and I am not sure I am indicating the path/link to the file on the drive correctly. I would really appreciate some help in this regard as well.

I'm not familiar with Azure in command line context, you may want to try and fix the problem on a local machine before porting working code to the cloud platform.

reads from a specific contig

As in reads that are aligned to a specific contig reference? Otherwise this does not make sense since there will be no individual reads inside a contig.

Yes, they are aligned to that contig in a bam file

0 answers

No answers yet.

Log in to answer this question.