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

The identity is different with imgt website #65

Open
qiuqingpo opened this issue Jul 26, 2023 · 0 comments
Open

The identity is different with imgt website #65

qiuqingpo opened this issue Jul 26, 2023 · 0 comments

Comments

@qiuqingpo
Copy link

Dear Dr Fergus Boyles

thank you for reading this e-mail, i have some problems for using ANARCI

The similarity calculation is a bit problematic compared with imgt, in imgt, the allele "IGKV1S1*01" identity is 0.89, but we get the value is 0.84
my test code is bellow:

def get_identity( state_sequence, germline_sequence ):
    """
    Get the partially matched sequence identity between two aligned sequences. 
    Partial in the sense that gaps can be in the state_sequence.
    """
    # Ensure that the sequences are the expected length
    assert len( state_sequence) == len(germline_sequence ) == 128
    n, m = 0, 0
    for i in range( 128 ):
        if germline_sequence[i] == "-":continue
        if state_sequence[i].upper() == germline_sequence[i]: m+=1
        n+=1

    if not n:
        return 0    
    return float(m)/n

def main():
    #'IGKV1S1*01'
    identity = get_identity('AVVLTQTASPVSAAVGGTVTINCQASQSVY----KNNRLAWYQQKPGQPPKLLIYGA-------STLASGVP-SRFKGSG--SGTQFTLTISDLECDDAATYYCAGGY---SGNINVFGGGTEVVVK-','ALVMTQTPSPVSAAVGGTVTISCQSSESVY----SNNRLSWFQQKPGQPPKLLIYTA-------SSLASGVP-SRFKGSG--SGTQFTLTISGVECDDAATYYCAGYK--------------------')
    print(identity) #0.84
    #'IGKV1S2*01'
    identity = get_identity('AVVLTQTASPVSAAVGGTVTINCQASQSVY----KNNRLAWYQQKPGQPPKLLIYGA-------STLASGVP-SRFKGSG--SGTQFTLTISDLECDDAATYYCAGGY---SGNINVFGGGTEVVVK-','AQVLTQTESPVSAPVGGTVTINCQASQSVY----DNNWLSWYQQKPGQPPKLLIYDA-------SKLASGVP-SRFSGSG--SGTQFTLTISGVQCDDAATYYCQGSY--------------------')
    print(identity) #0.85

main()
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