Extract read positions from a bas file and use as a list in Python
0
0
Entering edit mode
21 months ago
bluebubbl19 ▴ 10

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 • 775 views
ADD COMMENT
0
Entering edit mode

What have you tried?

ADD REPLY
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

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

ADD REPLY

Login before adding your answer.

Traffic: 1759 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