kmayerb / tcrdist3

flexible CDR based distance metrics
MIT License
53 stars 17 forks source link

BCR distance #101

Open ChangLu92 opened 4 months ago

ChangLu92 commented 4 months ago

Hi, I just wonder if I can use this to calculate BCR distance if I replace the reference database file from TR to IG? Or are there any other things that need to be modified? Thanks a lot!

kmayerb commented 3 days ago

You might checkout the following:

We've updated tcrdist3 so the latest version now defaults to using

db_file = combo_xcr_2024-03-05.tsv

You will find that this now includes IGH genes. TCRdist wasn't intended for BCR comparison but it is possible.

pip install tcrdist3
from tcrdist.repertoire import TCRrep
import pandas as pd
data = pd.DataFrame({'v_b_gene':['TRBV5-1*01'], 'cdr3_b_aa':['CASSSSSF']})
tr = TCRrep(cell_df = data, organism = "human", chains = ['beta'])
print(tr.db_file)
print(tr.all_genes.keys())
print(tr.all_genes['human'].keys())