Skip to content

PLIP Renumbering: Chain renumbering is not being used by PLIP? #75

@benjiemc

Description

@benjiemc

I am experiencing issues with interaction profiling after making changes to MHC numbering. It appears that a renumbering step is performed before using PLIP on the structures. However, the renumbered structures are not the ones being used by PLIP, as the original structure is utilised instead of the renumbered copy:

https://github.com/npqst/STCRpy/blob/main/stcrpy/tcr_interactions/TCRpMHC_PLIP_Model_Parser.py#L67-L97

renumbering is done here after creating copies of each chain:

tcr_and_mhc_chains = [
    c.copy()
    for c in list(tcr_pmhc_complex.get_chains())
    + list(tcr_pmhc_complex.get_MHC()[0].get_chains())
]
if renumber:
    # renumber each chain from one to N to avoid automated renumbering issues related to plip and openbabel
    renumbering = {}
    for chain in tcr_and_mhc_chains:
        renumbering[chain.id] = {}
        for new_idx, res in enumerate(chain.get_residues()):
            new_id = (" ", new_idx + 1, " ")
            renumbering[chain.id][new_id] = res.id
            res.id = new_id
    domain_assignment = tcr_pmhc_complex.get_domain_assignment()

But then the original tcr_pmhc_complex object is being used:

tcr_mhc_struct = PDB.Model.Model(id=0)
# add TCR chains to protein structure
for chain in tcr_pmhc_complex.get_chains():
    tcr_mhc_struct.add(chain)
# add MHC chain to protein structure
for chain in tcr_pmhc_complex.get_MHC()[0].get_chains():
    tcr_mhc_struct.add(chain)

io = PDB.PDBIO()
io.set_structure(tcr_mhc_struct)
io.save(TCR_MHC_FILE)

Am I right in thinking this isn't how it's supposed to work?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions