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

Go to the source code of this file.

Classes

struct  formatTable
 

Macros

#define __NO_CTYPE
 
#define kFormCount   30
 
#define kMaxFormName   15
 
#define kDupmatch   -2
 
#define kMaxwhichlist   50
 
#define kOptOkay   1
 
#define kOptNone   0
 
#define Exit(a)   exit(a)
 
#define exit_main(err)
 
#define indexout()
 

Functions

charformatstr (short format)
 
int rs_isdigit (int c)
 
int parseformat (char *name2)
 
static void dumpSeqList (char *list, short format)
 
void usage ()
 
void erralert (short err)
 
int chooseFormat (boolean quietly)
 
boolean checkopt (boolean casesense, char *sopt, const char *smatch, short minword)
 
void resetGlobals ()
 
int readopt (char *sopt)
 
 main (int argc, char *argv[])
 

Variables

const chartitle = "readSeq (1Feb93), multi-format molbio sequence reader.\n"
 
static char inputfilestore [256]
 
static charinputfile = inputfilestore
 
const charformats [kMaxFormat+1]
 
const struct formatTable formname []
 
const charkASN1headline = "Bioseq-set ::= {\nseq-set {\n"
 
const char compl [] = " !\"#$%&'()*+,-./0123456789:;<=>?@TVGHNNCDNNMNKNNYRYSAABWNRN[\\]^_`tvghnncdnnmnknnyrysaabwnrn{|}~"
 
boolean chooseall = false
 
boolean quietly = false
 
boolean gotinputfile = false
 
boolean listonly = false
 
boolean closeout = false
 
boolean verbose = false
 
boolean manyout = false
 
boolean dolower = false
 
boolean doupper = false
 
boolean doreverse = false
 
boolean askout = true
 
boolean dopipe = false
 
boolean interleaved = false
 
short nfile = 0
 
short iwhichlist =0
 
short nwhichlist = 0
 
short whichlist [kMaxwhichlist+1]
 
long whichSeq = 0
 
long outform = kNoformat
 
char onamestore [128]
 
charoname = onamestore
 
FILE * foo = NULL
 

Macro Definition Documentation

#define __NO_CTYPE

Definition at line 173 of file readseq.c.

#define kFormCount   30

Definition at line 205 of file readseq.c.

Referenced by parseformat().

#define kMaxFormName   15

Definition at line 206 of file readseq.c.

Referenced by parseformat().

#define kDupmatch   -2

Referenced by parseformat().

#define kMaxwhichlist   50

Definition at line 453 of file readseq.c.

Referenced by readopt().

#define kOptOkay   1

Definition at line 483 of file readseq.c.

Referenced by readopt().

#define kOptNone   0

Definition at line 484 of file readseq.c.

Referenced by readopt().

#define Exit (   a)    exit(a)

Definition at line 712 of file readseq.c.

#define exit_main (   err)
Value:
{ \
if (closeout) fclose(fout); \
if (closein) fclose(fin); \
if (*tempname!=0) remove(tempname);\
Exit(err); }
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
#define Exit(a)
Definition: readseq.c:712
boolean closeout
Definition: readseq.c:457

Referenced by main().

#define indexout ( )
Value:
if (noutindex>=outindexmax) {\
outindexmax= noutindex + 20;\
outindex= (long*) realloc(outindex, sizeof(long)*outindexmax);\
if (outindex==NULL) { err= eMemFull; erralert(err); exit_main(err); }\
}\
outindex[noutindex++]= ftell(fout);\
}
#define eMemFull
Definition: ureadseq.h:29
void erralert(short err)
Definition: readseq.c:379
boolean interleaved
Definition: readseq.c:459
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
#define exit_main(err)

Referenced by main().

Function Documentation

char* formatstr ( short  format)

Definition at line 252 of file readseq.c.

References kASN1, kASNseqentry, kASNseqset, kMaxFormat, kPhylip, kPhylipInterleave, and kPhylipSequential.

Referenced by dumpSeqList(), and main().

int rs_isdigit ( int  c)

