2
* ===========================================================================
5
* National Center for Biotechnology Information (NCBI)
7
* This software/database is a "United States Government Work" under the
8
* terms of the United States Copyright Act. It was written as part of
9
* the author's official duties as a United States Government employee and
10
* thus cannot be copyrighted. This software/database is freely available
11
* to the public for use. The National Library of Medicine and the U.S.
12
* Government do not place any restriction on its use or reproduction.
13
* We would, however, appreciate having the NCBI and the author cited in
14
* any work or product based on this material
16
* Although all reasonable efforts have been taken to ensure the accuracy
17
* and reliability of the software and data, the NLM and the U.S.
18
* Government do not and cannot warrant the performance or results that
19
* may be obtained by using this software or data. The NLM and the U.S.
20
* Government disclaim all warranties, express or implied, including
21
* warranties of performance, merchantability or fitness for any particular
24
* ===========================================================================
26
* File Name: cspeedtest.c
28
* Author: Jonathan Kans
30
* Version Creation Date: 12/17/07
37
* --------------------------------------------------------------------------
38
* Date Name Description of modification
39
* ------- ---------- -----------------------------------------------------
42
* ==========================================================================
59
#define CSPEEDTEST_APP_VER "1.3"
61
CharPtr CSPEEDTEST_APPLICATION = CSPEEDTEST_APP_VER;
63
typedef struct cspeedflags {
86
} CSpeedFlagData, PNTR CSpeedFlagPtr;
88
static void DoVisitFeaturesTest (
94
/* empty visit callback */
97
static void DoGeneOverlapPrintTest (
104
SeqMgrFeatContext gcontext;
108
if (sfp == NULL) return;
109
cfp = (CSpeedFlagPtr) userdata;
110
if (cfp == NULL || cfp->ofp == NULL) return;
112
if (sfp->data.choice == SEQFEAT_GENE) return;
113
gene = SeqMgrGetOverlappingGene (sfp->location, &gcontext);
114
if (gene == NULL) return;
116
str1 = SeqLocPrint (sfp->location);
117
str2 = SeqLocPrint (gene->location);
118
if (str1 != NULL && str2 != NULL) {
119
fprintf (cfp->ofp, "[%s] -> [%s]\n", str1, str2);
121
fprintf (cfp->ofp, "? -> ?\n");
127
static void DoGeneOverlapSpeedTest (
134
SeqMgrFeatContext gcontext;
137
if (sfp == NULL) return;
138
cfp = (CSpeedFlagPtr) userdata;
139
if (cfp == NULL || cfp->ofp == NULL) return;
141
if (sfp->data.choice == SEQFEAT_GENE) return;
142
gene = SeqMgrGetOverlappingGene (sfp->location, &gcontext);
143
if (gene == NULL) return;
146
static void LIBCALLBACK EmptyStreamProc (
152
/* empty stream callback */
155
static void DoFastaSeq (
163
if (bsp == NULL) return;
164
cfp = (CSpeedFlagPtr) userdata;
165
if (cfp == NULL) return;
167
if (cfp->ofp != NULL) {
168
BioseqFastaStream (bsp, cfp->ofp, STREAM_EXPAND_GAPS, 70, 0, 0, TRUE);
170
SeqPortStream (bsp, STREAM_EXPAND_GAPS, NULL, EmptyStreamProc);
174
static void DoFastaRaw (
182
if (bsp == NULL) return;
183
cfp = (CSpeedFlagPtr) userdata;
184
if (cfp == NULL) return;
186
if (cfp->ofp != NULL) {
187
fprintf (cfp->ofp, ">\n");
188
BioseqFastaStream (bsp, cfp->ofp, STREAM_EXPAND_GAPS, 70, 0, 0, FALSE);
190
SeqPortStream (bsp, STREAM_EXPAND_GAPS, NULL, EmptyStreamProc);
194
static void DoFastaDefline (
204
if (bsp == NULL) return;
205
cfp = (CSpeedFlagPtr) userdata;
206
if (cfp == NULL) return;
209
SeqIdWrite (bsp->id, id, PRINTID_FASTA_LONG, sizeof (id) - 1);
211
CreateDefLine (NULL, bsp, buf, sizeof (buf) - 1, 0, NULL, NULL);
213
if (cfp->ofp != NULL) {
214
fprintf (cfp->ofp, ">%s %s\n", id, buf);
218
static void DoFastaFeat (
227
if (sfp == NULL) return;
228
cfp = (CSpeedFlagPtr) userdata;
229
if (cfp == NULL) return;
231
if (cfp->ofp != NULL) {
232
str = SeqLocPrint (sfp->location);
234
fprintf (cfp->ofp, "> [%s]\n", str);
237
SeqLocFastaStream (sfp->location, cfp->ofp, STREAM_EXPAND_GAPS, 70, 0, 0);
239
SeqPortStreamLoc (sfp->location, STREAM_EXPAND_GAPS, NULL, EmptyStreamProc);
243
static void DoFastaTrans (
253
if (sfp == NULL) return;
254
cfp = (CSpeedFlagPtr) userdata;
255
if (cfp == NULL) return;
257
if (sfp->data.choice != SEQFEAT_CDREGION) return;
258
bs = ProteinFromCdRegion (sfp, FALSE);
259
if (bs == NULL) return;
261
seq = (CharPtr) BSMerge (bs, NULL);
263
if (seq == NULL) return;
265
if (cfp->ofp != NULL) {
266
str = SeqLocPrint (sfp->location);
268
fprintf (cfp->ofp, "> (%s)\n", str);
271
fprintf (cfp->ofp, "%s\n", seq);
277
static CharPtr compatSeverityLabel [] = {
278
"NONE", "NOTE: valid", "WARNING: valid", "ERROR: valid", "REJECT: valid", "FATAL: valid", "MAX", NULL
281
static void LIBCALLBACK ValidCallback (
299
CharPtr catname, errname;
302
fp = (FILE *) userdata;
303
if (fp == NULL) return;
305
if (severity < SEV_NONE || severity > SEV_MAX) {
309
catname = GetValidCategoryName (errcode);
310
errname = GetValidErrorName (errcode, subcode);
312
if (catname == NULL) {
315
if (errname == NULL) {
319
if (accession == NULL) {
322
if (message == NULL) {
325
if (objtype == NULL) {
332
fprintf (fp, "%s [%s.%s] %s %s: %s",
333
compatSeverityLabel [severity],
334
catname, errname, message, objtype, label);
335
if (location != NULL) {
336
fprintf (fp, " %s", location);
338
if (context != NULL) {
339
fprintf (fp, " %s", context);
341
if (product != NULL) {
342
fprintf (fp, " -> %s", product);
347
static void DoProcess (
357
if (sep == NULL || cfp == NULL) return;
359
if (StringChr (cfp->clean, 'b') != NULL) {
360
BasicSeqEntryCleanup (sep);
362
if (StringChr (cfp->clean, 's') != NULL) {
363
SeriousSeqEntryCleanup (sep, NULL, NULL);
366
if (StringChr (cfp->index, 'f') != NULL) {
367
SeqMgrIndexFeatures (entityID, 0);
370
if (StringChr (cfp->seq, 's') != NULL) {
371
VisitBioseqsInSep (sep, (Pointer) cfp, DoFastaSeq);
373
if (StringChr (cfp->seq, 'r') != NULL) {
374
VisitBioseqsInSep (sep, (Pointer) cfp, DoFastaRaw);
376
if (StringChr (cfp->seq, 'd') != NULL) {
377
VisitBioseqsInSep (sep, (Pointer) cfp, DoFastaDefline);
379
if (StringChr (cfp->seq, 'f') != NULL) {
380
VisitFeaturesInSep (sep, (Pointer) cfp, DoFastaFeat);
382
if (StringChr (cfp->seq, 't') != NULL) {
383
VisitFeaturesInSep (sep, (Pointer) cfp, DoFastaTrans);
386
if (StringChr (cfp->feat, 'v') != NULL) {
387
VisitFeaturesInSep (sep, NULL, DoVisitFeaturesTest);
389
if (StringChr (cfp->feat, 'g') != NULL) {
390
if (SeqMgrFeaturesAreIndexed (entityID) == 0) {
391
SeqMgrIndexFeatures (entityID, 0);
393
VisitFeaturesInSep (sep, (Pointer) cfp, DoGeneOverlapPrintTest);
395
if (StringChr (cfp->feat, 'h') != NULL) {
396
if (SeqMgrFeaturesAreIndexed (entityID) == 0) {
397
SeqMgrIndexFeatures (entityID, 0);
399
VisitFeaturesInSep (sep, (Pointer) cfp, DoGeneOverlapSpeedTest);
401
if (StringChr (cfp->feat, 'x') != NULL) {
403
if (StringChr (cfp->feat, 'o') != NULL) {
405
if (StringChr (cfp->feat, 'd') != NULL) {
407
if (StringChr (cfp->feat, 't') != NULL) {
408
SeqEntryToGnbk (sep, NULL, FTABLE_FMT, SEQUIN_MODE, NORMAL_STYLE,
409
0, 0, SHOW_PROT_FTABLE, NULL, cfp->ofp);
412
if (StringChr (cfp->desc, 'b') != NULL) {
414
if (StringChr (cfp->desc, 't') != NULL) {
417
if (StringChr (cfp->verify, 'v') != NULL) {
418
if (SeqMgrFeaturesAreIndexed (entityID) == 0) {
419
SeqMgrIndexFeatures (entityID, 0);
421
vsp = ValidStructNew ();
423
vsp->useSeqMgrIndexes = TRUE;
424
vsp->suppressContext = TRUE;
425
vsp->seqSubmitParent = TRUE;
426
vsp->testLatLonSubregion = TRUE;
427
oldErrSev = ErrSetMessageLevel (SEV_NONE);
428
vsp->errfunc = ValidCallback;
429
vsp->userdata = (Pointer) cfp->ofp;
430
/* vsp->convertGiToAccn = FALSE; */
431
ValidateSeqEntry (sep, vsp);
432
ValidStructFree (vsp);
433
ErrSetMessageLevel (oldErrSev);
436
if (StringChr (cfp->verify, 'b') != NULL) {
437
if (SeqMgrFeaturesAreIndexed (entityID) == 0) {
438
SeqMgrIndexFeatures (entityID, 0);
440
SeqEntryToGnbk (sep, NULL, GENBANK_FMT, SEQUIN_MODE, NORMAL_STYLE,
441
0, 0, 0, NULL, cfp->ofp);
444
if (cfp->ofp != NULL) {
449
static void ProcessSingleRecord (
457
ValNodePtr bsplist = NULL;
459
Pointer dataptr = NULL;
460
Uint2 datatype, entityID = 0;
467
time_t starttime, stoptime, worsttime;
471
if (cfp == NULL) return;
473
if (StringHasNoText (filename)) return;
475
if (StringChr (cfp->io, 'r') != NULL) {
476
maxio = cfp->maxcount;
479
starttime = GetSecs ();
481
for (x = 0; x < maxio; x++) {
483
ObjMgrFreeByEntityID (entityID);
488
if (cfp->type == 1) {
490
fp = FileOpen (filename, "r");
492
Message (MSG_POSTERR, "Failed to open '%s'", filename);
496
dataptr = ReadAsnFastaOrFlatFile (fp, &datatype, NULL, FALSE, FALSE, FALSE, FALSE);
500
entityID = ObjMgrRegister (datatype, dataptr);
502
} else if (cfp->type >= 2 && cfp->type <= 5) {
504
aip = AsnIoOpen (filename, cfp->binary? "rb" : "r");
506
Message (MSG_POSTERR, "AsnIoOpen failed for input file '%s'", filename);
512
dataptr = (Pointer) SeqEntryAsnRead (aip, NULL);
513
datatype = OBJ_SEQENTRY;
516
dataptr = (Pointer) BioseqAsnRead (aip, NULL);
517
datatype = OBJ_BIOSEQ;
520
dataptr = (Pointer) BioseqSetAsnRead (aip, NULL);
521
datatype = OBJ_BIOSEQSET;
524
dataptr = (Pointer) SeqSubmitAsnRead (aip, NULL);
525
datatype = OBJ_SEQSUB;
533
entityID = ObjMgrRegister (datatype, dataptr);
535
} else if (cfp->type == 6) {
537
fp = FileOpen (filename, "r");
539
Message (MSG_POSTERR, "Failed to open '%s'", filename);
543
dataptr = ReadAsnFastaOrFlatFile (fp, &datatype, NULL, FALSE, FALSE, FALSE, FALSE);
547
entityID = ObjMgrRegister (datatype, dataptr);
549
} else if (cfp->type == 7) {
551
fp = FileOpen (filename, "r");
553
Message (MSG_POSTERR, "Failed to open '%s'", filename);
557
FileCacheSetup (&fc, fp);
559
str = FileCacheReadLine (&fc, line, sizeof (line), NULL);
560
while (str != NULL) {
561
str = FileCacheReadLine (&fc, line, sizeof (line), NULL);
569
Message (MSG_POSTERR, "Input format type '%d' unrecognized", (int) cfp->type);
574
if (entityID < 1 || dataptr == NULL) {
575
Message (MSG_POSTERR, "Data read failed for input file '%s'", filename);
579
if (datatype == OBJ_SEQSUB || datatype == OBJ_SEQENTRY ||
580
datatype == OBJ_BIOSEQ || datatype == OBJ_BIOSEQSET) {
582
stoptime = GetSecs ();
583
worsttime = stoptime - starttime;
584
if (cfp->logfp != NULL) {
585
fprintf (cfp->logfp, "ASN reading time %ld seconds\n", (long) worsttime);
589
sep = GetTopSeqEntryForEntityID (entityID);
592
sep = SeqEntryNew ();
594
if (datatype == OBJ_BIOSEQ) {
595
bsp = (BioseqPtr) dataptr;
597
sep->data.ptrvalue = bsp;
598
SeqMgrSeqEntry (SM_BIOSEQ, (Pointer) bsp, sep);
599
} else if (datatype == OBJ_BIOSEQSET) {
600
bssp = (BioseqSetPtr) dataptr;
602
sep->data.ptrvalue = bssp;
603
SeqMgrSeqEntry (SM_BIOSEQSET, (Pointer) bssp, sep);
605
sep = SeqEntryFree (sep);
608
sep = GetTopSeqEntryForEntityID (entityID);
614
starttime = GetSecs ();
616
bsplist = LockFarComponents (sep);
618
stoptime = GetSecs ();
619
worsttime = stoptime - starttime;
620
if (cfp->logfp != NULL) {
621
fprintf (cfp->logfp, "Far component locking time %ld seconds\n", (long) worsttime);
626
if (StringChr (cfp->io, 'w') != NULL) {
627
starttime = GetSecs ();
629
iotype = ASNIO_TEXT_OUT;
630
if (StringChr (cfp->io, 'b') != NULL) {
631
iotype = ASNIO_BIN_OUT;
634
for (x = 0; x < cfp->maxcount; x++) {
635
aip = AsnIoNew (iotype, cfp->ofp, NULL, NULL, NULL);
637
SeqEntryAsnWrite (sep, aip, NULL);
638
AsnIoFree (aip, FALSE);
642
stoptime = GetSecs ();
643
worsttime = stoptime - starttime;
644
if (cfp->logfp != NULL) {
645
fprintf (cfp->logfp, "ASN writing time %ld seconds\n", (long) worsttime);
650
starttime = GetSecs ();
652
for (x = 0; x < cfp->maxcount; x++) {
653
DoProcess (sep, entityID, cfp);
656
stoptime = GetSecs ();
657
worsttime = stoptime - starttime;
658
if (cfp->logfp != NULL) {
659
fprintf (cfp->logfp, "Internal processing time %ld seconds\n", (long) worsttime);
663
ObjMgrFreeByEntityID (entityID);
665
bsplist = UnlockFarComponents (bsplist);
670
Message (MSG_POSTERR, "Datatype %d not recognized", (int) datatype);
674
static void ProcessMultipleRecord (
690
time_t starttime, stoptime, worsttime;
695
Boolean usedPopen = FALSE;
698
if (cfp == NULL) return;
700
if (StringHasNoText (filename)) return;
703
if (cfp->compressed) {
704
Message (MSG_POSTERR, "Can only decompress on-the-fly on UNIX machines");
710
if (cfp->compressed) {
711
gzcatprog = getenv ("NCBI_UNCOMPRESS_BINARY");
712
if (gzcatprog != NULL) {
713
sprintf (cmmd, "%s %s", gzcatprog, filename);
715
ret = system ("gzcat -h >/dev/null 2>&1");
717
sprintf (cmmd, "gzcat %s", filename);
718
} else if (ret == -1) {
719
Message (MSG_POSTERR, "Unable to fork or exec gzcat in ScanBioseqSetRelease");
722
ret = system ("zcat -h >/dev/null 2>&1");
724
sprintf (cmmd, "zcat %s", filename);
725
} else if (ret == -1) {
726
Message (MSG_POSTERR, "Unable to fork or exec zcat in ScanBioseqSetRelease");
729
Message (MSG_POSTERR, "Unable to find zcat or gzcat in ScanBioseqSetRelease - please edit your PATH environment variable");
734
fp = popen (cmmd, /* cfp->binary? "rb" : */ "r");
737
fp = FileOpen (filename, cfp->binary? "rb" : "r");
740
fp = FileOpen (filename, cfp->binary? "rb" : "r");
743
Message (MSG_POSTERR, "FileOpen failed for input file '%s'", filename);
747
aip = AsnIoNew (cfp->binary? ASNIO_BIN_IN : ASNIO_TEXT_IN, fp, NULL, NULL, NULL);
749
Message (MSG_ERROR, "AsnIoNew failed for input file '%s'", filename);
753
if (cfp->logfp != NULL) {
754
fprintf (cfp->logfp, "%s\n\n", filename);
764
while ((atp = AsnReadId (aip, cfp->amp, atp)) != NULL) {
765
if (atp == cfp->atp_se) {
767
sep = SeqEntryAsnRead (aip, atp);
770
entityID = ObjMgrGetEntityIDForChoice (sep);
772
fsep = FindNthBioseq (sep, 1);
773
if (fsep != NULL && fsep->choice == 1) {
774
bsp = (BioseqPtr) fsep->data.ptrvalue;
776
SeqIdWrite (bsp->id, buf, PRINTID_FASTA_LONG, sizeof (buf));
777
if (cfp->logfp != NULL) {
778
fprintf (cfp->logfp, "%s\n", buf);
784
starttime = GetSecs ();
785
for (x = 0; x < cfp->maxcount; x++) {
786
DoProcess (sep, entityID, cfp);
788
stoptime = GetSecs ();
790
if (stoptime - starttime > worsttime) {
791
worsttime = stoptime - starttime;
792
StringCpy (longest, buf);
796
ObjMgrFreeByEntityID (entityID);
801
AsnReadVal (aip, atp, NULL);
805
AsnIoFree (aip, FALSE);
816
if (cfp->logfp != NULL && (! StringHasNoText (longest))) {
817
fprintf (cfp->logfp, "Longest processing time %ld seconds on %s\n",
818
(long) worsttime, longest);
819
fprintf (cfp->logfp, "Total number of records %ld\n", (long) numrecords);
824
static void ProcessOneRecord (
832
if (StringHasNoText (filename)) return;
833
cfp = (CSpeedFlagPtr) userdata;
834
if (cfp == NULL) return;
837
ProcessMultipleRecord (filename, cfp);
839
ProcessSingleRecord (filename, cfp);
843
/* Args structure contains command-line arguments */
845
#define p_argInputPath 0
846
#define i_argInputFile 1
847
#define o_argOutputFile 2
848
#define f_argFilter 3
849
#define x_argSuffix 4
851
#define b_argBinary 6
852
#define c_argCompressed 7
853
#define l_argLockFar 8
854
#define L_argLogFile 9
855
#define R_argRemote 10
856
#define X_argMaxCount 11
857
#define O_argInOut 12
858
#define K_argClean 13
859
#define I_argIndex 14
863
#define V_argVerify 18
866
{"Path to Files", NULL, NULL, NULL,
867
TRUE, 'p', ARG_STRING, 0.0, 0, NULL},
868
{"Single Input File", "stdin", NULL, NULL,
869
TRUE, 'i', ARG_FILE_IN, 0.0, 0, NULL},
870
{"Output File", "stdout", NULL, NULL,
871
TRUE, 'o', ARG_FILE_OUT, 0.0, 0, NULL},
872
{"Substring Filter", NULL, NULL, NULL,
873
TRUE, 'f', ARG_STRING, 0.0, 0, NULL},
874
{"File Selection Suffix", ".ent", NULL, NULL,
875
TRUE, 'x', ARG_STRING, 0.0, 0, NULL},
882
" t Batch Processing\n"
884
" l Read by Lines", "a", NULL, NULL,
885
TRUE, 'a', ARG_STRING, 0.0, 0, NULL},
886
{"Bioseq-set is Binary", "F", NULL, NULL,
887
TRUE, 'b', ARG_BOOLEAN, 0.0, 0, NULL},
888
{"Bioseq-set is Compressed", "F", NULL, NULL,
889
TRUE, 'c', ARG_BOOLEAN, 0.0, 0, NULL},
890
{"Lock Components in Advance", "F", NULL, NULL,
891
TRUE, 'l', ARG_BOOLEAN, 0.0, 0, NULL},
892
{"Log File", NULL, NULL, NULL,
893
TRUE, 'L', ARG_FILE_OUT, 0.0, 0, NULL},
894
{"Remote Fetching from ID", "F", NULL, NULL,
895
TRUE, 'R', ARG_BOOLEAN, 0.0, 0, NULL},
896
{"Max Repeat Count", "1", NULL, NULL,
897
TRUE, 'X', ARG_INT, 0.0, 0, NULL},
900
" w Write Text ASN.1\n"
901
" wb Write Binary ASN.1", NULL, NULL, NULL,
902
TRUE, 'O', ARG_STRING, 0.0, 0, NULL},
904
" b BasicSeqEntryCleanup\n"
905
" s SeriousSeqEntryCleanup", NULL, NULL, NULL,
906
TRUE, 'K', ARG_STRING, 0.0, 0, NULL},
908
" f Feature Indexing", NULL, NULL, NULL,
909
TRUE, 'I', ARG_STRING, 0.0, 0, NULL},
911
" s FASTA of Sequence\n"
912
" r Raw FASTA no Defline\n"
913
" d Just FASTA Defline\n"
914
" f FASTA by Feature\n"
915
" t FASTA of Translation", NULL, NULL, NULL,
916
TRUE, 'S', ARG_STRING, 0.0, 0, NULL},
918
" v Visit Features\n"
919
" g Gene Overlap Print\n"
920
" h Gene Overlap Speed\n"
922
" o Operon by Overlap\n"
924
" t Feature Table", NULL, NULL, NULL,
925
TRUE, 'F', ARG_STRING, 0.0, 0, NULL},
928
" t Title", NULL, NULL, NULL,
929
TRUE, 'D', ARG_STRING, 0.0, 0, NULL},
931
" v Validate with Normal Stringency\n"
932
" b Generate GenBank Flatfile\n", NULL, NULL, NULL,
933
TRUE, 'V', ARG_STRING, 0.0, 0, NULL},
941
CharPtr directory, filter, infile, logfile, outfile, str, suffix;
943
time_t runtime, starttime, stoptime;
947
ErrSetFatalLevel (SEV_MAX);
948
ErrClearOptFlags (EO_SHOW_USERSTR);
949
UseLocalAsnloadDataAndErrMsg ();
952
/* finish resolving internal connections in ASN.1 parse tables */
954
if (! AllObjLoad ()) {
955
Message (MSG_FATAL, "AllObjLoad failed");
958
if (! SubmitAsnLoad ()) {
959
Message (MSG_FATAL, "SubmitAsnLoad failed");
962
if (! FeatDefSetLoad ()) {
963
Message (MSG_FATAL, "FeatDefSetLoad failed");
966
if (! SeqCodeSetLoad ()) {
967
Message (MSG_FATAL, "SeqCodeSetLoad failed");
970
if (! GeneticCodeTableLoad ()) {
971
Message (MSG_FATAL, "GeneticCodeTableLoad failed");
975
/* process command line arguments */
977
sprintf (app, "cspeedtest %s", CSPEEDTEST_APPLICATION);
978
if (! GetArgs (app, sizeof (myargs) / sizeof (Args), myargs)) {
982
MemSet ((Pointer) &cfd, 0, sizeof (CSpeedFlagData));
984
directory = (CharPtr) myargs [p_argInputPath].strvalue;
985
infile = (CharPtr) myargs [i_argInputFile].strvalue;
986
outfile = (CharPtr) myargs [o_argOutputFile].strvalue;
987
filter = (CharPtr) myargs [f_argFilter].strvalue;
988
suffix = (CharPtr) myargs [x_argSuffix].strvalue;
991
cfd.binary = (Boolean) myargs [b_argBinary].intvalue;
992
cfd.compressed = (Boolean) myargs [c_argCompressed].intvalue;
993
cfd.lock = (Boolean) myargs [l_argLockFar].intvalue;
996
str = myargs [a_argType].strvalue;
997
TrimSpacesAroundString (str);
998
if (StringDoesHaveText (str)) {
1004
type = TO_LOWER (type);
1036
remote = (Boolean) myargs [R_argRemote].intvalue;
1038
cfd.maxcount = myargs [X_argMaxCount].intvalue;
1039
if (cfd.maxcount < 1) {
1043
cfd.io = myargs [O_argInOut].strvalue;
1044
cfd.clean = myargs [K_argClean].strvalue;
1045
cfd.index = myargs [I_argIndex].strvalue;
1046
cfd.seq = myargs [S_argSeq].strvalue;
1047
cfd.feat = myargs [F_argFeat].strvalue;
1048
cfd.desc = myargs [D_argDesc].strvalue;
1049
cfd.verify = myargs [V_argVerify].strvalue;
1051
cfd.amp = AsnAllModPtr ();
1052
cfd.atp_bss = AsnFind ("Bioseq-set");
1053
cfd.atp_bsss = AsnFind ("Bioseq-set.seq-set");
1054
cfd.atp_se = AsnFind ("Bioseq-set.seq-set.E");
1055
cfd.atp_bsc = AsnFind ("Bioseq-set.class");
1056
cfd.bssp_atp = AsnLinkType (NULL, cfd.atp_bss);
1058
logfile = (CharPtr) myargs [L_argLogFile].strvalue;
1059
if (StringDoesHaveText (logfile)) {
1060
cfd.logfp = FileOpen (logfile, "w");
1064
PubSeqFetchEnable ();
1067
if (StringDoesHaveText (outfile)) {
1068
cfd.ofp = FileOpen (outfile, "w");
1071
starttime = GetSecs ();
1073
if (StringDoesHaveText (directory)) {
1075
DirExplore (directory, NULL, suffix, FALSE, ProcessOneRecord, (Pointer) &cfd);
1077
} else if (StringDoesHaveText (infile)) {
1079
ProcessOneRecord (infile, (Pointer) &cfd);
1082
if (cfd.ofp != NULL) {
1083
FileClose (cfd.ofp);
1086
stoptime = GetSecs ();
1087
runtime = stoptime - starttime;
1088
if (cfd.logfp != NULL) {
1089
fprintf (cfd.logfp, "Finished in %ld seconds\n", (long) runtime);
1090
FileClose (cfd.logfp);
1094
PubSeqFetchDisable ();