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

How to link RNA families to pdb ids (RNA family label) #14

Open
OliviaViessmann opened this issue Sep 17, 2024 · 1 comment
Open

How to link RNA families to pdb ids (RNA family label) #14

OliviaViessmann opened this issue Sep 17, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@OliviaViessmann
Copy link

Hello,
I am trying to match the pdb_chain_id to RNA family labels. Is there a dictionary/json with the mapping?
I wasn't able to find it browsing through the repo.

Thank you in advance
Olivia

@marcellszi
Copy link
Owner

Hi @OliviaViessmann,

There is no dictionary/JSON that directly maps the families to the chains. See #5 for a discussion on the topic.

We have the output of the Infernal search 2024-04-26-full-cmscan.tbl which contains this information. The Tabular API can be used to read these files a lot like a dictionary. See this example.

If you really wanted this information in a Python dictionary, it is very easy to do this with the Tabular API. You could do something like:

from rna3db.tabular import read_tbls_from_dir
from collections import defaultdict
tbl = read_tbls_from_dir('data/') #NOTE: this is the *directory* containing the .tbl file(s)
family_dict = defaultdict(list)
for hit in tbl:
    family_dict[hit.query_name].append(hit._asdict())

This will create a dictionary that maps the name of the chains to a list of the hits for that chain. Each hit is a dictionary that contains the usual keys (target_name, target_accession, etc.).

@marcellszi marcellszi added the enhancement New feature or request label Sep 20, 2024
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