jade.basic.structure package

jade.basic.structure.BasicPose module

class jade.basic.structure.BasicPose.BasicPose(pdb_file_path='')[source]
add_remark(remark)[source]
change_occupancy()[source]

Changes ALL occupancies in a PDB dictionary to 1.00 Returns PDB Dictionary.

clean_PDB()[source]

Removes HSD, Waters: Tries to fix atom and residue name inconsistencies. HAS worked for changing a single MD pdb (NAMD) frame to Rosetta file. PLEASE Expand if possible to alias all residues for Rosetta compatability. NOT gaurenteed, but SHOULD work ok.

combine_pdb(py_pdb)[source]

Combines pdb_map from instance of PyPDB to this one. Does not do any checks.

combine_pdb_map(pdb_map)[source]

Combines pdb_map passed with the PythonPDBs map

copy_all_but_chains_into_pdb_map(py_pdb, chains)[source]

Copies all data from one pdb_map of a py_pdb of all data except the specified chains into this one. Useful for reordering chains.

copy_chain_into_pdb_map(py_pdb, chain)[source]

Copies all data from one pdb_map of a py_pdb of a chain into the one held in this class. Useful for reordering chains.

get_all_residues_of_type(name3)[source]

Get PDB_Map subset of all residues of specific type

get_bb_data()[source]

Get pdb_map subset of only N, CA, and C atoms

get_chain(chain)[source]

Get Chain data as pdb_map subset

get_header()[source]

Get ‘header’ of PDB as list of strings

get_hetatms()[source]

Get hetatm data as pdb_map subset

get_pdb_map()[source]
get_remarks()[source]

Get ‘REMARK’ lines of PDB as a list of strings

get_residue(resnum, chain, icode='')[source]

Get PDB_Map subset of a specific residue

get_waters()[source]

Get water data as pdb_map subset

morph_line_in_pdb_map_to_pdb_line(entry)[source]

Oh What fun. ;) Magic Numbers?: (6,5,4,3,1,4,8,8,8,4,5);

pdb_alias(pairs, element)[source]

Replaces ALL occurances of old element with new from pair. pair is a dictionary. In C++ it would be an array of pairs. [string old]:[string new] For Specific functions, please see below.

pdb_atom_alias(line_num, pair)[source]

Replaces atom_names with ones Rosetta is happy with. pair is a dictionary. In C++ it would be an array of pairs. [string MD atom_name]:[string rosetta atom_name]

pdb_chain_alias(pairs)[source]

Replaces ALL occurances of old chain with new chain. pair is a dictionary. In C++ it would be an array of pairs. [string old chain]:[string new chain]

pdb_residue_alias(pairs)[source]

Replaces ALL occurances of old residue with new residue. pair is a dictionary. In C++ it would be an array of pairs. [string old residue_name]:[string new residue_name]

read_file_and_replace_b_factors(deliminator, filename='', resnum_column=1, chain_column=2, data_column=3, atomname_column=False)[source]

This function reads a deliminated file with data and inserts the data into the BFactor column. Used to visualize arbitrary data. Use function options to control which column the data is in as well as where your resnums and chains are located. If atomname column is given, will insert by atom instead of by residue

read_pdb_into_map()[source]

Reads PDB file path into a basic PDB map. All data is held as strings.

remove_alternate_residues()[source]

Removes any alternate residue codes and renumbers by renumbering from 1 and integrating any inserts.

remove_antigen()[source]

Remove Antigen from an LH only PDB

remove_chain(chain)[source]

Removes chain from pdb_map

remove_element_column()[source]

Removes the extra stuff in the element column, but not the element itself.

remove_hetatm_atoms()[source]
remove_residue_type(name3)[source]
remove_waters()[source]

Removes waters from pdb_map

replace_atom_b_factor(resnum, chain, atomname, data)[source]

Replaces the b factor of an atom. Can be all string representations or not.

replace_residue_b_factor(resnum, chain, data)[source]

Replaces the b factor of each atom in the residue with data. Can be all string representations or not.

save_PDB(filename=False, output_remarks=True, output_header=True)[source]

Uses a the pdb_map to save the data as a PDB file.

set_pdb_map(pdb_map)[source]

jade.basic.structure.BioPose module

class jade.basic.structure.BioPose.BioPose(path, model_num=0)[source]

Bases: object

