ARB
Classes | Macros | Typedefs | Functions | Variables
ureadseq.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  prettyopts
 

Macros

#define short   int
 
#define NEWLINE   '\n'
 
#define false   0
 
#define true   1
 
#define min(a, b)   (a<b)?a:b
 
#define max(a, b)   (a>b)?a:b
 
#define skipwhitespace(string)   {while (*string <= ' ' && *string != 0) string++;}
 
#define is_upper(c)   ('A'<=(c) && (c)<='Z')
 
#define is_lower(c)   ('a'<=(c) && (c)<='z')
 
#define to_lower(c)   ((char)(is_upper(c) ? (c)+' ' : (c)))
 
#define to_upper(c)   ((char)(is_lower(c) ? (c)-' ' : (c)))
 
#define eFileNotFound   -1
 
#define eNoData   -2
 
#define eMemFull   -3
 
#define eItemNotFound   -4
 
#define eOneFormat   -5
 
#define eUnequalSize   -6
 
#define eFileCreate   -7
 
#define eUnknownFormat   -8
 
#define eOptionBad   -9
 
#define eASNerr   -10
 
#define ePipeStdin   -11
 
#define kListSequences   -1
 
#define kOtherSeq   0
 
#define kDNA   1
 
#define kRNA   2
 
#define kNucleic   3
 
#define kAmino   4
 
#define kIG   1
 
#define kGenBank   2
 
#define kNBRF   3
 
#define kEMBL   4
 
#define kGCG   5
 
#define kStrider   6
 
#define kFitch   7
 
#define kPearson   8
 
#define kZuker   9
 
#define kOlsen   10
 
#define kPhylip2   11
 
#define kPhylip4   12
 
#define kPhylip3   kPhylip4
 
#define kPhylip   kPhylip4
 
#define kPlain   13 /* keep this at #13 */
 
#define kPIR   14
 
#define kMSF   15
 
#define kASN1   16
 
#define kPAUP   17
 
#define kPretty   18
 
#define kMaxFormat   18
 
#define kMinFormat   1
 
#define kNoformat   -1 /* format not tested */
 
#define kUnknown   0 /* format not determinable */
 
#define kASNseqentry   51
 
#define kASNseqset   52
 
#define kPhylipInterleave   61
 
#define kPhylipSequential   62
 
#define gPrettyInit(p)
 
#define seqchecksum   CRC32checksum
 

Typedefs

typedef char boolean
 

Functions

short seqFileFormat (const char *filename, long *skiplines, short *error)
 
short seqFileFormatFp (FILE *fseq, long *skiplines, short *error)
 
charlistSeqs (const char *filename, const long skiplines, const short format, short *nseq, short *error)
 
charreadSeq (const short whichEntry, const char *filename, const long skiplines, const short format, long *seqlen, short *nseq, short *error, char *seqid)
 
charreadSeqFp (const short whichEntry_, FILE *fp_, const long skiplines_, const short format_, long *seqlen_, short *nseq_, short *error_, char *seqid_)
 
short writeSeq (FILE *outf, const char *seq, const long seqlen, const short outform, const char *seqid)
 
unsigned long CRC32checksum (const char *seq, const long seqlen, unsigned long *checktotal)
 
unsigned long GCGchecksum (const char *seq, const long seqlen, unsigned long *checktotal)
 
short getseqtype (const char *seq, const long seqlen)
 
charcompressSeq (const char gapc, const char *seq, const long seqlen, long *newlen)
 
int Strcasecmp (const char *a, const char *b)
 
int Strncasecmp (const char *a, const char *b, long maxn)
 

Variables

prettyopts gPretty
 

Macro Definition Documentation

#define short   int
#define NEWLINE   '\n'

Definition at line 12 of file ureadseq.h.

Referenced by dumpSeqList().

#define false   0

Definition at line 13 of file ureadseq.h.

#define true   1

Definition at line 14 of file ureadseq.h.

#define min (   a,
 
)    (a<b)?a:b

Definition at line 15 of file ureadseq.h.

#define max (   a,
 
)    (a>b)?a:b

Definition at line 16 of file ureadseq.h.

#define skipwhitespace (   string)    {while (*string <= ' ' && *string != 0) string++;}
#define is_upper (   c)    ('A'<=(c) && (c)<='Z')

Definition at line 20 of file ureadseq.h.

#define is_lower (   c)    ('a'<=(c) && (c)<='z')

Definition at line 21 of file ureadseq.h.

#define to_lower (   c)    ((char)(is_upper(c) ? (c)+' ' : (c)))

Definition at line 22 of file ureadseq.h.

Referenced by main(), and parseformat().

#define to_upper (   c)    ((char)(is_lower(c) ? (c)-' ' : (c)))

