15 #define min(a,b) (a<b)?a:b
16 #define max(a,b) (a>b)?a:b
17 #define skipwhitespace(string) {while (*string <= ' ' && *string != 0) string++;}
20 #define is_upper(c) ('A'<=(c) && (c)<='Z')
21 #define is_lower(c) ('a'<=(c) && (c)<='z')
22 #define to_lower(c) ((char)(is_upper(c) ? (c)+' ' : (c)))
23 #define to_upper(c) ((char)(is_lower(c) ? (c)-' ' : (c)))
27 #define eFileNotFound -1
30 #define eItemNotFound -4
32 #define eUnequalSize -6
33 #define eFileCreate -7
34 #define eUnknownFormat -8
39 #define kListSequences -1
61 #define kPhylip3 kPhylip4
62 #define kPhylip kPhylip4
76 #define kASNseqentry 51
79 #define kPhylipInterleave 61
80 #define kPhylipSequential 62
85 boolean numright, numleft,
numtop, numbot;
91 short interline, spacer, seqwidth,
tab;
94 #define gPrettyInit(p) { \
97 p.numline= p.atseq= 0;\
98 p.numright= p.numleft= p.numtop= p.numbot= false;\
99 p.nameright= p.nameleft= p.nametop= false;\
100 p.noleaves= p.domatch= p.degap= false;\
118 extern short seqFileFormatFp(FILE *fseq,
long *skiplines,
short *error );
120 extern char *
listSeqs(
const char *filename,
const long skiplines,
121 const short format,
short *nseq,
short *error );
123 extern char *
readSeq(
const short whichEntry,
const char *filename,
124 const long skiplines,
const short format,
125 long *seqlen,
short *nseq,
short *error,
char *seqid );
127 extern char *
readSeqFp(
const short whichEntry_, FILE *fp_,
128 const long skiplines_,
const short format_,
129 long *seqlen_,
short *nseq_,
short *error_,
char *seqid_ );
131 extern short writeSeq(FILE *outf,
const char *
seq,
const long seqlen,
132 const short outform,
const char *seqid );
134 extern unsigned long CRC32checksum(
const char *seq,
const long seqlen,
unsigned long *checktotal);
135 extern unsigned long GCGchecksum(
const char *seq,
const long seqlen,
unsigned long *checktotal);
137 #define seqchecksum GCGchecksum
139 #define seqchecksum CRC32checksum
142 extern short getseqtype(
const char *seq,
const long seqlen );
143 extern char *
compressSeq(
const char gapc,
const char *seq,
const long seqlen,
long *newlen);
147 extern char *listASNSeqs(
const char *filename,
const long skiplines,
148 const short format,
short *nseq,
short *error );
150 extern char *readASNSeq(
const short whichEntry,
const char *filename,
151 const long skiplines,
const short format,
152 long *seqlen,
short *nseq,
short *error,
char **seqid );
157 extern int Strcasecmp(
const char *a,
const char *b);
158 extern int Strncasecmp(
const char *a,
const char *b,
long maxn);
unsigned long GCGchecksum(const char *seq, const long seqlen, unsigned long *checktotal)
int Strcasecmp(const char *a, const char *b)
AliDataPtr format(AliDataPtr data, const size_t wanted_len, GB_ERROR &error)
short getseqtype(const char *seq, const long seqlen)
short seqFileFormat(const char *filename, long *skiplines, short *error)
short writeSeq(FILE *outf, const char *seq, const long seqlen, const short outform, const char *seqid)
short seqFileFormatFp(FILE *fseq, long *skiplines, short *error)
char * compressSeq(const char gapc, const char *seq, const long seqlen, long *newlen)
unsigned long CRC32checksum(const char *seq, const long seqlen, unsigned long *checktotal)
int Strncasecmp(const char *a, const char *b, long maxn)
static void error(const char *msg)
char * listSeqs(const char *filename, const long skiplines, const short format, short *nseq, short *error)
char * readSeq(const short whichEntry, const char *filename, const long skiplines, const short format, long *seqlen, short *nseq, short *error, char *seqid)
char * readSeqFp(const short whichEntry_, FILE *fp_, const long skiplines_, const short format_, long *seqlen_, short *nseq_, short *error_, char *seqid_)