This is my biopython meta class. Because biopython’s interface kinda sucks. This is a little cleaner.

The other way is to sublclass each Biopython class structure, which I’m not ready to do.

Right now, you need a path as I don’t know how we would use this from sequence, etc as you do in Rosetta. :path: Is a path to an RCSB file. PDB (.pdb), mmCIF(.cif), and gzipped (.gz) versions.

atom(atom_name, resnum, chain_id, icode=' ', alt=' ', model_num=0)[source]

Get a Bio Atom of the stored structure

Parameters:
  • atom_name – str
  • resnum – int
  • chain_id – str
  • icode – str
  • alt – str
  • model_num – int
Return type:

bio.PDB.Atom.Atom

atoms(resnum, chain_id, icode=' ', alt=' ', model_num=0)[source]

Get a list of Bio Atoms :param resnum: int :param chain_id: str :param icode: str :param alt: str :param model_num: int :rtype: list[bio.PDB.Atom.Atom]

chain(chain_id, model_num=0)[source]

Get a Bio Chain of the stored structure :param chain_id: str :param model_num: int :rtype: bio.PDB.Chain.Chain

chains(model_num=0)[source]

Get a list of Bio Chains :param model_num: int :rtype: list[bio.PDB.Chain.Chain

connected_to_next(resi, peptide_bond_distance_cutoff=1.8)[source]
connected_to_previous(resi, peptide_bond_distance_cutoff=1.8)[source]
get_chain_ids(model_num)[source]

Get all chain IDS for a model. :param model_num: int :rtype: list[str]

get_chain_length(chain_id, model_num=0)[source]

Get the number of AA in a chain - Not including alternate res locations :param chain_id: str :rtype: int

get_sequence(chain_id, model_num=0)[source]

Get a sequence of a chain - Not including alternate res locations

Parameters:
  • chain_id – str
  • model_num – int
Return type:

str

load_from_file(path)[source]

Load a file from PDB or mmCIF. .gz is supported.

Parameters:path – Path to PDB or mmCIF file
Return type:tuple(bio.PDB.Structure.Structure, dict)
model(model_num=0)[source]

Get a Bio Model of the stored structure :param id: int :rtype: bio.PDB.Model.Model

omega(i, rosetta_definitions=True)[source]

Get the Omega Angle of i in radians Omega is defined as the dihedral angle between the peptide bond of i and i + 1, as in Rosetta. If rosetta_definitions are False, omega is then treated as being between i and i -1

Parameters:
  • i – int
  • reverse_rosetta_definitions – bool
Return type:

float

pdbinfo()[source]
phi(i)[source]

Get the Phi Angle of i in radians

Parameters:i – int
Return type:float
psi(i)[source]

Get the Psi Angle of i in radians

Parameters:i – int
Return type:float
reload_from_file(path, model_num=0)[source]

Reload a BioPose from a file path. :param path: str :param model_num: int :return:

res_bond_distance(resi)[source]

Get the stored bond distances between residue and residue+1 :param res: int :rtype: float

residue(resnum, chain_id, icode=' ', alt=' ', model_num=0)[source]

Get a Bio Residue of the stored structure. Adds a chain_id attribute.

Parameters:
  • resnum – int
  • chain_id – str
  • icode – str
  • alt – str
  • model_num – int
Return type:

bio.PDB.Residue.Residue

residues(chain_id, model_num=0, include_alt=False)[source]

Get residues, including or not including residues with alternate location codes - which can be a PITA Adds chain_id attribute to residue.

Parameters:
  • chain_id – str
  • model_num – int
  • include_alt – bool
Return type:

list[bio.PDB.Residue.Residue]

resnum(pdb_num, chain, icode=' ')[source]
structure()[source]

Get the Bio Structure stored in this class. :rtype: bio.PDB.Structure.Structure

total_residue()[source]
jade.basic.structure.BioPose.test_dihedrals(pose)[source]

Simple Test for Dihedral output

Parameters:pose – BioPose
Return type:bool
jade.basic.structure.BioPose.test_pdbinfo(pose)[source]

Simple Test for pdbinfo output. :param pose: BioPose :rtype: bool

jade.basic.structure.SQLPose module

class jade.basic.structure.SQLPose.PDB_database(database)[source]

This class is specifically for if we already have a database. Note: This is not a ROSETTA database. If you need to convert this, use ROSETTA (Which now works in PyRosetta!) Functions are to output the database as a PDB, output specific pieces of protein as a pdb and query the database.

query_all(table='pdb')[source]
query_chain(table, chain)[source]
query_modelID(table, modelID)[source]
query_pdbID(table, pdbID)[source]
query_pdbID_and_chain(table, pdbID, chain)[source]
query_pdbID_and_strucID(table, pdbID, strucID)[source]
query_piece(table, start, end, chain)[source]
query_piece_pdbID(table, pdbID, start, end, chain)[source]
query_piece_pdbID_and_strucID(table, pdbID, start, end, chain, strucID)[source]
query_strucID(table, strucID)[source]
save_cur_as_pdb(outpath, supress_modelSep=False)[source]

Saves the DB at the current cursor to a file. Make sure cursor is on the pdb table.

save_whole_db_as_db(filename, seperate_structures=False)[source]

Saves the whole database in MEMORY to a file….

scrub(table_name)[source]

This should help protect from sql injection. Not that it’s important now, but… Author:OrangeOctopus from stack overflow

set_output_DIR(outDIR)[source]
set_output_occupancy_1(bool)[source]

Output structures with 1.0 as occupancy. Mainly for Rosetta use.

update_modelID_CDRS(table)[source]

Updates modelID to specify L1 through H3 and framework for possible future statistical analysis.

class jade.basic.structure.SQLPose.SQLPose(pdbID, modelID, structID, memory=False, path='')[source]
fetch_and_read_pdb_into_database(pdbID, read_header=False, header_only=False)[source]

Uses the PDB file specified, grabs it from the PDB, and reads the data in.

read_pdb_into_database_flat(filePath, specific_chain=False, read_header=False, header_only=False)[source]

Reads the flat filepath specified into a database structure. This can then be parsed using the PDB_Database class. NOTE: Reading of header not implemented. if header_only is True, only loads the header. Useful for just getting specific information. More useful to D/L it from the pdb if possible. If Header only, reads the header into the database.

set_basic_options(pdbID, modelID, structID)[source]
set_modelID(modelID)[source]
set_pdbID(pdbID)[source]
set_structID(structID)[source]

jade.basic.structure.Structure module

class jade.basic.structure.Structure.AntibodyResidueRecord(aa, pdb_res_num, chain, icode=' ')[source]

Bases: jade.basic.structure.Structure.ResidueRecord

Extension of Residue used to hold and access extra data used for renumbering/printing renumbering info I could backport python Enums, which would be incredibly useful here, but I don’t want to require the additional step.

  • used in Python3.4
get_cdr_type()[source]
get_chain_type()[source]

Gets the chaintype for the position - L or H

get_cluster()[source]
get_distance()[source]
get_gene()[source]
get_meta()[source]
get_old_chain()[source]
get_old_icode()[source]
get_old_resnum()[source]
get_region()[source]

Get the region type of the position - CDR/FRAMEWORK

is_cdr()[source]
is_framework()[source]
set_cdr_type(cdr_type)[source]
set_chain_type(chain_type)[source]
set_cluster(cluster)[source]
set_distance(distance)[source]
set_gene(gene)[source]
set_meta(meta)[source]
set_old_chain(old_chain)[source]
set_old_icode(old_icode)[source]
set_old_resnum(old_resnum, icode)[source]

Sets the old resnum and icode in the numbering map dictionary.

set_region(region)[source]
class jade.basic.structure.Structure.AntibodyStructure[source]

Simple class for accessing Modified_AHO antibody numbering information outside of Rosetta.

get_cdr(cdr_name)[source]

Get a CDR object of the given name :param cdr_name: str :rtype: CDR

get_cdr_names()[source]

Get a list of cdr names :rtype: [str]

get_cdr_seq(bio_pose, cdr_name)[source]

Get the CDR sequence from a bio pose :param bio_pose: basic.structure.BioPose :param cdr_name: str :rtype: str

get_cdrs()[source]

Get a dictionary of CDR objects, indexed by name :rtype: defaultdict[str] = CDR

get_framework_info(chain)[source]

Get the framework info class :param chain: str :rtype: FrameworkRegions

class jade.basic.structure.Structure.Atom(name)[source]
class jade.basic.structure.Structure.Bond(atom1, atom2)[source]
class jade.basic.structure.Structure.CDR(name)[source]
add_residue_record(name, num)[source]
get_pdb_chain()[source]
get_pdb_end()[source]
get_pdb_start()[source]
set_gene(gene)[source]
class jade.basic.structure.Structure.FrameworkRegions(chain)[source]
F1()[source]
F1_2()[source]
F2_3()[source]
F3()[source]
get_regions()[source]

Get the regions as an array of tupples

get_residue_record_region(region_name)[source]
get_residue_record_regions()[source]
get_start(region)[source]
get_start_stop(region)[source]
get_stop(region)[source]
class jade.basic.structure.Structure.PDBInfo[source]

Bases: object

Analogous to Rosetta PDBInfo Class I should start at 1

add_residue_record(residue_record)[source]
clear()[source]
delete_residue_record()[source]

Delete the residue_record and renumber starting from 1

get_all_residue_records()[source]

return all residue_records held as an array in order.

get_extra_data(key)[source]
get_residue_record(i)[source]

Get the residue record class for this particular index. :param i: :rtype: ResidueRecord

get_residue_record_of_pdb_num(pdb_num, chain_id, icode=' ')[source]
get_resnum(pdb_num, chain, icode=' ')[source]

Get the matching ‘resnum’ (i) or None if not found.

get_sequence()[source]
get_sequence_bt_residue_records(res1, res2, chain)[source]
get_sequence_bt_resnums(start, stop)[source]
pdb2pose(resnum, chain_id, icode=' ')[source]
pose2pdb(i)[source]
res(i)[source]
set_extra_data(key, value)[source]
set_icode(i, icode)[source]
set_pdb_num(i, pdb_num, icode=' ')[source]
set_residue_record(i, residue_record)[source]
total_residue()[source]
total_residue_record()[source]
total_residue_records()[source]
class jade.basic.structure.Structure.ResidueRecord(one_letter_aa, pdb_num, chain, icode=' ')[source]

Bases: object

Basic class to PDBInfo

get_aa()[source]
get_chain()[source]
get_extra_info(key)[source]
get_extra_info_dict()[source]
get_extra_info_keys()[source]
get_icode()[source]
get_pdb_num()[source]
has_extra_info(key)[source]
init_extra_infos(array_of_keys, value)[source]
set_aa(one_letter_aa)[source]
set_chain(chain)[source]
set_extra_info(key, value)[source]
set_icode(icode)[source]
set_pdb_num(pdb_num)[source]
tuple()[source]
class jade.basic.structure.Structure.ResidueRegion(res1, res2, name=None)[source]
get_name()[source]
get_res1()[source]
get_res2()[source]
class jade.basic.structure.Structure.electron[source]
class jade.basic.structure.Structure.molecule(name, atomsormolecule)[source]
class jade.basic.structure.Structure.nucleus[source]
class jade.basic.structure.Structure.protein[source]
class jade.basic.structure.Structure.protein_info(sequence)[source]

The protein has protein molecules. The PDB has a protein. Need to write this carefully.

attachDomains(domain1, domain2)[source]
breakIntoDomains()[source]
getInfo()[source]
getPartners()[source]
giveStructure(pose)[source]

jade.basic.structure.util module

jade.basic.structure.util.atomic_distance(res1, res2, res1_atom_name, res2_atom_name)[source]

Return the atomic distance between two arbitrary Bio residues and two arbitrary atom names. :param res1: Bio.PDB.Residue.Residue :param res2: Bio.PDB.Residue.Residue :param res1_atom_name: str :param res2_atom_name: str :rtype: float

jade.basic.structure.util.get_biopython_structure(path, model_id=None)[source]
jade.basic.structure.util.get_chain_length(bio_chain)[source]
jade.basic.structure.util.get_num_biochains(model)[source]
jade.basic.structure.util.get_seq_from_biochain(bio_chain)[source]
jade.basic.structure.util.get_seq_from_biostructure(structure, chain_id)[source]
jade.basic.structure.util.has_id(model, id)[source]

Returns true or false if the model has the chain. Because biopython is not updating it’s index that has_id is using. WTF.

jade.basic.structure.util.peptide_bond_distance(res1, res2)[source]

Return the bond distance between two residues using Numpy array math. :param res1: Bio.PDB.Residue.Residue :param res2: Bio.PDB.Residue.Residue :rtype: float