IMP logo
IMP Reference Guide  2.19.0
The Integrative Modeling Platform
IMP.pmi.io.crosslink.CrossLinkDataBase Class Reference

this class handles a cross-link dataset and do filtering operations, adding cross-links, merge datasets... More...

Inherits _CrossLinkDataBaseStandardKeys.

Detailed Description

this class handles a cross-link dataset and do filtering operations, adding cross-links, merge datasets...

Note
This class is only available in Python.

Definition at line 531 of file io/crosslink.py.

Public Member Functions

def __init__
 Constructor. More...
 
def align_sequence
 This function parses an alignment file obtained previously, to map crosslink residues onto the sequence of a homolog proteins. More...
 
def append_database
 Append cross-link dataset to this one. More...
 
def check_cross_link_consistency
 This function checks the consistency of the dataset with the amino acid sequence. More...
 
def classify_crosslinks_by_score
 This function creates as many classes as in the input (number_of_classes: integer) and partition cross-links according to their identification scores. More...
 
def create_new_keyword
 This function creates a new keyword for the whole database and set the values from and existing keyword (optional), otherwise the values are set to None. More...
 
def create_set_from_file
 if FixedFormatParser is not specified, the file is comma-separated-values More...
 
def filter_out_same_residues
 This function remove cross-links applied to the same residue (ie, same chain name and residue number) More...
 
def filter_score
 Get all cross-links with score greater than an input value. More...
 
def get_number_of_unique_crosslinked_sites
 Returns the number of non redundant cross-link sites. More...
 
def get_values
 this function returns the list of values for a given key in the database alphanumerically sorted More...
 
def jackknife
 this method returns a CrossLinkDataBase class containing a random subsample of the original cross-link database. More...
 
def merge
 This function merges two cross-link datasets so that if two conflicting cross-links have the same cross-link UniqueIDS, the cross-links will be appended under the same UniqueID slots with different SubIDs. More...
 
def offset_residue_index
 This function offset the residue indexes of a given protein by a specified value. More...
 
def rename_proteins
 This function renames all proteins contained in the input dictionary from the old names (keys) to the new name (values) More...
 
def set_value
 This function changes the value for a given key in the database For instance one can change the name of a protein. More...
 

Constructor & Destructor Documentation

def IMP.pmi.io.crosslink.CrossLinkDataBase.__init__ (   self,
  converter = None,
  data_base = None,
  fasta_seq = None,
  linkable_aa = ('K') 
)

Constructor.

Parameters
converteran instance of CrossLinkDataBaseKeywordsConverter
data_basean instance of CrossLinkDataBase to build the new database on
fasta_seqan instance of IMP.pmi.topology.Sequences containing protein fasta sequences to check cross-link consistency. If not given consistency will not be checked
linkable_aaa tuple containing one-letter amino acids which are linkable by the cross-linker; only used if the database DOES NOT provide a value for a certain residueX_amino_acid_key and if a fasta_seq is given

Definition at line 543 of file io/crosslink.py.

Member Function Documentation

def IMP.pmi.io.crosslink.CrossLinkDataBase.align_sequence (   self,
  alignfile 
)

This function parses an alignment file obtained previously, to map crosslink residues onto the sequence of a homolog proteins.

It is useful if you want to map the crosslinks onto a known, homolog structure without building a comparative model. The txt file of the alignment should be structured with repeating blocks, as follows:

>NAME_CROSSLINKED_PROTEIN >NAME_HOMOLOG_PROTEIN_WITH_KNOWN_STRUCTURE one-letter code sequence for cross-linked protein (one line) one-letter code sequence for homolog protein with known structure (one line)

Definition at line 1049 of file io/crosslink.py.

def IMP.pmi.io.crosslink.CrossLinkDataBase.append_database (   self,
  db 
)

Append cross-link dataset to this one.

Definition at line 953 of file io/crosslink.py.

def IMP.pmi.io.crosslink.CrossLinkDataBase.check_cross_link_consistency (   self)

This function checks the consistency of the dataset with the amino acid sequence.

Definition at line 795 of file io/crosslink.py.

