1 /* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
3 /*********************************************************************
4 * Clustal Omega - Multiple sequence alignment
6 * Copyright (C) 2010 University College Dublin
8 * Clustal-Omega is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of the
11 * License, or (at your option) any later version.
13 * This file is part of Clustal-Omega.
15 ********************************************************************/
18 * RCS $Id: hhhalfalignment.h 143 2010-10-14 13:11:14Z andreas $
21 /////////////////////////////////////////////////////////////////////////////////////
22 // Class representing a2m/a3m-formatted alignment corresponding to one HMM
23 /////////////////////////////////////////////////////////////////////////////////////
29 HalfAlignment(int maxseqdis=MAXSEQDIS);
32 // Initialize HalfAlignment; create index arrays s [],l[], m[]
33 void Set(char* name, char** seq_in, char** sname_in, int n_in, int L_in, int n1, int n2, int n3, int n4, int nc, int L_in2/*<--FS*/);
35 // Free memory in HalfAlignment arrays s[][], l[][], and m[][]
38 // Align query (HalfAlignment) to template (i.e. hit) match state structure
39 void AlignToTemplate(Hit& hit);
41 // Write the a2m/a3m query alignment into alnfile
42 void Print(char* outfile);
44 // Fill in insert states following match state i
45 void AddInserts(int i);
47 // Fill up alignment with gaps '.' to generate flush end (all h[k] equal)
50 // Fill in insert states following match state i and fill up gaps with '.'
51 void AddInsertsAndFillUpGaps(int i);
53 // Add gap column '.' or character column
56 // Add match state column i as is
57 void AddColumn(int i);
59 // Add match state column i as insert state
60 void AddColumnAsInsert(int i);
62 // Build alignment in FASTA format
65 // Build alignment in A2M format
68 // Build alignment in A3M format
71 // Transform alignment sequences from A2M to FASTA ( lowercase to uppercase and '.' to '-')
74 // Remove all characters c from template sequences
75 void RemoveChars(char c);
78 friend class FullAlignment;
80 int n; //number of sequences in half-alignment
81 char** seq; //sequences (in ASCII) in alignment
82 char** sname; //names of sequences in alignment
83 int nss_dssp; //index of sequence with dssp sec structure states
84 int nsa_dssp; //index of sequence with dssp solvent accessiblity states
85 int nss_pred; //index of sequence with predicted sec structure states
86 int nss_conf; //index of sequence with prediction confidence values
87 int ncons; //index of consensus sequence
89 int pos; //After FillUpGaps() all h[k] have value pos
90 int L; //number of match states in corresponding profile
91 int* h; //h[k] = next position of sequence k to be written
92 char** s; //s[k][h] = column h, sequence k of output alignment
93 int** l; //counts non-gap residues: l[k][i] = index of last residue AT OR BEFORE match state i in seq k
94 int** m; //counts positions: m[k][i] = position of match state i in string seq[k]
95 /* int h[MAXSEQ]; //h[k] = next position of sequence k to be written */
96 /* char* s[MAXSEQ]; //s[k][h] = column h, sequence k of output alignment */
97 /* int* l[MAXSEQ]; //counts non-gap residues: l[k][i] = index of last residue AT OR BEFORE match state i in seq k */
98 /* int* m[MAXSEQ]; //counts positions: m[k][i] = position of match state i in string seq[k] */