Hello,
I'm using the Pysam module of Python and calling the function:
VF = VariantFile("input_file")
VF.fetch()
seems to retrieve all reads in the file,
while this retrieves reads from positions 0 to 1000 in one specific contig:
VF.fetch(contig="contig_name", start=0, end=1000)
My question is: is it possible to retrieve sequences based on positions without specifying the contig name? Or better, specifying multiple contig names? (gives error, expects one string).
This is because I have a file with multiple contigs, but I would like to get for example all reads in positions 0:1000 in all contigs.
If I do this:
VF.fetch( start=0, end=1000)
It ignores my start and end specification, and retrieves all reads, like if it were no arguments inside fetch.
Brilliant! Sometimes you just have to go around the problems, not force your way through.
Danke schön!
Ricardo