def IMP.pmi.io.crosslink.CrossLinkDataBase.classify_crosslinks_by_score (   self,
  number_of_classes 
)

This function creates as many classes as in the input (number_of_classes: integer) and partition cross-links according to their identification scores.

Classes are defined in the psi key.

Definition at line 1170 of file io/crosslink.py.

def IMP.pmi.io.crosslink.CrossLinkDataBase.create_new_keyword (   self,
  keyword,
  values_from_keyword = None 
)

This function creates a new keyword for the whole database and set the values from and existing keyword (optional), otherwise the values are set to None.

Parameters
keywordthe new keyword name:
values_from_keywordthe keyword from which we are copying the values:

Definition at line 1013 of file io/crosslink.py.

def IMP.pmi.io.crosslink.CrossLinkDataBase.create_set_from_file (   self,
  file_name,
  converter = None,
  FixedFormatParser = None,
  encoding = None 
)

if FixedFormatParser is not specified, the file is comma-separated-values

Parameters
file_namea txt file to be parsed
converteran instance of CrossLinkDataBaseKeywordsConverter
FixedFormatParsera parser for a fixed format
encodingthe encoding of the file, if not the locale default (usually UTF-8)

Definition at line 616 of file io/crosslink.py.

def IMP.pmi.io.crosslink.CrossLinkDataBase.filter_out_same_residues (   self)

This function remove cross-links applied to the same residue (ie, same chain name and residue number)

Definition at line 1224 of file io/crosslink.py.

def IMP.pmi.io.crosslink.CrossLinkDataBase.filter_score (   self,
  score 
)

Get all cross-links with score greater than an input value.

Definition at line 938 of file io/crosslink.py.

def IMP.pmi.io.crosslink.CrossLinkDataBase.get_number_of_unique_crosslinked_sites (   self)

Returns the number of non redundant cross-link sites.

Definition at line 1414 of file io/crosslink.py.

def IMP.pmi.io.crosslink.CrossLinkDataBase.get_values (   self,
  key 
)

this function returns the list of values for a given key in the database alphanumerically sorted

Definition at line 988 of file io/crosslink.py.

def IMP.pmi.io.crosslink.CrossLinkDataBase.jackknife (   self,
  percentage 
)

this method returns a CrossLinkDataBase class containing a random subsample of the original cross-link database.

Parameters
percentagefloat between 0 and 1, is the percentage of of spectra taken from the original list

Definition at line 1240 of file io/crosslink.py.

def IMP.pmi.io.crosslink.CrossLinkDataBase.merge (   self,
  CrossLinkDataBase1,
  CrossLinkDataBase2 
)

This function merges two cross-link datasets so that if two conflicting cross-links have the same cross-link UniqueIDS, the cross-links will be appended under the same UniqueID slots with different SubIDs.

Definition at line 944 of file io/crosslink.py.

def IMP.pmi.io.crosslink.CrossLinkDataBase.offset_residue_index (   self,
  protein_name,
  offset 
)

This function offset the residue indexes of a given protein by a specified value.

Parameters
protein_namethe protein name that need to be changed
offsetthe offset value

Definition at line 998 of file io/crosslink.py.

def IMP.pmi.io.crosslink.CrossLinkDataBase.rename_proteins (   self,
  old_to_new_names_dictionary,
  protein_to_rename = 'both' 
)

This function renames all proteins contained in the input dictionary from the old names (keys) to the new name (values)

Parameters
old_to_new_names_dictionarydictionary for converting old to new names
protein_to_renamespecify whether to rename both or protein1 or protein2 only

Definition at line 1029 of file io/crosslink.py.

def IMP.pmi.io.crosslink.CrossLinkDataBase.set_value (   self,
  key,
  new_value,
  filter_operator = None 
)

This function changes the value for a given key in the database For instance one can change the name of a protein.

Parameters
keythe key in the database that must be changed
new_valuethe new value of the key
filter_operatoroptional FilterOperator to change the value to a subset of the database

example: `cldb1.set_value(cldb1.protein1_key, 'FFF', FO(cldb.protein1_key, operator.eq, "AAA"))`

Definition at line 967 of file io/crosslink.py.


The documentation for this class was generated from the following file: