ARB
Classes | Macros | Functions | Variables
ureadseq.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "ureadseq.h"
Include dependency graph for ureadseq.c:

Go to the source code of this file.

Classes

struct  ReadSeqVars
 

Macros

#define __NO_CTYPE
 
#define Local   static /* local functions */
 
#define kStartLength   500000 /* 20Apr93 temp. bug fix */
 
#define fixmatchchar(s)
 
#define tolowerstr(s)
 
#define ReadOneLine(sp)
 
#define kMaxseqwidth   250
 

Functions

int Strcasecmp (const char *a, const char *b)
 
int Strncasecmp (const char *a, const char *b, long maxn)
 
int isSeqChar (int c)
 
int isSeqNumChar (int c)
 
int isAnyChar (int c)
 
Local void readline (FILE *f, char *s, long *linestart)
 
Local void GetLine (struct ReadSeqVars *V)
 
Local void unGetLine (struct ReadSeqVars *V)
 
Local void addseq (char *s, struct ReadSeqVars *V)
 
Local void countseq (char *s, struct ReadSeqVars *V)
 
Local void addinfo (char *s, struct ReadSeqVars *V)
 
Local void readLoop (short margin, boolean addfirst, boolean(*endTest)(boolean *addend, boolean *ungetend, struct ReadSeqVars *V), struct ReadSeqVars *V)
 
Local boolean endIG (boolean *addend, boolean *ungetend, struct ReadSeqVars *V)
 
Local void readIG (struct ReadSeqVars *V)
 
Local boolean endStrider (boolean *addend, boolean *ungetend, struct ReadSeqVars *V)
 
Local void readStrider (struct ReadSeqVars *V)
 
Local boolean endPIR (boolean *addend, boolean *ungetend, struct ReadSeqVars *V)
 
Local void readPIR (struct ReadSeqVars *V)
 
Local boolean endGB (boolean *addend, boolean *ungetend, struct ReadSeqVars *V)
 
Local void readGenBank (struct ReadSeqVars *V)
 
Local boolean endNBRF (boolean *addend, boolean *ungetend, struct ReadSeqVars *V)
 
Local void readNBRF (struct ReadSeqVars *V)
 
Local boolean endPearson (boolean *addend, boolean *ungetend, struct ReadSeqVars *V)
 
Local void readPearson (struct ReadSeqVars *V)
 
Local boolean endEMBL (boolean *addend, boolean *ungetend, struct ReadSeqVars *V)
 
Local void readEMBL (struct ReadSeqVars *V)
 
Local boolean endZuker (boolean *addend, boolean *ungetend, struct ReadSeqVars *V)
 
Local void readZuker (struct ReadSeqVars *V)
 
Local boolean endFitch (boolean *addend, boolean *ungetend, struct ReadSeqVars *V)
 
Local void readFitch (struct ReadSeqVars *V)
 
Local void readPlain (struct ReadSeqVars *V)
 
Local void readUWGCG (struct ReadSeqVars *V)
 
Local void readOlsen (struct ReadSeqVars *V)
 
Local void readMSF (struct ReadSeqVars *V)
 
Local void readPAUPinterleaved (struct ReadSeqVars *V)
 
Local void readPAUPsequential (struct ReadSeqVars *V)
 
Local void readPhylipInterleaved (struct ReadSeqVars *V)
 
Local boolean endPhylipSequential (boolean *addend, boolean *ungetend, struct ReadSeqVars *V)
 
Local void readPhylipSequential (struct ReadSeqVars *V)
 
Local void readSeqMain (struct ReadSeqVars *V, const long skiplines_, const short format_)
 
charreadSeqFp (const short whichEntry_, FILE *fp_, const long skiplines_, const short format_, long *seqlen_, short *nseq_, short *error_, char *seqid_)
 
charreadSeq (const short whichEntry_, const char *filename_, const long skiplines_, const short format_, long *seqlen_, short *nseq_, short *error_, char *seqid_)
 
charlistSeqs (const char *filename_, const long skiplines_, const short format_, short *nseq_, short *error_)
 
short seqFileFormat (const char *filename, long *skiplines, short *error)
 
short seqFileFormatFp (FILE *fseq, long *skiplines, short *error)
 
unsigned long GCGchecksum (const char *seq, const long seqlen, unsigned long *checktotal)
 
unsigned long CRC32checksum (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)
 
short writeSeq (FILE *outf, const char *seq, const long seqlen, const short outform, const char *seqid)
 

Variables

prettyopts gPretty
 
const charaminos = "ABCDEFGHIKLMNPQRSTVWXYZ*"
 
const charprimenuc = "ACGTU"
 
const charprotonly = "EFIPQZ"
 
const char kNocountsymbols [5] = "_.-?"
 
const char stdsymbols [6] = "_.-*?"
 
const char allsymbols [32] = "_.-*?<>{}[]()!@#$%^&=+;:'/|`~\"\\"
 