Definition at line 23 of file ureadseq.h.

Referenced by CRC32checksum(), GCGchecksum(), getseqtype(), main(), Strcasecmp(), and Strncasecmp().

#define eFileNotFound   -1

Definition at line 27 of file ureadseq.h.

Referenced by erralert(), readSeqMain(), and seqFileFormatFp().

#define eNoData   -2

Definition at line 28 of file ureadseq.h.

Referenced by erralert(), and readSeqMain().

#define eMemFull   -3

Definition at line 29 of file ureadseq.h.

Referenced by addseq(), erralert(), and main().

#define eItemNotFound   -4

Definition at line 30 of file ureadseq.h.

Referenced by erralert(), and main().

#define eOneFormat   -5

Definition at line 31 of file ureadseq.h.

Referenced by erralert(), and main().

#define eUnequalSize   -6

Definition at line 32 of file ureadseq.h.

Referenced by erralert(), and main().

#define eFileCreate   -7

Definition at line 33 of file ureadseq.h.

Referenced by erralert(), main(), and readopt().

#define eUnknownFormat   -8

Definition at line 34 of file ureadseq.h.

Referenced by erralert(), readSeq(), readSeqFp(), and readSeqMain().

#define eOptionBad   -9

Definition at line 35 of file ureadseq.h.

Referenced by readopt().

#define eASNerr   -10

Definition at line 36 of file ureadseq.h.

Referenced by erralert().

#define ePipeStdin   -11

Definition at line 37 of file ureadseq.h.

Referenced by erralert(), and main().

#define kListSequences   -1
#define kOtherSeq   0

Definition at line 43 of file ureadseq.h.

Referenced by getseqtype(), main(), seqFileFormatFp(), and writeSeq().

#define kDNA   1

Definition at line 44 of file ureadseq.h.

Referenced by getseqtype(), main(), seqFileFormatFp(), and writeSeq().

#define kRNA   2

Definition at line 45 of file ureadseq.h.

Referenced by getseqtype(), main(), seqFileFormatFp(), and writeSeq().

#define kNucleic   3

Definition at line 46 of file ureadseq.h.

Referenced by getseqtype(), main(), seqFileFormatFp(), and writeSeq().

#define kAmino   4

Definition at line 47 of file ureadseq.h.

Referenced by getseqtype(), main(), seqFileFormatFp(), and writeSeq().

#define kIG   1

Definition at line 50 of file ureadseq.h.

Referenced by readSeqMain(), seqFileFormatFp(), and writeSeq().

#define kGenBank   2

Definition at line 51 of file ureadseq.h.

Referenced by readSeqMain(), seqFileFormatFp(), and writeSeq().

#define kNBRF   3

Definition at line 52 of file ureadseq.h.

Referenced by readSeqMain(), seqFileFormatFp(), and writeSeq().

#define kEMBL   4

Definition at line 53 of file ureadseq.h.

Referenced by readSeqMain(), seqFileFormatFp(), and writeSeq().

#define kGCG   5

Definition at line 54 of file ureadseq.h.

Referenced by main(), readSeqMain(), seqFileFormatFp(), and writeSeq().

#define kStrider   6

Definition at line 55 of file ureadseq.h.

Referenced by readSeqMain(), seqFileFormatFp(), and writeSeq().

#define kFitch   7

Definition at line 56 of file ureadseq.h.

Referenced by readSeqMain(), seqFileFormatFp(), and writeSeq().

#define kPearson   8

Definition at line 57 of file ureadseq.h.

Referenced by chooseFormat(), readSeqMain(), seqFileFormatFp(), and writeSeq().

#define kZuker   9

Definition at line 58 of file ureadseq.h.

Referenced by readSeqMain(), seqFileFormatFp(), and writeSeq().

#define kOlsen   10

Definition at line 59 of file ureadseq.h.

Referenced by readSeqMain(), seqFileFormatFp(), and writeSeq().

#define kPhylip2   11

Definition at line 60 of file ureadseq.h.

Referenced by main(), readSeqMain(), seqFileFormatFp(), and writeSeq().

#define kPhylip4   12

Definition at line 61 of file ureadseq.h.

Referenced by main(), readSeqMain(), seqFileFormatFp(), and writeSeq().

#define kPhylip3   kPhylip4

Definition at line 62 of file ureadseq.h.

#define kPhylip   kPhylip4

Definition at line 63 of file ureadseq.h.

Referenced by formatstr(), main(), and seqFileFormatFp().

#define kPlain   13 /* keep this at #13 */

Definition at line 64 of file ureadseq.h.

Referenced by main(), readSeqMain(), seqFileFormatFp(), and writeSeq().

#define kPIR   14

Definition at line 65 of file ureadseq.h.

