Wrapper Module¶
This module is used to run PANDORA for large number of cases. It allows the user to insert all the cases in a csv/tsv file, add various information to them (template, anchor positions, M chain seq).
Wrapper Example:
>>> from PANDORA.Pandora import Pandora
>>> from PANDORA.Database import Database
>>> from PANDORA.Wrapper import Wrapper
>>>
>>> ## A. Load pregenerated database of all pMHC PDBs as templates
>>> db = Database.load('pandora_Database')
>>>
>>> ## B. Create the wrapper object
>>> wrap = Wrapper()
>>>
>>> ## C. Create all Target Objects based on peptides in the .tsv file
>>> wrap.create_targets('datafile.tsv', IDs_col=0,
>>> peptides_col=1, allele_col=2, db)
>>>
>>> ## C. Perform modelling
>>> wrap.run_pandora(num_cores=24)
Wrapper¶
- class PANDORA.Wrapper.Wrapper.Wrapper[source]¶
Bases:
objectPandora wrapper object.
- Parameters
None. –
- Returns
None.
- create_targets(data_file, database, MHC_class, delimiter='\t', header=True, IDs_col=None, peptides_col=0, allele_col=1, anchors_col=None, M_chain_col=None, N_chain_col=None, benchmark=False, verbose=False, start_row=None, end_row=None, use_netmhcpan=False)[source]¶
- Parameters
data_file (str) – Path to the input tsv/csv file containing targets information.
database (PANDORA.Database.Database) – Database object.
MHC_class (str) – MHC class of the targets, as ‘I’ or ‘II’.
delimiter (str, optional) – data_file delimiter. Do not use semicolons (‘;’) as separators. Defaults to ‘ ‘.
header (bool, optional) – If True, assumes the data_file has a header line and skips it. If your file has no header line, set it as False. Defaults to True.
IDs_col (int or None, optional) – Column of data_file containing the targets IDs. If None, will automatically assign an ID according to the row number. Defaults to None.
peptides_col (int, optional) – Column of data_file containing the targets peptides. Defaults to 0.
allele_col (int, optional) – Column of data_file containing the targets alleles. Umbiguous allele cases (where the allele might have multiple names) should be separated by a semicolon (‘;’). Defaults to 1.
anchors_col (int, optional) – Column of data_file containing the targets anchors. Anchors should be two numbers separated by a semicolon (‘;’). Defaults to 2.
M_chain_col (None or int, optional) – Column of data_file containing the targets M chain sequences.
N_chain_col (None or int, optional) – Column of data_file containing the targets N chain sequences (only for MHCII).
benchmark (bool, optional) – Set True only for benchmarking purpose, if target structures are available. Defaults to False.
start_row (None or int) – Starting row of data_file, to use when splitting the data_file into multiple batches. This allows to specify from which row the samples for this job start.
end_row (None or int) – Ending row of data_file, to use when splitting the data_file into multiple batches. This allows to specify at which row the samples for this job end.
use_netmhcpan (bool, optional) – If True, uses local installation of netMHCPan to predict anchor positions for each target.
- Returns
None.
- run_pandora(num_cores=1, n_loop_models=20, n_jobs=None, benchmark=False, output_dir=False, pickle_out=False)[source]¶
Runs Pandora in parallel jobs.
- Parameters
num_cores (int, optional) – Number of parallel PANDORA jobs. Each one will be sent to a different core. Defaults to 1.
n_loop_models (int, optional) – Number of loop models. Defaults to 20.
n_jobs (int, optional) – Number of parallel MODELLER loop jobs. Do not increase further than n_loop_models. Defaults to None.
benchmark (bool, optional) – Set True only for benchmarking purpose, if target structures are available. Defaults to False.
output_dir (str, optional) – Output directory path. Defaults to False.
pickle_out (bool, optional) – If True, outputs a pickle file containing every model object. Defaults to False.
- Returns
None.
run_model¶
- PANDORA.Wrapper.run_model.run_model(args)[source]
Runs one modelling job. Meant to be runned from Pandora.Wrapper
- Parameters
args (list) – List of arguments. Should be containing the following, in order.
target (Pandora.PMHC.PMHC.Target) – Target object.
template (Pandora.PMHC.PMHC.Template) – Template object.
n_loop_models (int, optional) – Number of loop models. Defaults to 20.
benchmark (bool, optional) – Set True if running a benchmark to retrieve models RMSD with reference structures. Defaults to False.
- Returns
None.