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
37 #define ePipeStdin -11
40 #define kListSequences -1
62 #define kPhylip3 kPhylip4
63 #define kPhylip kPhylip4
77 #define kASNseqentry 51
80 #define kPhylipInterleave 61
81 #define kPhylipSequential 62
86 boolean numright, numleft,
numtop, numbot;
92 short interline, spacer, seqwidth,
tab;
95 #define gPrettyInit(p) { \
98 p.numline= p.atseq= 0;\
99 p.numright= p.numleft= p.numtop= p.numbot= false;\
100 p.nameright= p.nameleft= p.nametop= false;\
101 p.noleaves= p.domatch= p.degap= false;\
119 extern short seqFileFormatFp(FILE *fseq,
long *skiplines,
short *error );
121 extern char *
listSeqs(
const char *filename,
const long skiplines,
122 const short format,
short *nseq,
short *error );
124 extern char *
readSeq(
const short whichEntry,
const char *filename,
125 const long skiplines,
const short format,
126 long *seqlen,
short *nseq,
short *error,
char *seqid );
128 extern char *
readSeqFp(
const short whichEntry_, FILE *fp_,
129 const long skiplines_,
const short format_,
130 long *seqlen_,
short *nseq_,
short *error_,
char *seqid_ );
132 extern short writeSeq(FILE *outf,
const char *
seq,
const long seqlen,
133 const short outform,
const char *seqid );
135 extern unsigned long CRC32checksum(
const char *seq,
const long seqlen,
unsigned long *checktotal);
136 extern unsigned long GCGchecksum(
const char *seq,
const long seqlen,
unsigned long *checktotal);
138 #define seqchecksum GCGchecksum
140 #define seqchecksum CRC32checksum
143 extern short getseqtype(
const char *seq,
const long seqlen );
144 extern char *
compressSeq(
const char gapc,
const char *seq,
const long seqlen,
long *newlen);
148 extern char *listASNSeqs(
const char *filename,
const long skiplines,
149 const short format,
short *nseq,
short *error );
151 extern char *readASNSeq(
const short whichEntry,
const char *filename,
152 const long skiplines,
const short format,
153 long *seqlen,
short *nseq,
short *error,
char **seqid );
158 extern int Strcasecmp(
const char *a,
const char *b);
159 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_)