Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Description dictionary #12

Open
freiburgermsu opened this issue Apr 16, 2022 · 0 comments
Open

Description dictionary #12

freiburgermsu opened this issue Apr 16, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@freiburgermsu
Copy link

Hello,

I believe that the description of each ORF would be more accessible as a dictionary, instead of a string that is delimited with ;, :, and =. I am able to convert the string into a desirable dictionary

{'ID': '1', 'ORF_type': 'complete', 'ORF_len': '912', 'ORF_frame': '1', 'Start': 'TTG', 'Stop': 'TAA'}

through the following code

import orfipy_core

for start, stop, strand, description in orfipy_core.orfs(mers_sequence.upper()):
    descriptions = {}
    for info in description.split(';'):
        if '=' in info:
            info = info.split('=')
            name, content = info[0], info[1]
            if name == 'ID':
                content = content.split('.')[1]
        else:
            info = info.split(':')
            name, content = info[0], info[1]
        descriptions[name] = content

however, this functionality would be more conveniently integrated into the basic code of ORFIpy.

Thank you,
Andrew

@urmi-21 urmi-21 added the enhancement New feature or request label Aug 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants