00001 //------------------------------------------------------------------------------ 00002 // This file is part of the OpenStructure project <www.openstructure.org> 00003 // 00004 // Copyright (C) 2008-2011 by the OpenStructure authors 00005 // 00006 // This library is free software; you can redistribute it and/or modify it under 00007 // the terms of the GNU Lesser General Public License as published by the Free 00008 // Software Foundation; either version 3.0 of the License, or (at your option) 00009 // any later version. 00010 // This library is distributed in the hope that it will be useful, but WITHOUT 00011 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00012 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00013 // details. 00014 // 00015 // You should have received a copy of the GNU Lesser General Public License 00016 // along with this library; if not, write to the Free Software Foundation, Inc., 00017 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00018 //------------------------------------------------------------------------------ 00019 #ifndef OST_SEQ_ALG_CONTACT_PREDICTION_SCORE_HH 00020 #define OST_SEQ_ALG_CONTACT_PREDICTION_SCORE_HH 00021 #include <ost/seq/alignment_handle.hh> 00022 #include <ost/seq/alg/module_config.hh> 00023 #include <ost/seq/alg/pair_subst_weight_matrix.hh> 00024 #include <ost/seq/alg/contact_weight_matrix.hh> 00025 00026 /* 00027 Authors: Niklaus Johner 00028 Functions and objects used to calculate different scores for predicting contacts 00029 from a multiple sequence alignment (MSA). Several scores are available: 00030 1. Mutual information. The average product correction (apc_correction) 00031 adds a correction term to account for common phylogenetic origin and inherent 00032 entropy of each column. There is also a correction for small number of sequences 00033 in the alignment and the possibility to use weighted mutual information. 00034 2. ContactScore. For each residue pair, this score calculates the average interaction 00035 energy for the amino-acid pairs in the corresponding columns of the MSA 00036 3. ContactSubstitutionScore. For each residue pair, this score calculates 00037 the average energy of the substitutions of amino-acid pairs in the corresponding 00038 columns of the MSA. 00039 */ 00040 namespace ost { namespace seq { namespace alg { 00041 00042 struct DLLEXPORT_OST_SEQ_ALG ContactPredictionScoreResult { 00043 std::vector <std::vector <Real> > matrix; 00044 std::vector <std::pair <int,int> > sorted_indices; 00045 void SetScore(int i, int j, Real score); 00046 Real GetScore(int i, int j); 00047 void RefreshSortedIndices(); 00048 ContactPredictionScoreResult(std::vector <std::vector <Real> >); 00049 }; 00050 00051 ContactPredictionScoreResult DLLEXPORT_OST_SEQ_ALG CalculateContactScore(const AlignmentHandle& aln, ContactWeightMatrix w=LoadDefaultContactWeightMatrix()); 00052 ContactPredictionScoreResult DLLEXPORT_OST_SEQ_ALG CalculateContactSubstitutionScore(const AlignmentHandle& aln, int ref_seq_index=0, PairSubstWeightMatrix w=LoadDefaultPairSubstWeightMatrix()); 00053 ContactPredictionScoreResult DLLEXPORT_OST_SEQ_ALG CalculateMutualInformation(const AlignmentHandle& aln, ContactWeightMatrix w=LoadConstantContactWeightMatrix(),bool apc_correction=true, 00054 bool zpx_transformation=true,float small_number_correction=0.05); 00055 00056 }}} 00057 #endif