static const charseqsymbols = allsymbols
 
const char nummask [11] = "0123456789"
 
const char nonummask [11] = "~!@#$%^&*("
 
const unsigned long crctab []
 

Macro Definition Documentation

#define __NO_CTYPE

Definition at line 27 of file ureadseq.c.

#define Local   static /* local functions */

Definition at line 72 of file ureadseq.c.

#define kStartLength   500000 /* 20Apr93 temp. bug fix */

Definition at line 75 of file ureadseq.c.

Referenced by addseq(), readSeq(), and readSeqFp().

#define fixmatchchar (   s)
Value:
{ \
for (ifmc=0; ifmc<saveseqlen; ifmc++) \
if (s[ifmc] == V->matchchar) s[ifmc]= saveseq[ifmc]; }
GB_write_int const char s
Definition: AW_awar.cxx:156

Referenced by readPAUPinterleaved().

#define tolowerstr (   s)
Value:
{ long Itlwr, Ntlwr= strlen(s); \
for (Itlwr=0; Itlwr<Ntlwr; Itlwr++) s[Itlwr]= to_lower(s[Itlwr]); }
#define to_lower(c)
Definition: ureadseq.h:22
GB_write_int const char s
Definition: AW_awar.cxx:156

Referenced by readSeqMain().

#define ReadOneLine (   sp)
Value:
{ done |= (feof(fseq)); \
readline( fseq, sp, &linestart); \
if (!done) { splen = strlen(sp); ++nlines; } }
Local void readline(FILE *f, char *s, long *linestart)
Definition: ureadseq.c:133
GB_write_int const char GB_write_autoconv_string WRITE_SKELETON(write_pointer, GBDATA *,"%p", GB_write_pointer) char *AW_awa if)(!gb_var) return strdup("")
Definition: AW_awar.cxx:166

Referenced by seqFileFormatFp().

#define kMaxseqwidth   250

Referenced by writeSeq().

Function Documentation

int Strcasecmp ( const char a,
const char b 
)

Definition at line 36 of file ureadseq.c.

References diff(), and to_upper.

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

Definition at line 50 of file ureadseq.c.

References diff(), and to_upper.

Referenced by checkopt().

int isSeqChar ( int  c)

Definition at line 117 of file ureadseq.c.

Referenced by addinfo(), readGenBank(), readSeq(), and readSeqFp().

int isSeqNumChar ( int  c)

Definition at line 122 of file ureadseq.c.

Referenced by readGenBank().

int isAnyChar ( int  c)

Definition at line 128 of file ureadseq.c.

Referenced by addinfo().

Local void readline ( FILE *  f,
char s,
long linestart 
)

Definition at line 133 of file ureadseq.c.

Referenced by GetLine().

Local void GetLine ( struct ReadSeqVars V)
Local void unGetLine ( struct ReadSeqVars V)

Definition at line 151 of file ureadseq.c.

References ReadSeqVars::f, and ReadSeqVars::linestart.

Referenced by readLoop().

Local void addseq ( char s,
struct ReadSeqVars V 
)
Local void countseq ( char s,
struct ReadSeqVars V 
)

Definition at line 183 of file ureadseq.c.

References ReadSeqVars::isseqchar, and ReadSeqVars::seqlencount.

Referenced by endPhylipSequential(), and readPAUPsequential().

Local void addinfo ( char s,
struct ReadSeqVars V 
)
Local void readLoop ( short  margin,
boolean  addfirst,
boolean(*)(boolean *addend, boolean *ungetend, struct ReadSeqVars *V)  endTest,
struct ReadSeqVars V 
)
Local boolean endIG ( boolean addend,
boolean ungetend,
struct ReadSeqVars V 
)

Definition at line 247 of file ureadseq.c.

References ReadSeqVars::s.

Referenced by readIG().

Local void readIG ( struct ReadSeqVars V)
Local boolean endStrider ( boolean addend,
boolean ungetend,
struct ReadSeqVars V 
)

Definition at line 276 of file ureadseq.c.

References ReadSeqVars::s.

Referenced by readStrider().

Local void readStrider ( struct ReadSeqVars V)
Local boolean endPIR ( boolean addend,
boolean ungetend,
struct ReadSeqVars V 
)

Definition at line 301 of file ureadseq.c.

References ReadSeqVars::s.

Referenced by readPIR().

Local void readPIR ( struct ReadSeqVars V)
Local boolean endGB ( boolean addend,
boolean ungetend,
struct ReadSeqVars V 
)

Definition at line 329 of file ureadseq.c.

References ReadSeqVars::s.

Referenced by readGenBank().

Local void readGenBank ( struct ReadSeqVars V)
Local boolean endNBRF ( boolean addend,
boolean ungetend,
struct ReadSeqVars V 
)

Definition at line 361 of file ureadseq.c.

References ReadSeqVars::s.

Referenced by readNBRF().

