biopython / biopython/biopython
Parse Genbank/EMBL feature qualifiers into dict
- Dominant language
- Python
- Stars
- 5.2k
- Forks
- 1.9k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 11
Description
Feature qualifiers anticodon, rpt_unit_range, tag_peptide, and transl_except values are complex data and should be parsed.
Example value:
`(pos:678..680,aa:Leu,seq:taa)`
This should be parsed into a dict:
```
{
'pos': CompoundLocation(678..680),
'aa': Seq('Leu', Bio.Alphabet.ThreeLetterProtein()),
'seq':Seq('taa'),
}
```
Parsing the `pos` element requires the same logic as the location descriptor.
This will require factoring out:
https://github.com/biopython/biopython/blob/264c68972909bf0c74cf6736fae36a703d82fe62/Bio/GenBank/__init__.py#L1016-L1184
The alternative is a hack along the lines of:
```python
from Bio.Genbank import _FeatureConsumer
consumer = _FeatureConsumer()
consumer._expected_size = len(record)
consumer._cur_feature = SeqFeature()
consumer._seq_type = "circular" #TODO
consumer.location(qualifier.pos)
qualifier.pos = consumer._cur_feature.location
```
I would appreciate any input as per the state of the linked code or any alternatives to gain this functionality.
Contributor guide
Assessment
This issue has not been assessed yet.