Definition at line 266 of file readseq.c.

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

int parseformat ( char name2)
static void dumpSeqList ( char list,
short  format 
)
static

Definition at line 308 of file readseq.c.

References formatstr(), NEWLINE, and s.

Referenced by main().

void usage ( )

Definition at line 328 of file readseq.c.

References kMaxFormat, kMinFormat, and title.

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

void erralert ( short  err)

Definition at line 379 of file readseq.c.

References eASNerr, eFileCreate, eFileNotFound, eItemNotFound, eMemFull, eNoData, eOneFormat, eUnequalSize, and eUnknownFormat.

Referenced by main(), and readopt().

int chooseFormat ( boolean  quietly)

Definition at line 408 of file readseq.c.

References kMaxFormat, kMinFormat, kNoformat, kPearson, outform, and parseformat().

Referenced by main().

boolean checkopt ( boolean  casesense,
char sopt,
const char smatch,
short  minword 
)

Definition at line 432 of file readseq.c.

References max, min, result, and Strncasecmp().

Referenced by readopt().

void resetGlobals ( )
int readopt ( char sopt)
main ( int  argc,
char argv[] 
)

Variable Documentation

const char* title = "readSeq (1Feb93), multi-format molbio sequence reader.\n"
char inputfilestore[256]
static

Definition at line 182 of file readseq.c.

Referenced by main().

char * inputfile = inputfilestore
static

Definition at line 182 of file readseq.c.

Referenced by main(), Helpfile::readHelp(), and Helpfile::writeXML().

const char* formats[kMaxFormat+1]
Initial value:
= {
" 1. IG/Stanford",
" 2. GenBank/GB",
" 3. NBRF",
" 4. EMBL",
" 5. GCG",
" 6. DNAStrider",
" 7. Fitch",
" 8. Pearson/Fasta",
" 9. Zuker (in-only)",
"10. Olsen (in-only)",
"11. Phylip3.2",
"12. Phylip",
"13. Plain/Raw",
"14. PIR/CODATA",
"15. MSF",
"16. ASN.1",
"17. PAUP/NEXUS",
"18. Pretty (out-only)",
"" }

Definition at line 184 of file readseq.c.

const struct formatTable formname[]
const char* kASN1headline = "Bioseq-set ::= {\nseq-set {\n"

Definition at line 244 of file readseq.c.

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

Definition at line 248 of file readseq.c.

boolean chooseall = false

Definition at line 456 of file readseq.c.

boolean quietly = false

Definition at line 456 of file readseq.c.

Referenced by main(), and resetGlobals().

boolean gotinputfile = false

Definition at line 456 of file readseq.c.

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

boolean listonly = false

Definition at line 457 of file readseq.c.

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

boolean closeout = false

Definition at line 457 of file readseq.c.

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

boolean verbose = false

Definition at line 457 of file readseq.c.

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

boolean manyout = false

Definition at line 458 of file readseq.c.

Referenced by main(), and resetGlobals().

boolean dolower = false

Definition at line 458 of file readseq.c.

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

boolean doupper = false

Definition at line 458 of file readseq.c.

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

boolean doreverse = false

Definition at line 458 of file readseq.c.

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

boolean askout = true

Definition at line 459 of file readseq.c.

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

boolean dopipe = false

Definition at line 459 of file readseq.c.

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

boolean interleaved = false

Definition at line 459 of file readseq.c.

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

short nfile = 0

Definition at line 460 of file readseq.c.

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

short iwhichlist =0

Definition at line 460 of file readseq.c.

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

short nwhichlist = 0

Definition at line 460 of file readseq.c.

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

short whichlist[kMaxwhichlist+1]

Definition at line 461 of file readseq.c.

Referenced by main(), and readopt().

long whichSeq = 0

Definition at line 462 of file readseq.c.

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

long outform = kNoformat

Definition at line 462 of file readseq.c.

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

char onamestore[128]

Definition at line 463 of file readseq.c.

Referenced by resetGlobals().

char * oname = onamestore
FILE* foo = NULL

Definition at line 464 of file readseq.c.

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