This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Problem with samtools view - retrieving reads mapped to a region

Hello all,

I would like to know if someone knows what is causing this message when I am using samview in order to retrieve all the reads that are falling in that region?

[main_samview] region "chr2:63209526-63209337" could not be parsed. Continue anyway.

I am using this command :

samtools view $aligmentFile $region  | cut -f1

Where $aligmentFile is my bam file and the $region is one of the several regions that I want to retrieve the reads.

For some regions, it works fine, but I have this message for several of them.

Thanks in advance for your responses,

rna-seq sequence software error

Can you post the complete command you are using?

Oh sure!! Sorry, I forgot. It is done now.

Hello Marvi,

make sure you have a chr2. I guess your chromosome names are not prefixed with chr. So the name is just 2.

fin swimmer

1 answer

chr2:63209526-63209337

The begin of your interval is larger than the end, so that interval is invalid.

Oohhh! So sorry I didn't pay attention to that!! My bad. So, thank you very much!!! and so sorry again.

Haha yeah it's obvious as soon as you see it, but can be very puzzling :)

FYI:

If an answer was helpful you should upvote it, if the answer resolved your question you should mark it as accepted.
Upvote|Bookmark|Accept

Done!! :) Thank you.

Log in to answer this question.