| 1 |
|
| 2 |
|
| 3 |
#ifndef eslMSA_INCLUDED |
| 4 |
#define eslMSA_INCLUDED |
| 5 |
|
| 6 |
#include <esl_config.h> |
| 7 |
|
| 8 |
#include <stdio.h> |
| 9 |
|
| 10 |
#include "esl_alphabet.h" |
| 11 |
#include "esl_bitfield.h" |
| 12 |
#include "esl_keyhash.h" |
| 13 |
#include "esl_random.h" |
| 14 |
#include "esl_randomseq.h" |
| 15 |
#include "esl_ssi.h" |
| 16 |
|
| 17 |
#ifdef __cplusplus |
| 18 |
extern "C" { |
| 19 |
#endif |
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
#define eslMSA_TC1 0 |
| 25 |
#define eslMSA_TC2 1 |
| 26 |
#define eslMSA_GA1 2 |
| 27 |
#define eslMSA_GA2 3 |
| 28 |
#define eslMSA_NC1 4 |
| 29 |
#define eslMSA_NC2 5 |
| 30 |
#define eslMSA_NCUTS 6 |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
typedef struct { |
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
char **aseq; |
| 43 |
char **sqname; |
| 44 |
double *wgt; |
| 45 |
int64_t alen; |
| 46 |
int nseq; |
| 47 |
int flags; |
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
ESL_ALPHABET *abc; |
| 54 |
ESL_DSQ **ax; |
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
char *name; |
| 61 |
char *desc; |
| 62 |
char *acc; |
| 63 |
char *au; |
| 64 |
char *ss_cons; |
| 65 |
char *sa_cons; |
| 66 |
char *pp_cons; |
| 67 |
char *rf; |
| 68 |
char *mm; |
| 69 |
char **sqacc; |
| 70 |
char **sqdesc; |
| 71 |
char **ss; |
| 72 |
char **sa; |
| 73 |
char **pp; |
| 74 |
float cutoff[eslMSA_NCUTS]; |
| 75 |
int cutset[eslMSA_NCUTS]; |
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
int sqalloc; |
| 82 |
int64_t *sqlen; |
| 83 |
int64_t *sslen; |
| 84 |
int64_t *salen; |
| 85 |
int64_t *pplen; |
| 86 |
int lastidx; |
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
char **comment; |
| 96 |
int ncomment; |
| 97 |
int alloc_ncomment; |
| 98 |
|
| 99 |
char **gf_tag; |
| 100 |
char **gf; |
| 101 |
int ngf; |
| 102 |
int alloc_ngf; |
| 103 |
|
| 104 |
char **gs_tag; |
| 105 |
char ***gs; |
| 106 |
int ngs; |
| 107 |
|
| 108 |
char **gc_tag; |
| 109 |
char **gc; |
| 110 |
int ngc; |
| 111 |
|
| 112 |
char **gr_tag; |
| 113 |
char ***gr; |
| 114 |
int ngr; |
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
ESL_KEYHASH *index; |
| 119 |
ESL_KEYHASH *gs_idx; |
| 120 |
ESL_KEYHASH *gc_idx; |
| 121 |
ESL_KEYHASH *gr_idx; |
| 122 |
|
| 123 |
off_t offset; |
| 124 |
} ESL_MSA; |
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
#define eslMSA_HASWGTS (1 << 0) |
| 130 |
#define eslMSA_DIGITAL (1 << 1) |
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
|
| 136 |
extern ESL_MSA *esl_msa_Create(int nseq, int64_t alen); |
| 137 |
extern int esl_msa_Expand(ESL_MSA *msa); |
| 138 |
extern int esl_msa_Copy(const ESL_MSA *msa, ESL_MSA *new_msa); |
| 139 |
extern ESL_MSA *esl_msa_Clone(const ESL_MSA *msa); |
| 140 |
extern void esl_msa_Destroy(ESL_MSA *msa); |
| 141 |
|
| 142 |
|
| 143 |
extern int esl_msa_GuessAlphabet(const ESL_MSA *msa, int *ret_type); |
| 144 |
extern ESL_MSA *esl_msa_CreateDigital(const ESL_ALPHABET *abc, int nseq, int64_t alen); |
| 145 |
extern int esl_msa_Digitize(const ESL_ALPHABET *abc, ESL_MSA *msa, char *errmsg); |
| 146 |
extern int esl_msa_Textize(ESL_MSA *msa); |
| 147 |
extern int esl_msa_ConvertDegen2X(ESL_MSA *msa); |
| 148 |
|
| 149 |
|
| 150 |
extern int esl_msa_SetName (ESL_MSA *msa, const char *s, esl_pos_t n); |
| 151 |
extern int esl_msa_SetDesc (ESL_MSA *msa, const char *s, esl_pos_t n); |
| 152 |
extern int esl_msa_SetAccession (ESL_MSA *msa, const char *s, esl_pos_t n); |
| 153 |
extern int esl_msa_SetAuthor (ESL_MSA *msa, const char *s, esl_pos_t n); |
| 154 |
extern int esl_msa_SetSeqName (ESL_MSA *msa, int idx, const char *s, esl_pos_t n); |
| 155 |
extern int esl_msa_SetSeqAccession (ESL_MSA *msa, int idx, const char *s, esl_pos_t n); |
| 156 |
extern int esl_msa_SetSeqDescription(ESL_MSA *msa, int idx, const char *s, esl_pos_t n); |
| 157 |
extern int esl_msa_SetDefaultWeights(ESL_MSA *msa); |
| 158 |
|
| 159 |
extern int esl_msa_FormatName (ESL_MSA *msa, const char *name, ...); |
| 160 |
extern int esl_msa_FormatDesc (ESL_MSA *msa, const char *desc, ...); |
| 161 |
extern int esl_msa_FormatAccession (ESL_MSA *msa, const char *acc, ...); |
| 162 |
extern int esl_msa_FormatAuthor (ESL_MSA *msa, const char *author, ...); |
| 163 |
extern int esl_msa_FormatSeqName (ESL_MSA *msa, int idx, const char *name, ...); |
| 164 |
extern int esl_msa_FormatSeqAccession (ESL_MSA *msa, int idx, const char *acc, ...); |
| 165 |
extern int esl_msa_FormatSeqDescription(ESL_MSA *msa, int idx, const char *desc, ...); |
| 166 |
|
| 167 |
extern int esl_msa_AddComment(ESL_MSA *msa, char *p, esl_pos_t n); |
| 168 |
extern int esl_msa_AddGF (ESL_MSA *msa, char *tag, esl_pos_t taglen, char *value, esl_pos_t vlen); |
| 169 |
extern int esl_msa_AddGS (ESL_MSA *msa, char *tag, esl_pos_t taglen, int sqidx, char *value, esl_pos_t vlen); |
| 170 |
extern int esl_msa_AppendGC (ESL_MSA *msa, char *tag, char *value); |
| 171 |
extern int esl_msa_AppendGR (ESL_MSA *msa, char *tag, int sqidx, char *value); |
| 172 |
|
| 173 |
extern int esl_msa_CheckUniqueNames(const ESL_MSA *msa); |
| 174 |
|
| 175 |
|
| 176 |
extern int esl_msa_ReasonableRF(ESL_MSA *msa, double symfrac, int useconsseq, char *rfline); |
| 177 |
extern int esl_msa_MarkFragments (const ESL_MSA *msa, float fragthresh, ESL_BITFIELD **ret_fragassign); |
| 178 |
extern int esl_msa_MarkFragments_old(ESL_MSA *msa, double fragthresh); |
| 179 |
extern int esl_msa_SequenceSubset(const ESL_MSA *msa, const int *useme, ESL_MSA **ret_new); |
| 180 |
extern int esl_msa_ColumnSubset (ESL_MSA *msa, char *errbuf, const int *useme); |
| 181 |
extern int esl_msa_MinimGaps (ESL_MSA *msa, char *errbuf, const char *gaps, int consider_rf); |
| 182 |
extern int esl_msa_MinimGapsText(ESL_MSA *msa, char *errbuf, const char *gaps, int consider_rf, int fix_bps); |
| 183 |
extern int esl_msa_NoGaps (ESL_MSA *msa, char *errbuf, const char *gaps); |
| 184 |
extern int esl_msa_NoGapsText (ESL_MSA *msa, char *errbuf, const char *gaps, int fix_bps); |
| 185 |
extern int esl_msa_SymConvert(ESL_MSA *msa, const char *oldsyms, const char *newsyms); |
| 186 |
extern int esl_msa_Checksum(const ESL_MSA *msa, uint32_t *ret_checksum); |
| 187 |
|
| 188 |
extern int esl_msa_RemoveBrokenBasepairsFromSS(char *ss, char *errbuf, int len, const int *useme); |
| 189 |
extern int esl_msa_RemoveBrokenBasepairs(ESL_MSA *msa, char *errbuf, const int *useme); |
| 190 |
|
| 191 |
extern int esl_msa_ReverseComplement(ESL_MSA *msa); |
| 192 |
extern int esl_msa_Hash(ESL_MSA *msa); |
| 193 |
extern int esl_msa_FlushLeftInserts(ESL_MSA *msa); |
| 194 |
|
| 195 |
|
| 196 |
extern int esl_msa_Validate(const ESL_MSA *msa, char *errmsg); |
| 197 |
extern ESL_MSA *esl_msa_CreateFromString(const char *s, int fmt); |
| 198 |
extern int esl_msa_Compare (ESL_MSA *a1, ESL_MSA *a2); |
| 199 |
extern int esl_msa_CompareMandatory(ESL_MSA *a1, ESL_MSA *a2); |
| 200 |
extern int esl_msa_CompareOptional (ESL_MSA *a1, ESL_MSA *a2); |
| 201 |
extern int esl_msa_Sample(ESL_RANDOMNESS *rng, const ESL_ALPHABET *abc, int max_nseq, int max_alen, ESL_MSA **ret_msa); |
| 202 |
|
| 203 |
#ifdef __cplusplus |
| 204 |
} |
| 205 |
#endif |
| 206 |
#endif |
| 207 |
|