INNER CODE UNIT · Python
parse_gff
cbg-ethz/V-pipe · workflow/scripts/assemble_visualization_webpage.py:80
def parse_gff(fname):
"""Convert GFF to map."""
features = []
print(f'Parsing GFF: "{fname}"')
with open(fname) as fd:
for record in GFF.parse(fd):
for feature in record.features:
features.append(
{
"id": record.id,
"type": feature.type,
"name": feature.qualifiers.get("Name", [feature.id])[0],
"start": int(feature.location.start),
"end": int(feature.location.end),
}
)
return features