Target Generation

This module is used to define PMHC objects (including Target and Template objects) and Model objects. The class used to generate a PANDORA target is PANDORA.PMHC.Target.

This module also contain the Model class, carrying various information of the output models. These objects can be saved when using PANDORA.Pandora.Pandora.model with the argument pickle_out=True

Basic target Example:

>>> from PANDORA.PMHC import Target
>>>
>>> target = PMHC.Target(id = 'myTestCase',
>>>     MHC_class = 'II',
>>>     allele_type = 'HLA-A*0201'
>>>     peptide = 'LLFGYPVYV',
>>>     anchors = [2,9])
>>>

PMHC

class PANDORA.PMHC.PMHC.PMHC(id, allele_type, peptide='', MHC_class='I', M_chain_seq='', N_chain_seq='', anchors=[], helix=False, sheet=False)[source]

Bases: ABC

pMHC class. Acts as a parent class to Template and Target

Parameters
  • id – (string) PDB identifier

  • allele_type – (list) list of MHC alleles (or allele)

  • peptide – (string) peptide sequence

  • MHC_class – (string) either ‘I’ or ‘II’ denoting MHC class I and MHC class II respectively

  • M_chain_seq – (string) M chain sequence for the Alpha chain

  • N_chain_seq – (string) N chain sequence for the Beta chain

  • anchors – (list) list of integers specifying which residue(s) of the peptide should be fixed as an anchor during the modelling. MHC class I typically has 2 anchors, while MHC class II typically has 4.

class PANDORA.PMHC.PMHC.Template(id, allele_type, peptide='', MHC_class='I', M_chain_seq='', N_chain_seq='', anchors=[], helix=False, sheet=False, pdb_path=False, pdb=False, resolution=None)[source]

Bases: PMHC

Template structure class. This class holds all information of a template structure that is used for

homology modelling. This class needs a id, allele and the path to a pdb file to work. (sequence info of the chains and peptide can be fetched from the pdb)

Parameters
  • id – (string) PDB identifier

  • allele_type – (list) list of MHC alleles (or allele)

  • peptide – (string) peptide sequence

  • MHC_class – (string) either ‘I’ or ‘II’ denoting MHC class I and MHC class II respectively

  • M_chain_seq – (string) M chain sequence for the Alpha chain

  • N_chain_seq – (string) N chain sequence for the Beta chain

  • anchors – (list) list of integers specifying which residue(s) of the peptide should be fixed as an anchor during the modelling. MHC class I typically has 2 anchors, while MHC class II typically has 4.

  • pdb_path – (string) path to pdb file

  • pdb – (Bio.PDB) Biopython PBD object

  • resolution – (float) Structure resolution in Angstrom

parse_pdb()[source]

Loads pdb from path, updates self.pdb field and self.chain_seq/self.peptide if they were empty

info()[source]

Print the basic info of this structure

calc_contacts()[source]
calc_anchors()[source]
calc_anchor_contacts()[source]
class PANDORA.PMHC.PMHC.Target(id, allele_type, peptide, MHC_class='I', M_chain_seq='', N_chain_seq='', anchors=[], helix=False, sheet=False, templates=False, use_netmhcpan=False)[source]

Bases: PMHC

Target structure class. This class needs an ID (preferably a PDB ID), allele and pepide information.

Parameters
  • id – (string) PDB identifier

  • peptide – (string) peptide sequence

  • allele_type – (list) list of MHC alleles (or allele)

  • MHC_class – (string) either ‘I’ or ‘II’ denoting MHC class I and MHC class II respectively

  • M_chain_seq – (string) M chain sequence for the Alpha chain

  • N_chain_seq – (string) N chain sequence for the Beta chain

  • anchors – (list) list of integers specifying which residue(s) of the peptide should be fixed as an anchor during the modelling. MHC class I typically has 2 anchors, while MHC class II typically has 4.

  • templates – Template object. The user can specify that PANDORA uses a certain structure as template.

  • use_netmhcpan (bool) – If True, uses local installation of NetMHCPan to predict the anchors when anchor positions are not provided. Defaults to False.

