Merck / BioPhi

BioPhi is an open-source antibody design platform. It features methods for automated antibody humanization (Sapiens), humanness evaluation (OASis) and an interface for computer-assisted antibody sequence design.
https://biophi.dichlab.org/
MIT License
131 stars 44 forks source link

unable to use cdr_grafting by BioPhi command-line interface #41

Closed Samuel-gwb closed 12 months ago

Samuel-gwb commented 12 months ago

When trying: biophi cdr_grafting mabs.fa --fasta-only --output humanized.fa

errors appears as: Error: No such command 'cdr_grafting'

I checked scripts and find methond "cdr_grafting" is in class CDRGraftingHumanizationParams of script biophi/humanization/methods/humanization.py.

How should cdr_grafting function should be used in command line?

prihoda commented 12 months ago

Hi @Samuel-gwb for CDR grafting there is no CLI, but you could write your own python script that utilizes the BioPhi function cdr_grafting_humanize_chain()

It would look something like this (not tested):

from biophi.humanization.methods.humanization import cdr_grafting_humanize_chain, CDRGraftingHumanizationParams
from abnumber import Chain

chain = Chain(seq, 'imgt')

params = CDRGraftingHumanizationParams() # See available args in biophi/humanization/methods/humanization.py
humanized = cdr_grafting_humanize_chain(chain, params=params)

See AbNumber for the documentation of the Chain object: https://github.com/prihoda/AbNumber

This could even be done using AbNumber alone, see method graft_cdrs_onto_human_germline: https://abnumber.readthedocs.io/en/latest/#abnumber.Chain.graft_cdrs_onto_human_germline

Samuel-gwb commented 11 months ago

Thanks David !