Referenced by main(), readSeqMain(), seqFileFormatFp(), and writeSeq().

#define kMSF   15

Definition at line 66 of file ureadseq.h.

Referenced by main(), readSeqMain(), seqFileFormatFp(), and writeSeq().

#define kASN1   16

Definition at line 67 of file ureadseq.h.

Referenced by formatstr(), main(), seqFileFormatFp(), and writeSeq().

#define kPAUP   17

Definition at line 68 of file ureadseq.h.

Referenced by main(), readSeqMain(), seqFileFormatFp(), and writeSeq().

#define kPretty   18

Definition at line 69 of file ureadseq.h.

Referenced by main(), and writeSeq().

#define kMaxFormat   18

Definition at line 71 of file ureadseq.h.

Referenced by chooseFormat(), formatstr(), parseformat(), readSeq(), readSeqFp(), and usage().

#define kMinFormat   1

Definition at line 72 of file ureadseq.h.

Referenced by chooseFormat(), and usage().

#define kNoformat   -1 /* format not tested */

Definition at line 73 of file ureadseq.h.

Referenced by chooseFormat(), main(), parseformat(), resetGlobals(), and seqFileFormatFp().

#define kUnknown   0 /* format not determinable */

Definition at line 74 of file ureadseq.h.

Referenced by seqFileFormatFp(), and writeSeq().

#define kASNseqentry   51

Definition at line 77 of file ureadseq.h.

Referenced by formatstr(), main(), and seqFileFormatFp().

#define kASNseqset   52

Definition at line 78 of file ureadseq.h.

Referenced by formatstr(), main(), and seqFileFormatFp().

#define kPhylipInterleave   61

Definition at line 80 of file ureadseq.h.

Referenced by formatstr().

#define kPhylipSequential   62

Definition at line 81 of file ureadseq.h.

Referenced by formatstr().

#define gPrettyInit (   p)
Value:
{ \
p.isactive=false;\
p.baseonlynum=true;\
p.numline= p.atseq= 0;\
p.numright= p.numleft= p.numtop= p.numbot= false;\
p.nameright= p.nameleft= p.nametop= false;\
p.noleaves= p.domatch= p.degap= false;\
p.matchchar='.';\
p.gapchar='-';\
p.namewidth=10;\
p.numwidth=5;\
p.interline=1;\
p.spacer=10;\
p.seqwidth=50;\
p.tab=0; }

Definition at line 95 of file ureadseq.h.

Referenced by resetGlobals().

#define seqchecksum   CRC32checksum

Definition at line 140 of file ureadseq.h.

Referenced by main(), and writeSeq().

Typedef Documentation

typedef char boolean

Definition at line 11 of file ureadseq.h.

Function Documentation

short seqFileFormat ( const char filename,
long skiplines,
short error 
)

Definition at line 1151 of file ureadseq.c.

References format(), and seqFileFormatFp().

Referenced by main().

short seqFileFormatFp ( FILE *  fseq,
long skiplines,
short error 
)
char* listSeqs ( const char filename,
const long  skiplines,
const short  format,
short nseq,
short error 
)

Definition at line 1134 of file ureadseq.c.

References kListSequences, readSeq(), ReadSeqVars::seqid, and ReadSeqVars::seqlen.

Referenced by main().

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_ 
)
short writeSeq ( FILE *  outf,
const char seq,
const long  seqlen,
const short  outform,
const char seqid 
)
unsigned long CRC32checksum ( const char seq,
const long  seqlen,
unsigned long checktotal 
)

Definition at line 1492 of file ureadseq.c.

References ReadSeqVars::seqlen, and to_upper.

unsigned long GCGchecksum ( const char seq,
const long  seqlen,
unsigned long checktotal 
)

Definition at line 1420 of file ureadseq.c.

References ReadSeqVars::seqlen, and to_upper.

Referenced by main(), and writeSeq().

short getseqtype ( const char seq,
const long  seqlen 
)

Definition at line 1511 of file ureadseq.c.

References kAmino, kDNA, kNucleic, kOtherSeq, kRNA, min, and to_upper.

Referenced by main(), seqFileFormatFp(), and writeSeq().

char* compressSeq ( const char  gapc,
const char seq,
const long  seqlen,
long newlen 
)

Definition at line 1545 of file ureadseq.c.

References seq.

Referenced by main().

int Strcasecmp ( const char a,
const char b 
)

Definition at line 34 of file ureadseq.c.

References diff(), and to_upper.

int Strncasecmp ( const char a,
const char b,
long  maxn 
)

Definition at line 48 of file ureadseq.c.

References diff(), and to_upper.

Referenced by checkopt().

Variable Documentation

prettyopts gPretty

Definition at line 31 of file ureadseq.c.

Referenced by main(), readopt(), and resetGlobals().