info()[source]

Print the basic info of this structure

calc_contacts()[source]
calc_anchor_contacts()[source]
retrieve_MHCI_refseq(input_file=None)[source]

Retrieves MHC I reference sequence from fasta file.

Parameters

input_file (str, optional) – Path to the input reference fasta file. Defaults to None.

Returns

None.

Model

class PANDORA.PMHC.Model.Model(self, target, model_path='', output_dir=PANDORA.PANDORA_data, pdb=False, molpdf=0, dope=0)[source]

Initiate model object

Parameters
  • target – Target object

  • output_dir – (string) output directory

  • model_path – (string) path to hypothetical model

  • pdb – Bio.PDB object of the hypothetical model

  • molpdf – (float) molpdf score

  • dope – (float) DOPE score

calc_LRMSD(reference_pdb, atoms=['C', 'CA', 'N', 'O'])[source]
Calculate the L-RMSD between the decoy and reference structure (ground truth).

This function requires the pdb2sql module for L-RMSD calculation.

Parameters

reference_pdb – Bio.PDB object or path to pdb file

Returns: (float) L-RMSD

calc_Core_LRMSD(reference_pdb, atoms=['C', 'CA', 'N', 'O'])[source]

Calculate the L-RMSD between the decoy and reference structure (ground truth)

Parameters

reference_pdb – Bio.PDB object or path to pdb file

Returns: (float) L-RMSD

calc_flanking_LRMSD(reference_pdb, atoms=['C', 'CA', 'N', 'O'])[source]

Calculate the L-RMSD between the decoy and reference structure (ground truth)

Parameters

reference_pdb – Bio.PDB object or path to pdb file

Returns: (float) L-RMSD

PANDORA.PMHC.Model.merge_chains(pdb)[source]

Merges two chains of MHCII to one chain. pdb2sql can only calculate L-rmsd with one chain.

Parameters

pdb – Bio.PDB object

Returns: Bio.PDB object with its M and N chain merged as M chain

PANDORA.PMHC.Model.renumber(pdb_ref, pdb_decoy)[source]

aligns two pdb’s and renumber them accordingly.

Parameters
  • pdb_ref – Bio.PDB object

  • pdb_decoy – Bio.PDB object

Returns: Bio.PDB objects with renumbered residues

PANDORA.PMHC.Model.homogenize_pdbs(decoy, ref, output_dir, target_id='MHC', anchors=False, flanking=False)[source]

Make sure that the decoy and reference structure have the same structure sequences.

Parameters
  • decoy – Bio.PDB object of the decoy structure

  • ref – Bio.PDB object of the reference structure

  • output_dir – (string) directory that is used to write intermediate files

Returns: (tuple) Bio.PDB objects with the same structure sequence

PANDORA.PMHC.Model.get_Gdomain_lzone(ref_pdb, output_dir, MHC_class)[source]

Produce a lzone file for pdb2sql.

Parameters
  • ref_pdb (str) – path to the pdb file to use for the lzone

  • output_dir (str) – output directory

  • MHC_class (str) – Class of the MHC

Raises

Exception – In case there are unexpected chain names it raises an exception

Returns

Path to the output file

Return type

outfile (str)

PANDORA.PMHC.Model.remove_C_like_domain(pdb)[source]

Removes the C-like domain from a MHC struture and keeps only the G domain :param pdb: (Bio.PDB): Bio.PDB object with chains names M (N for MHCII) and P

Returns: (Bio.PDB): Bio.PDB object without the C-like domain

Anchors

PANDORA.PMHC.Anchors.pMHCI_anchors(pdb)[source]

Finds peptide anchor residues of p:MHCI complexes

Parameters

pdb – Bio.PDB object (or path to pdb file (string))

Returns: (list of ints) Peptide anchor residue positions

PANDORA.PMHC.Anchors.pMHCII_anchors(pdb)[source]

Finds peptide anchor residues of p:MHCII complexes

Parameters

pdb – Bio.PDB object (or path to pdb file (string))

Returns: (list of ints) Peptide anchor residue positions