01bc5899beef32c87ddfa1490377a41f97b0a655 markd Thu Mar 31 14:24:53 2011 -0700 allow for longer than 20 line descriptions in genbank entries diff --git src/hg/gbOneAcc/gbOneAcc.c src/hg/gbOneAcc/gbOneAcc.c index 03b771b..65409a9 100644 --- src/hg/gbOneAcc/gbOneAcc.c +++ src/hg/gbOneAcc/gbOneAcc.c @@ -1,110 +1,110 @@ /* This program retrieves one (or actually a few) records from a GenBank * file. */ #include "common.h" #include "linefile.h" static char const rcsid[] = "$Id: gbOneAcc.c,v 1.2 2003/05/06 07:22:17 kate Exp $"; void usage() /* Explain usage and exit. */ { errAbort( "gbOneAcc - retrieve one or a few records from a GenBank flat file.\n" "usage:\n" " gbOneAcc gbFile acc(s)\n" "The output will be printed to standard out"); } void unexpectedEof(struct lineFile *lf) /* Complain about unexpected EOF and die. */ { errAbort("Unexpected end of file line %d of %s", lf->lineIx, lf->fileName); } void extractAccFromGb( char *gbName, char **accNames, int accCount) /* Parse records of genBank file and print ones that match accession names. */ { struct lineFile *lf = lineFileOpen(gbName, TRUE); FILE *out = stdout; -enum {maxHeadLines=20, headLineSize=256 }; +enum {maxHeadLines=200, headLineSize=256 }; char *headLines[maxHeadLines]; /* Store stuff between locus and accession. */ char *line; int lineSize; int i; for (i=0; i= headLineSize) errAbort("Line too long (%d chars) line %d of %s", lineSize, lf->lineIx, lf->fileName); strcpy(headLines[i], line); if (!lineFileNext(lf, &line, &lineSize)) unexpectedEof(lf); if (startsWith("ACCESSION", line)) { gotAcc = TRUE; break; } } if (!gotAcc) { errAbort("LOCUS without ACCESSION in %d lines at line %d of %s", maxHeadLines, lf->lineIx, lf->fileName); } for (i=0; i