/usr/include/ssm/ssm_malign.h is in libssm-dev 1.3-2.2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 | // $Id: ssm_malign.h,v 1.5 2006/06/14 15:13:06 keb Exp $
// =================================================================
//
// 10.04.13 <-- Date of Last Modification.
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ----------------------------------------------------------------
//
// **** Module : SSM_MAlign <interface>
// ~~~~~~~~~
// **** Project : SSM
// ~~~~~~~~~
// **** Classes : CSSMMultAlign
// ~~~~~~~~~
//
// E. Krissinel, 2003-2013
//
// =================================================================
//
#ifndef __SSM_MAlign__
#define __SSM_MAlign__
#include "mmdb/mmdb_manager.h"
#include "ssm_csia.h"
#include "ssm_superpose.h"
namespace ssm {
// --------------------------- SMAStruct ---------------------------
DefineStructure(MAStruct);
struct MAStruct {
SuperposeData SD; //!< data for pairwise superposition
PGraph G; //!< reduceable copy of SSE graph
rvector P; //!< SSE matching probabilities
rvector Q; //!< SSE matching scores
ivector F; //!< original vertex numbering
int sNo; //!< serial number of the structure
int nV; //!< number of vertices in G
int n; //!< number of non-zero SSE matchings
int nSAlloc; //!< memory allocation size
mat44 RT; //!< rotation-translation matrix
mat44 RT0; //!< best rotation-translation matrix
realtype Qsum; //!< sum of Q-scores with other structures
rvector x0; //!< original C-alpha X-coordinates
rvector y0; //!< original C-alpha Y-coordinates
rvector z0; //!< original C-alpha Z-coordinates
realtype xm,ym,zm; //!< center of mass
realtype cx,cy,cz; //!< consensus center of mass
int nalign; //!< number of aligned residues
realtype Rmsd0; //!< parameter of Q-score
void Init ( PCMMDBManager MMDB, PGraph graph,
int serNo, int nStruct );
void Set ( PCMMDBManager MMDB, PGraph graph,
int serNo, int nStruct );
void PrepareSSEMatching();
Boolean Refine ( int maxdel, realtype P0,
ivector v1, ivector v2 );
void Transform ();
void SaveCoordinates ();
void RestoreCoordinates();
void CalcCorrelationMatrix ( rmatrix & A, rvector xc,
rvector yc, rvector zc );
void CalcTranslation ();
void GetDirection ( int atompos, vect3 & v );
Boolean isMC ( int pos1, PMAStruct S, int pos2 );
void Dispose ();
};
// ---------------------------- MSSEOutput -------------------------
DefineStructure(MSSEOutput);
struct MSSEOutput {
ResName name1,name2;
ChainID chID;
int seqNum1,seqNum2;
int sseType,loopNo;
InsCode insCode1,insCode2;
Boolean aligned;
void Init ();
void SetSSERange ( PVertex V );
void Copy ( RMSSEOutput M );
void write ( RCFile f );
void read ( RCFile f );
};
// ---------------------------- SMAOutput -------------------------
DefineStructure(MAOutput);
struct MAOutput {
ResName name;
ChainID chID;
int seqNum;
int sseType;
InsCode insCode;
realtype rmsd; // not used
Boolean aligned;
void Init ();
void Fill ( PCAtom A, PGraph G, Boolean align );
void Copy ( RMAOutput M );
void write ( RCFile f );
void read ( RCFile f );
};
extern void FreeMSOutput ( PPMAOutput & MAOut, int & nrows );
extern void FreeMSOutput ( PPMSSEOutput & MSSEOut, int & nrows );
// --------------------------- CPAMatch ---------------------------
DefineClass(PAMatch);
class PAMatch {
public :
ivector F1,F2;
rvector Q;
realtype Qscore;
int mlen;
PAMatch();
~PAMatch();
void FreeMemory();
void Set ( ivector v1, ivector v2, int matchlen,
realtype matchQ, rvector SSEQ );
Boolean GetMatch ( ivector v1, ivector v2, int matchlen,
realtype & matchQ, rvector SSEQ );
};
// -------------------------- PAMatches --------------------------
DefineClass(PAMatches);
class PAMatches {
public :
PPPAMatch PA;
int nMatches;
int nBest;
PAMatches ();
~PAMatches();
int AddMatch ( ivector v1, ivector v2, int matchlen,
realtype matchQ, rvector SSEQ );
int GetMatch ( ivector v1, ivector v2, int matchlen,
realtype & matchQ, rvector SSEQ );
void SetBestMatch ( int mNo );
realtype GetBestQscore();
void GetBestMatch ( ivector & v1, ivector & v2, int & matchlen );
private :
int nAlloc;
};
// ---------------------------- MAMap ----------------------------
DefineStructure(MAMap);
struct MAMap {
realtype rmsd;
ivector map; // 0:i is mapped onto j:SMAMap[i].map[j]
void Init ( int nStruct );
void Dispose();
};
// --------------------------- MultAlign -------------------------
typedef void MAProgressFunc ( void * UserData, int stagekey,
int progress );
typedef MAProgressFunc * PMAProgressFunc;
DefineClass(MultAlign);
DefineStreamFunctions(MultAlign)
class MultAlign : public CStream {
public :
MultAlign ();
MultAlign ( RPCStream Object );
~MultAlign();
void setProgressFunction ( void * UserData,
PMAProgressFunc Fnc );
int align ( PPCMMDBManager MMDB, psvector selstring,
PPGraph Graph, int nStructures );
inline int getMaxNofIter() { return maxIter; }
void getAlignScores ( int & n_align, int & n_SSEs,
realtype & rmsd, realtype & Qscore );
void getConsensusScores ( rvector & cons_x,
rvector & cons_y,
rvector & cons_z,
int & cons_len,
rmatrix & m_rmsd,
rmatrix & m_Qscore,
rmatrix & m_seqId );
int getNres ( int structNo );
Boolean getAlignment ( int structNo, ivector & Ca, int & nres );
Boolean getTMatrix ( mat44 & TMatrix, int structNo );
void GetMAOutput ( PPMAOutput & MAOut,
int & nrows, int & ncols );
void GetMSSEOutput ( PPMSSEOutput & MSSEOut,
int & nrows, int & ncols );
void WriteMultAlign ( RCFile f );
void WriteSuperposed ( cpstr fileName );
void WriteMatchedSSEs ( RCFile f, Boolean shortTable=False );
void read ( RCFile f );
void write ( RCFile f );
protected :
PPMAStruct S; //!< molecular structure data
PPPAMatches * PM; //!< pairwise matches database
int nStruct; //!< number of structures
PMAProgressFunc ProgressFunc;
void * ProgFuncData;
rvector vq; //!< working array [1..maxNV]
ivector v1,v2; //!< working arrays [1..maxNV]
int maxNV; //!< maximal number of vertices
PRECISION precision; //!< SSE matching specificity
CONNECTIVITY connectivity; //!< SSE matching connectivity flag
realtype minCont; //!< minimal contact distance
realtype maxCont; //!< maximal contact distance
realtype Rmsd0; //!< parameter of Q-score
int minIter; //!< minimal number of iterations
int maxIter; //!< minimal number of iterations
int maxHollowIt; //!< maximal allowed number of consequtive
/// iterations without quality improvement
rmatrix A,Z,V; //!< corr-n matrix, left and right SVD vectors
rvector W; //!< singular values
PMAMap Map; //!< Map maps 0:i<->j:Map[i].map[j]
int Nalign; //!< number of multuply-aligned rows
int minNres,maxNres;
int nSSEalign; //!< number of multiply-aligned SSEs
realtype rmsd_achieved; //!< achieved RMSD
realtype Q_achieved; //!< achieved Q
rvector xc; //!< consensus X-coordinates
rvector yc; //!< consensus Y-coordinates
rvector zc; //!< consensus Z-coordinates
rmatrix mx_rmsd; //!< matrix of inter-structure rmsds
rmatrix mx_Qscore; //!< matrix of inter-structure Q-scores
rmatrix mx_seqId; //!< matrix of inter-structure seq identities
GraphMatch U;
Superpose superpose;
void InitMultAlign ();
void FreeMemory ();
void DeleteStructures ();
void DeselectCalphas ();
void SelectCalphas ();
void DeletePAMatches ();
void DeleteMap ();
void AllocateMap ();
void printStats ();
void AlignSSEs ();
void GetSSEMatchingStats();
void GetBestMatch ( PMAStruct S1, PMAStruct S2 );
Boolean RefineGraphs ();
int MakeFirstGuess ();
void CalcRMSD ( int mappos );
Boolean EvaluateMapping ( PCMContact C );
void CorrespondContacts ( realtype contDist );
void CalcConsensus ();
realtype MatchQuality2 ( int Nalgn, realtype dist2 );
realtype MatchQuality ( int Nalgn, int N1, int N2,
realtype dist2 );
int OptimizeAlignments ();
void SortStructures ();
void CalcConsensusScores();
int AlignCalphas ();
int CalcRotation ( mat44 & R );
protected :
int Map_nrows; // number of rows in Map;
int nStructAlloc; // allocated number of structures
};
}
#endif
|