14
static void ProcessAGI (
29
if (uid == 0 || fp == NULL) return;
31
sep = PubSeqSynchronousQuery (uid, 0, 0);
32
if (sep == NULL) return;
34
MemSet ((Pointer) &vn, 0, sizeof (ValNode));
36
vn.data.intvalue = uid;
38
bsp = BioseqFind (&vn);
40
sep = SeqEntryFree (sep);
44
AssignIDsInEntity (0, OBJ_SEQENTRY, (Pointer) sep);
46
sdp = GetNextDescriptorUnindexed (bsp, Seq_descr_molinfo, NULL);
48
mip = (MolInfoPtr) sdp->data.ptrvalue;
50
if (mip->tech == MI_TECH_htgs_1 || mip->tech == MI_TECH_htgs_2) {
51
BioseqToFasta (bsp, fp, ISA_na (bsp->mol));
52
sep = SeqEntryFree (sep);
60
sip = hist->replace_ids;
63
if (sip->choice == SEQID_GI) {
64
gi = sip->data.intvalue;
66
gi = GetGIForSeqId (sip);
69
sep = SeqEntryFree (sep);
79
/* Args structure contains command-line arguments */
81
#define a_argInputAccn 0
82
#define o_argOutputFile 1
85
{"Accession", NULL, NULL, NULL,
86
FALSE, 'a', ARG_STRING, 0.0, 0, NULL},
87
{"Output File Name", "stdout", NULL, NULL,
88
FALSE, 'o', ARG_FILE_OUT, 0.0, 0, NULL},
105
ErrSetFatalLevel (SEV_MAX);
106
ErrClearOptFlags (EO_SHOW_USERSTR);
107
UseLocalAsnloadDataAndErrMsg ();
110
if (! AllObjLoad ()) {
111
Message (MSG_FATAL, "AllObjLoad failed");
114
if (! SubmitAsnLoad ()) {
115
Message (MSG_FATAL, "SubmitAsnLoad failed");
118
if (! FeatDefSetLoad ()) {
119
Message (MSG_FATAL, "FeatDefSetLoad failed");
122
if (! SeqCodeSetLoad ()) {
123
Message (MSG_FATAL, "SeqCodeSetLoad failed");
126
if (! GeneticCodeTableLoad ()) {
127
Message (MSG_FATAL, "GeneticCodeTableLoad failed");
131
/* process command line arguments */
133
if (! GetArgs ("getunfin", sizeof (myargs) / sizeof (Args), myargs)) {
137
accn = myargs [a_argInputAccn].strvalue;
138
if (StringHasNoText (accn)) {
139
Message (MSG_FATAL, "Must have accession number");
143
fp = FileOpen (myargs [o_argOutputFile].strvalue, "w");
145
Message (MSG_FATAL, "FileOpen failed for output file");
149
PubSeqFetchEnable ();
156
if (! IS_DIGIT (ch)) {
164
sscanf (accn, "%ld", &val);
167
sip = SeqIdFromAccessionDotVersion (accn);
168
uid = GetGIForSeqId (sip);
172
ProcessAGI (uid, fp);
176
PubSeqFetchDisable ();