Local void readNBRF ( struct ReadSeqVars V)
Local boolean endPearson ( boolean addend,
boolean ungetend,
struct ReadSeqVars V 
)

Definition at line 397 of file ureadseq.c.

References ReadSeqVars::s.

Referenced by readPearson().

Local void readPearson ( struct ReadSeqVars V)
Local boolean endEMBL ( boolean addend,
boolean ungetend,
struct ReadSeqVars V 
)

Definition at line 419 of file ureadseq.c.

References ReadSeqVars::s.

Referenced by readEMBL().

Local void readEMBL ( struct ReadSeqVars V)
Local boolean endZuker ( boolean addend,
boolean ungetend,
struct ReadSeqVars V 
)

Definition at line 446 of file ureadseq.c.

References ReadSeqVars::s.

Referenced by readZuker().

Local void readZuker ( struct ReadSeqVars V)

1st string is Zuker's Fortran format

Definition at line 453 of file ureadseq.c.

References ReadSeqVars::allDone, endZuker(), ReadSeqVars::f, GetLine(), readLoop(), ReadSeqVars::s, and ReadSeqVars::seqid.

Referenced by readSeqMain().

Local boolean endFitch ( boolean addend,
boolean ungetend,
struct ReadSeqVars V 
)

Definition at line 472 of file ureadseq.c.

References ReadSeqVars::s.

Referenced by readFitch().

Local void readFitch ( struct ReadSeqVars V)
Local void readPlain ( struct ReadSeqVars V)
Local void readUWGCG ( struct ReadSeqVars V)
Local void readOlsen ( struct ReadSeqVars V)
Local void readMSF ( struct ReadSeqVars V)
Local void readPAUPinterleaved ( struct ReadSeqVars V)
Local void readPAUPsequential ( struct ReadSeqVars V)
Local void readPhylipInterleaved ( struct ReadSeqVars V)
Local boolean endPhylipSequential ( boolean addend,
boolean ungetend,
struct ReadSeqVars V 
)

Definition at line 906 of file ureadseq.c.

References countseq(), ReadSeqVars::s, ReadSeqVars::seqlencount, and ReadSeqVars::topseqlen.

Referenced by readPhylipSequential().

Local void readPhylipSequential ( struct ReadSeqVars V)
Local void readSeqMain ( struct ReadSeqVars V,
const long  skiplines_,
const short  format_ 
)
char* readSeqFp ( const short  whichEntry_,
FILE *  fp_,
const long  skiplines_,
const short  format_,
long seqlen_,
short nseq_,
short error_,
char seqid_ 
)
char* readSeq ( const short  whichEntry_,
const char filename_,
const long  skiplines_,
const short  format_,
long seqlen_,
short nseq_,
short error_,
char seqid_ 
)
char* listSeqs ( const char filename_,
const long  skiplines_,
const short  format_,
short nseq_,
short error_ 
)

Definition at line 1136 of file ureadseq.c.

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

Referenced by main().

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

Definition at line 1153 of file ureadseq.c.

References format(), and seqFileFormatFp().

Referenced by main().

short seqFileFormatFp ( FILE *  fseq,
long skiplines,
short error 
)
unsigned long GCGchecksum ( const char seq,
const long  seqlen,
unsigned long checktotal 
)

Definition at line 1422 of file ureadseq.c.

References ReadSeqVars::seqlen, and to_upper.

Referenced by main(), and writeSeq().

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

Definition at line 1494 of file ureadseq.c.

References ReadSeqVars::seqlen, and to_upper.

short getseqtype ( const char seq,
const long  seqlen 
)

Definition at line 1513 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 1547 of file ureadseq.c.

References seq.

Referenced by main().

short writeSeq ( FILE *  outf,
const char seq,
const long  seqlen,
const short  outform,
const char seqid 
)

Variable Documentation

prettyopts gPretty

Definition at line 31 of file ureadseq.c.

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

const char* aminos = "ABCDEFGHIKLMNPQRSTVWXYZ*"

Definition at line 77 of file ureadseq.c.

const char* primenuc = "ACGTU"

Definition at line 78 of file ureadseq.c.

const char* protonly = "EFIPQZ"

Definition at line 79 of file ureadseq.c.

const char kNocountsymbols[5] = "_.-?"

Definition at line 81 of file ureadseq.c.

const char stdsymbols[6] = "_.-*?"

Definition at line 82 of file ureadseq.c.

const char allsymbols[32] = "_.-*?<>{}[]()!@#$%^&=+;:'/|`~\"\\"

Definition at line 83 of file ureadseq.c.

const char* seqsymbols = allsymbols
static

Definition at line 84 of file ureadseq.c.

const char nummask[11] = "0123456789"

Definition at line 86 of file ureadseq.c.

const char nonummask[11] = "~!@#$%^&*("

Definition at line 87 of file ureadseq.c.

const unsigned long crctab[]

Definition at line 1439 of file ureadseq.c.