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 get v_identity, j_identity against with germline ? #14

Open
0x1orz opened this issue Oct 29, 2022 · 1 comment
Open

how to get v_identity, j_identity against with germline ? #14

0x1orz opened this issue Oct 29, 2022 · 1 comment

Comments

@0x1orz
Copy link

0x1orz commented Oct 29, 2022

how to get v_identity, j_identity against with germline , of which a output of anarci if assign_germline ?

@prihoda
Copy link
Owner

prihoda commented Oct 31, 2022

Hi @sheljoy, something like this might work:

chain = Chain(seq, 'imgt')

v_germline_chains, j_germline_chains = chain.find_human_germlines(limit=1)
top_v, top_j = v_germline_chains[0], j_germline_chains[0]

num_v_matches = sum(top_v.positions.get(pos) == aa for pos, aa in chain)
num_j_matches = sum(top_j.positions.get(pos) == aa for pos, aa in chain)

v_identity = num_v_matches / len(top_v)
j_identity = num_j_matches / len(top_j)
full_identity = (num_v_matches + num_j_matches) / len(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

2 participants