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

Abnumber cannot renumber TCR with imgt #23

Open
ym-guan opened this issue Dec 2, 2024 · 0 comments
Open

Abnumber cannot renumber TCR with imgt #23

ym-guan opened this issue Dec 2, 2024 · 0 comments

Comments

@ym-guan
Copy link

ym-guan commented Dec 2, 2024

Hi! I found that when i use abnumber to renumber TCR with imge scheme, it told me something error, like follow
`AssertionError Traceback (most recent call last)
Cell In[10], line 1
----> 1 abchain = abnumber.Chain(seq, 'imgt')

File ~/miniconda3/envs/diffab/lib/python3.8/site-packages/abnumber/chain.py:96, in Chain.init(self, sequence, scheme, cdr_definition, name, assign_germline, allowed_species, **kwargs)
94 if isinstance(sequence, Seq):
95 sequence = str(sequence)
---> 96 results = _anarci_align(sequence, scheme=scheme, allowed_species=allowed_species, assign_germline=assign_germline)
97 if len(results) > 1:
98 raise ChainParseError(f'Found {len(results)} antibody domains in sequence: "{sequence}"')

File ~/miniconda3/envs/diffab/lib/python3.8/site-packages/abnumber/common.py:43, in _anarci_align(sequence, scheme, allowed_species, assign_germline)
41 v_gene = ali['germlines']['v_gene'][0][1] if assign_germline else None
42 j_gene = ali['germlines']['j_gene'][0][1] if assign_germline else None
---> 43 aa_dict = {Position(chain_type=chain_type, number=num, letter=letter, scheme=scheme): aa
44 for (num, letter), aa in positions if aa != '-'}
45 tail = sequence[end+1:]
46 results.append((aa_dict, chain_type, tail, species, v_gene, j_gene))

File ~/miniconda3/envs/diffab/lib/python3.8/site-packages/abnumber/common.py:43, in (.0)
41 v_gene = ali['germlines']['v_gene'][0][1] if assign_germline else None
42 j_gene = ali['germlines']['j_gene'][0][1] if assign_germline else None
---> 43 aa_dict = {Position(chain_type=chain_type, number=num, letter=letter, scheme=scheme): aa
44 for (num, letter), aa in positions if aa != '-'}
...
18 def _validate_chain_type(chain_type):
---> 19 assert chain_type in ['H', 'L', 'K'],
20 f'Invalid chain type "{chain_type}", it should be "H" (heavy), "L" (lambda light chian) or "K" (kappa light chain)'

AssertionError: Invalid chain type "A", it should be "H" (heavy), "L" (lambda light chian) or "K" (kappa light chain)`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant