Implementing a custom parser, similar to pysam.asBed()

31 views
Skip to first unread message

Amin

unread,
Aug 31, 2022, 9:18:20 AM8/31/22
to Pysam User group
Hi pysam community,

I am aware that pysam is able to read tabix indexed files. For example:

for row in tbx.fetch("chr1", 1000, 2000, parser=pysam.asBed()):
print("name is", row.name)

In this regard, I am interested to develop a custom parser similar to pysam.asBed().
For example, I would like this parser to only return rows where the "name" field is equal to a certain value. Or it should cast certain columns to integers.

I was unable to find the corresponding C (or preferably python) code that implement this in the github repository of pysam.
Would you please let me know where I can find the related codes? Or even better, if there is any documentation about this?

Thanks!

Best,
Amin
Reply all
Reply to author
Forward
0 new messages