IMP logo
IMP Reference Guide  2.11.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 527 of file io/crosslink.py.

Public Member Functions

def __init__
 Constructor. More...
 
def append_database
 This function append one cross-link dataset to another. More...
 
def check_cross_link_consistency
 This function checks the consistency of the dataset with the amino acid sequence. 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 crosslinks with score greater than an input value. More...
 
def get_number_of_unique_crosslinked_sites
 Returns the number of non redundant crosslink 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 crosslinks 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 crosslink consistency. If not given consistency will not be checked
linkable_aaa tuple containing one-letter amino acids which are linkable by the crosslinker; 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 536 of file io/crosslink.py.

Member Function Documentation

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

This function append one cross-link dataset to another.

Unique ids will be renamed to avoid conflicts.

Definition at line 904 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 763 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 968 of file io/crosslink.py.

def IMP.pmi.io.crosslink.CrossLinkDataBase.create_set_from_file (   self,
  file_name,
  converter = None,
  FixedFormatParser = 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

Definition at line 609 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 1027 of file io/crosslink.py.

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

Get all crosslinks with score greater than an input value.

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

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

Returns the number of non redundant crosslink sites.

Definition at line 1225 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 944 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 1044 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 crosslinks have the same cross-link UniqueIDS, the cross-links will be appended under the same UniqueID slots with different SubIDs.

Definition at line 896 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 954 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 982 of file io/crosslink.py.

def IMP.pmi.io.crosslink.CrossLinkDataBase.set_value (   self,
  key,
  new_value,
  FilterOperator = 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
FilterOperatoroptional 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 924 of file io/crosslink.py.


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