miRTop / mirtop

command lines tool to annotate miRNAs with a standard mirna/isomir naming
https://mirtop.readthedocs.org
MIT License
18 stars 21 forks source link

Function to read column 9 of GFF and return key:values dict #25

Closed lpantano closed 6 years ago

lpantano commented 6 years ago

Function that should go in:

https://github.com/miRTop/mirtop/blob/dev/mirtop/gff/body.py

That gets as input a line of the GFF file (https://github.com/miRTop/mirtop/blob/dev/data/examples/gff/correct_file.gff):

hsa-let-7a-1    miRBase21   isomiR  4   26  0   +   .   Read hsa-let-7a-5p.sA.t.ATGAGGTAGTAGGTTGTATAGT; UID bhJJ5WJL2; Name hsa-let-7a-5p; Parent hsa-let-7a-1; Variant iso_5p:+1,iso_3p:-1; Cigar 22M; Expression 11; Filter Pass; Hits 1;

and return a dict like:

{'Read': 'hsa-let-7a-5p.sA.t.ATGAGGTAGTAGGTTGTATAGT',
'UID': 'bhJJ5WJL2',
'Name': 'hsa-let-7a-5p',
...}

Always pairs are separated by ; and column 9 (or 8 if you use 0 based index)