11
static char *this_file = "tfuns.c";
15
#define THIS_FILE this_file
16
static char *this_module ="toasn3";
20
#define THIS_MODULE this_module
22
Uint1 AAForCodon (Uint1Ptr codon, CharPtr codes); /* in seqport.c */
25
"chromosome", "map", "clone", "sub_clone", "haplotype", "genotype", "sex",
26
"cell_line", "cell_type", "tissue_type", "clone_lib", "dev_stage",
27
"frequency", "germline", "rearranged", "lab_host", "pop_variant",
28
"tissue_lib", "plasmid", "transposon", "insertion_seq", "plastid"};
30
static ORGMOD orgmod_subtype[10] = {
31
{ "strain", 2 }, {"sub_strain", 3}, {"variety", 6}, {"serotype",7}, {"cultivar",10}, {"isolate", 17}, {"specific_host", 21}, {"sub_species", 22}, {"note", 255}, { NULL, 0 }
34
CharPtr true_qual[3] = {"insertion_seq", "transposon", "clone"};
36
/*****************************************************************************
38
* -- Set the limit to heap ptr used in Greg's error function
39
* -- return truncated ptr (Greg's limit is 512)
40
******************************************************************************/
41
CharPtr FlatSafeSize(CharPtr ptr, Int4 limit)
49
retval = MemNew(limit+1);
50
StringNCpy(retval, ptr, limit);
56
/*****************************************************************************
57
* Implementation of various string processing functions
58
******************************************************************************/
59
/*============================================================================*\
61
* Strips all spaces in string in following manner. If the function
62
* meet several spaces (spaces and tabs) in succession it replaces them
65
\*----------------------------------------------------------------------------*/
66
CharPtr StrStripSpaces(CharPtr pchSrc, CharPtr pchDest)
69
Boolean bSpace = FALSE;
72
pchDest = MemNew(StrLen(pchSrc));
79
while (*pchSrc != '\0') {
80
if (*pchSrc == ' ' || *pchSrc == '\t') {
96
/*============================================================================*\
98
* Checks is string empty. Empty means that string has zero length or
99
* contains white spaces (see isspace()) only.
101
* TRUE if string is empty otherwise FALSE.
102
* If pointer to a string equals NULL the function returns TRUE.
103
\*----------------------------------------------------------------------------*/
104
Boolean IsStringEmpty(CharPtr str)
111
if (!isspace(*str)) {
121
/*============================================================================*\
123
* Makes new copy of a string with new length <= given.
126
* This function allocate memory for a new string by MemNew, so the caller
127
* have to call MemFree to free the memory.
128
\*----------------------------------------------------------------------------*/
129
CharPtr ShortenString(CharPtr str, Int4 iLen)
134
iNewLen = StringLen(str);
135
iNewLen = iNewLen < iLen ? iNewLen + 1 : iLen + 1;
136
pchNew = MemNew(iNewLen);
140
StringNCpy(pchNew, str, iNewLen - 1);
145
/*============================================================================*\
147
* Like StringStr, but search is limited by given length.
150
* If the substring is empty (has zero length) the function returns
151
* pchSource. If length of substring is > cMax, the function returns NULL.
153
\*----------------------------------------------------------------------------*/
154
CharPtr StringNStr(CharPtr pchSource, CharPtr pchTemplate, size_t cMax)
159
if (pchSource == NULL || pchTemplate == NULL || cMax == 0)
162
cTemplLen = StringLen(pchTemplate);
166
if (cTemplLen > cMax)
169
pchResult = StringStr(pchSource, pchTemplate);
170
if (pchResult == NULL)
173
if (pchResult + cTemplLen > pchSource + cMax)
179
Int2 StringExtCmp(CharPtr s1, CharPtr s2)
181
if (s1 == NULL || s2 == NULL)
183
return StringCmp(s1, s2);
186
CharPtr StripAllSpace(CharPtr str)
193
new = MemNew(strlen(str) + 1);
194
for (s = new; *str != '\0'; str++) {
195
if (!isspace(*str)) {
203
Int2 StringIgnoreSpaceCmp(CharPtr s1, CharPtr s2)
207
if (s1 == NULL || s2 == NULL) {
210
s1 = StripAllSpace(s1);
211
s2 = StripAllSpace(s2);
212
retval = StringICmp(s1, s2);
218
Int2 AStringIgnoreSpaceCmp(CharPtr s1, CharPtr s2)
223
if (s1 == NULL || s2 == NULL) {
226
for (; *s1 != '\0' && *s2 != '\0'; s1++, s2++) {
227
for (; isspace(*s1); s1++) ;
228
for (; isspace(*s2); s2++) ;
229
c1 = islower(*s1) ? toupper(*s1) : *s1;
230
c2 = islower(*s2) ? toupper(*s2) : *s2;
231
if ((retval = (c1 - c2)) != 0) {
238
/*----------------------------------------------------------------------------*/
240
WholeFeatPtr WholeFeatNew(void)
244
wfp = MemNew(sizeof(WholeFeat));
251
void WholeFeatFree(WholeFeatPtr wfp)
253
SeqFeatPtr fp, fpnext;
255
for (fp = wfp->sfp; fp; fp = fpnext) {
262
/****************************************************************************
265
* links input to list specified by head pointer 01-12-94
266
****************************************************************************/
267
SeqFeatPtr tie_feat(SeqFeatPtr head, SeqFeatPtr next)
274
for (v = head; v->next != NULL; v = v->next)
280
MolFixPtr tie_next_mol(MolFixPtr head, MolFixPtr next)
287
for (v = head; v->next != NULL; v = v->next) {
294
CodeBreakPtr tie_next_cbp(CodeBreakPtr head, CodeBreakPtr next)
301
for (v = head; v->next != NULL; v = v->next)
306
/****************************************************************************
307
* tie_next_biosource:
308
* -- ties next BioSource to the end of the chain
310
****************************************************************************/
311
OrgFixPtr tie_next_biosource(OrgFixPtr head, OrgFixPtr next)
318
for (v = head; v->next != NULL; v = v->next) {
325
/****************************************************************************
327
* -- ties next SubSource to the end of the chain
328
****************************************************************************/
329
SubSourcePtr tie_next_subtype(SubSourcePtr head, SubSourcePtr next)
333
static Char msg1[51], msg2[51];
343
if ((sn = next->name) == NULL) {
346
for (v = head; v != NULL; v = v->next) {
347
if ((sv = v->name) == NULL) {
350
if (v->subtype == next->subtype) {
351
if (AStringIgnoreSpaceCmp(sv, sn) == 0) {
356
StringNCpy(msg1, p, 50);
359
StringNCpy(msg2, q, 50);
361
if (v->subtype < 23) {
362
ErrPostEx(SEV_WARNING, ERR_SOURCE_QualDiffValues,
363
"/%s different values: %s|%s", type[v->subtype-1], msg1, msg2);
364
} else if (v->subtype == 255) {
365
ErrPostEx(SEV_WARNING, ERR_SOURCE_QualDiffValues,
366
"/note different values: %s|%s", msg1, msg2);
368
ErrPostEx(SEV_WARNING, ERR_SOURCE_IllegalQual,
373
if (v->next == NULL) {
381
/****************************************************************************
383
* -- ties next OrgMod to the end of the chain
385
****************************************************************************/
386
OrgModPtr tie_next_OrgMod(OrgModPtr head, OrgModPtr next)
391
static Char msg1[51], msg2[51];
398
if ((sn = next->subname) == NULL) {
401
for (v = head; v != NULL; v = v->next) {
402
if ((sv = v->subname) == NULL) {
405
if (v->subtype == next->subtype) {
406
if (AStringIgnoreSpaceCmp(v->subname, next->subname) == 0) {
410
for (i=0; i < 10; i++) {
411
if (v->subtype == orgmod_subtype[i].num)
415
ErrPostEx(SEV_INFO, ERR_SOURCE_QualUnknown,
416
"OrgMod.subtype [%d] can't be mapped to GenBank qualifier", v->subtype);
419
StringNCpy(msg1, p, 50);
422
StringNCpy(msg2, q, 50);
424
ErrPostEx(SEV_WARNING, ERR_SOURCE_QualDiffValues,
425
"/%s different values: %s|%s",
426
orgmod_subtype[i].name, msg1, msg2);
430
if (v->next == NULL) {
438
/*****************************************************************************
440
* SeqFeatPtr SeqFeatExtract(headptr, choice)
441
* removes first feature in chain where ->choice == choice
442
* rejoins chain after removing the node
443
* sets node->next to NULL
445
*****************************************************************************/
446
SeqFeatPtr SeqFeatExtract (SeqFeatPtr PNTR headptr, Nlm_Int2 choice)
448
SeqFeatPtr last = NULL,
453
if (vnp->data.choice == (Nlm_Uint1)choice)
455
if (last == NULL) /* first one */
456
* headptr = vnp->next;
458
last->next = vnp->next;
470
return NULL; /* not found */
473
/*****************************************************************************
475
* SeqFeatPtr SeqFeatExtractList(headptr, choice)
476
* removes ALL features in chain where ->choice == choice
477
* rejoins chain after removing the nodes
478
* returns independent chain of extracted nodes
480
*****************************************************************************/
481
SeqFeatPtr SeqFeatExtractList (SeqFeatPtr PNTR headptr, Nlm_Int2 choice)
483
SeqFeatPtr last = NULL, first = NULL, vnp;
485
while ((vnp = SeqFeatExtract(headptr, choice)) != NULL)
499
/*****************************************************************************
501
* SeqFeatPtr SourceFeatExtract(headptr)
502
* removes first feature in chain where ->choice == SEQFEAT_IMP
504
* rejoins chain after removing the node
505
* sets node->next to NULL
507
*****************************************************************************/
508
SeqFeatPtr SourceFeatExtract (SeqFeatPtr PNTR headptr)
510
SeqFeatPtr last = NULL,
516
if (vnp->data.choice == SEQFEAT_IMP) {
517
ifp = (ImpFeatPtr) vnp->data.value.ptrvalue;
518
if (StringCmp(ifp->key, "source") == 0) {
519
if (last == NULL) /* first one */
520
* headptr = vnp->next;
522
last->next = vnp->next;
536
return NULL; /* not found */
538
/*****************************************************************************
540
* SeqFeatPtr ExtractSourceFeatList(headptr, choice)
541
* removes ALL features in chain where ->choice == choice
543
* rejoins chain after removing the nodes
544
* returns independent chain of extracted nodes
546
*****************************************************************************/
547
SeqFeatPtr ExtractSourceFeatList (SeqFeatPtr PNTR headptr)
549
SeqFeatPtr last = NULL, first = NULL, vnp;
551
while ((vnp = SourceFeatExtract(headptr)) != NULL)
566
SeqIdPtr find_id(SeqEntryPtr sep)
573
bsp = (BioseqPtr)(sep->data.ptrvalue);
574
sip = (SeqIdPtr) SeqIdDup(bsp->id);
583
SubSourcePtr remove_subtype(SubSourcePtr head, SubSourcePtr x)
591
return SubSourceSetFree (head);
599
for (v = head; v != NULL && v != x; v = v->next) {
610
OrgModPtr remove_OrgMod(OrgModPtr head, OrgModPtr x)
618
return OrgModSetFree (head);
626
for (v = head; v != NULL && v != x; v = v->next) {
637
SeqFeatXrefPtr remove_xref(SeqFeatXrefPtr head, SeqFeatXrefPtr x)
650
for (v = head; v != NULL && v != x; v = v->next) {
661
GBQualPtr remove_qual(GBQualPtr head, GBQualPtr x)
674
for (v = head; v != NULL && v != x; v = v->next) {
685
Boolean check_whole(SeqFeatPtr f, Int4 len)
687
Boolean whole = FALSE;
692
if (slp->choice == SEQLOC_WHOLE) {
694
} else if (slp->choice == SEQLOC_INT) {
695
sip = slp->data.ptrvalue;
696
if (sip->from == 0 && sip->to == len-1) {
703
/* check for /transposon and /insertion_seq and /clone*/
705
Boolean true_multiple(SeqAnnotPtr sap, Int4 len)
707
SeqFeatPtr tmp_sfp, sfp, f;
708
Boolean first = TRUE;
713
tmp_sfp = (SeqFeatPtr) (sap->data);
714
sfp = ExtractSourceFeatList(&(tmp_sfp));
715
for (f = sfp; f != NULL; f = f->next) {
716
if (check_whole(f, len)) {
719
for(q = f->qual; q != NULL; q = q->next) {
721
for (i=0; i<3; i++) {
722
if (StringCmp(q->qual, true_qual[i]) == 0) {
731
if (StringCmp(q->qual, word) == 0) {
737
sfp = tie_feat(sfp, tmp_sfp);
738
if (sap != NULL && sap->type == 1) {
745
sfp = tie_feat(sfp, tmp_sfp);
746
if (sap != NULL && sap->type == 1) {
753
sfp = tie_feat(sfp, tmp_sfp);
754
if (sap != NULL && sap->type == 1) {
761
/***************************************************************************
763
* -- return qual's value if found the "qual" in the "qlist",
764
***************************************************************************/
765
CharPtr copy_qvalue(GBQualPtr qlist, CharPtr qual)
768
CharPtr qvalue = NULL;
770
for (curq = qlist; curq != NULL; curq = curq->next) {
771
if (StringCmp(curq->qual, qual) == 0) {
772
if (curq->val != NULL) {
773
if (StringCmp(curq->val, "\"\"") == 0) {
776
qvalue = StringSave(curq->val);
787
/**********************************************************/
788
CharPtr get_qvalue(GBQualPtr curq, CharPtr qual)
790
for(; curq != NULL; curq = curq->next)
791
if(StringCmp(curq->qual, qual) == 0 && curq->val != NULL)
794
if(curq == NULL || StringCmp(curq->val, "\"\"") == 0)
800
/*****************************************************************************
802
* -- strstr, last occurance
803
******************************************************************************/
804
CharPtr laststr(CharPtr str, CharPtr word)
809
while(( s = StringStr(s1+1, word)) !=NULL) {
818
void DelFeatFromList (SeqFeatPtr PNTR gbqp, SeqFeatPtr curq, SeqFeatPtr preq)
823
*gbqp = curq->next; /* will change first_q in calling function */
825
preq->next = curq->next; /* will cause next_q == preq -> next */
832
void DelNodeFromList (ValNodePtr PNTR gbqp, ValNodePtr curq, ValNodePtr preq)
837
*gbqp = curq->next; /* will change first_q in calling function */
839
preq->next = curq->next; /* will cause next_q == preq -> next */
846
/*****************************************************************************
848
******************************************************************************/
850
static void find_orf(SeqPortPtr spp, Int2 ir, CharPtr vals, CharPtr codes, ValNodePtr PNTR list, Uint1 strand, SeqIdPtr id, Int2 limit)
855
Int4 start = -1, stop = -1, met_start = -1;
856
SeqLocPtr slp = NULL, m_slp = NULL;
857
ValNodePtr prev = NULL;
858
IntFuzzPtr infrom=NULL, into=NULL;
860
SeqPortSeek(spp, ir, SEEK_SET);
862
for (pos=0; pos < len-2; pos += 3) {
863
codon[0] = SeqPortGetResidue(spp);
864
codon[1] = SeqPortGetResidue(spp);
865
codon[2] = SeqPortGetResidue(spp);
866
aa = AAForCodon(codon, codes);
869
if (met_start != -2) {
870
if (met_start == -1) {
873
if (stop - met_start > limit) {
874
if (strand == Seq_strand_plus) {
875
m_slp = SeqLocIntNew(met_start+ir, stop+ir, strand, id);
877
m_slp = SeqLocIntNew(len-1-(stop+ir),
878
len-1-(met_start+ir),strand, id);
887
if (stop - start > limit) {
888
if (strand == Seq_strand_plus) {
889
slp = SeqLocIntNew(start+ir, stop+ir, strand, id);
891
slp = SeqLocIntNew(len-1-(stop+ir), len-1-(start+ir),
901
prev = ValNodeAddPointer(list, ir, m_slp);
903
prev = ValNodeAddPointer(&prev, ir, m_slp);
912
aa = AAForCodon(codon, vals);
919
/* treat end of sequence as a stop */
920
if (met_start != -2) {
922
if (met_start == -1) {
925
if (stop-met_start > limit) {
926
if (strand == Seq_strand_plus) {
931
m_slp = SeqLocIntNew(met_start+ir, stop, strand, id);
933
m_slp = SeqLocIntNew(len-1-(stop+ir), len-1-(met_start+ir), strand, id);
942
if (stop-start > limit) {
943
if (strand == Seq_strand_plus) {
948
slp = SeqLocIntNew(start+ir, stop, strand, id);
950
slp = SeqLocIntNew(len-1-(stop+ir), len-1-(start+ir), strand, id);
956
ValNodeAddPointer(list, ir, m_slp);
959
m_slp = ValNodeNew(NULL);
961
ValNodeAddPointer(list, ir, m_slp);
968
static void find_orf_from_circle (SeqPortPtr spp, Boolean flagIsCircle,
969
CharPtr icodes, CharPtr codes,
970
ValNodePtr PNTR list, Uint1 strand,
971
SeqIdPtr id, Int2 limit)
977
Int4 start, stop, spec1, spec2;
978
SeqLocPtr slp, slpwrap = NULL;
980
ValNodePtr prev = NULL;
985
SeqPortSeek (spp, loop, SEEK_SET);
987
SeqPortSet_is_circle (spp, TRUE);
995
for (pos = 0; pos < len && loop < 3; pos += 3)
997
codon[0] = SeqPortGetResidue (spp);
998
codon[1] = SeqPortGetResidue (spp);
999
codon[2] = SeqPortGetResidue (spp);
1000
aa = AAForCodon (codon, this_code);
1001
if (aa == charcheck || slpwrap != NULL)
1003
if (aa == '*' && charcheck == '*')
1005
checklen += pos+2-start+1;
1006
if (checklen > limit)
1008
/* check for stop codon on junction */
1011
if (strand == Seq_strand_plus)
1014
slp = SeqLocIntNew (start, stop, strand, id);
1019
slp = SeqLocIntNew (len-start-1, stop, strand, id);
1024
if (strand == Seq_strand_plus)
1027
slp = SeqLocIntNew (start, len-1, strand, id);
1028
slp->next = SeqLocIntNew (0, stop, strand, id);
1032
stop = len+len-pos-3;
1033
slp = SeqLocIntNew (stop, len-1, strand, id);
1034
slp->next = SeqLocIntNew (0, len-start-1, strand, id);
1037
if (slpwrap != NULL)
1039
ValNodeLink (&slpwrap, slp);
1040
smp = ValNodeNew (NULL);
1041
smp->choice = 8; /* SeqLocMix */
1042
smp->data.ptrvalue = slpwrap;
1043
slp = (SeqLocPtr) smp;
1046
prev = ValNodeAddPointer (list, loop, slp);
1048
prev = ValNodeAddPointer (&prev, loop, slp);
1051
else /* didn't make the cut */
1053
if (slpwrap != NULL)
1054
slpwrap = SeqLocFree (slpwrap);
1060
if (aa == 'M' && charcheck == 'M')
1069
/* treat end of sequence special if circle and in or out of frame on loop */
1072
if (charcheck == '*') /* check for cross junction ORF */
1074
if (len%3 == 0) /* in frame */
1077
spec2 = start+1; /* cause the A could be part of stop codon */
1086
if (strand == Seq_strand_plus)
1087
slp = SeqLocIntNew (start, len-1, strand, id);
1089
slp = SeqLocIntNew (0, len-start-1, strand, id);
1090
if (slpwrap != NULL)
1091
ValNodeLink (&slpwrap, slp);
1094
checklen += len-start;
1095
for (pos = spec1; pos < spec2 && spec3 < loop; pos += 3)
1097
codon[0] = SeqPortGetResidue (spp);
1098
codon[1] = SeqPortGetResidue (spp);
1099
codon[2] = SeqPortGetResidue (spp);
1100
aa = AAForCodon (codon, this_code);
1104
if (checklen > limit)
1106
/* check for stop codon on junction */
1109
if (strand == Seq_strand_plus)
1112
slp = SeqLocIntNew (spec1, stop, strand, id);
1117
slp = SeqLocIntNew (stop, len-1, strand, id);
1122
if (strand == Seq_strand_plus)
1125
slp = SeqLocIntNew (pos, len-1, strand, id);
1126
slp->next = SeqLocIntNew (0, stop, strand, id);
1130
stop = len+len-pos-3;
1131
slp = SeqLocIntNew (stop, len-1, strand, id);
1132
slp->next = SeqLocIntNew (0, len-spec1-1, strand, id);
1135
ValNodeLink (&slpwrap, slp); /* slpwrap set to get this far */
1136
smp = ValNodeNew (NULL);
1137
smp->choice = 8; /* SeqLocMix */
1138
smp->data.ptrvalue = slpwrap;
1139
slpwrap = (SeqLocPtr) smp;
1141
prev = ValNodeAddPointer (list, loop, slpwrap);
1143
prev = ValNodeAddPointer (&prev, loop, slpwrap);
1152
if (strand == Seq_strand_plus)
1153
slp = SeqLocIntNew (spec1, len-1, strand, id);
1155
slp = SeqLocIntNew (0, len-spec1-1, strand, id);
1156
ValNodeLink (&slpwrap, slp); /* slpwrap set to get this far */
1157
checklen += spec2-spec1;
1159
SeqPortSeek (spp, pos-spec2+3, SEEK_SET); /* redundant check */
1163
} /* for (pos = ... break to here */
1164
if (slpwrap != NULL)
1165
slpwrap = SeqLocFree (slpwrap);
1166
} /* if (charcheck == '*') looking for a stop */
1167
} /* if (flagCircle) has to be round */
1169
SeqPortSeek (spp, pos, SEEK_SET);
1176
if (slpwrap != NULL)
1177
slpwrap = SeqLocFree (slpwrap);
1181
static int LIBCALLBACK CompareLoc (VoidPtr vp1, VoidPtr vp2)
1183
ValNodePtr vnp1, vnp2;
1184
ValNodePtr PNTR vnpp1;
1185
ValNodePtr PNTR vnpp2;
1188
vnpp1 = (ValNodePtr PNTR) vp1;
1189
vnpp2 = (ValNodePtr PNTR) vp2;
1192
l1 = SeqLocLen((SeqLocPtr) vnp1->data.ptrvalue);
1193
l2 = SeqLocLen((SeqLocPtr) vnp2->data.ptrvalue);
1203
static ValNodePtr find_all_orf(BioseqPtr bsp, CharPtr vals, CharPtr codes, Int2 limit, Int4 from, Int4 to)
1206
ValNodePtr list = NULL;
1208
SeqLocPtr slp = NULL;
1210
if (from > 0 || to > 0) {
1211
slp = SeqLocIntNew(from, to, Seq_strand_plus, bsp->id);
1212
spp = SeqPortNewByLoc(slp, Seq_code_ncbi4na);
1214
spp = SeqPortNew(bsp, 0, -1, Seq_strand_plus, Seq_code_ncbi4na);
1216
for (ir=0; ir < 3; ir++) {
1217
find_orf(spp, ir, vals, codes, &list, Seq_strand_plus, bsp->id, limit);
1223
if (from > 0 || to > 0) {
1224
slp = SeqLocIntNew(from, to, Seq_strand_minus, bsp->id);
1225
spp = SeqPortNewByLoc(slp, Seq_code_ncbi4na);
1227
spp = SeqPortNew(bsp, 0, -1, Seq_strand_minus, Seq_code_ncbi4na);
1229
for (ir=0; ir < 3; ir++) {
1230
find_orf(spp, ir, vals, codes, &list, Seq_strand_minus, bsp->id, limit);
1237
VnpHeapSort(&list, CompareLoc);
1242
static Boolean get_src (GatherContextPtr gcp)
1244
ValNodePtr vnp, new;
1245
ValNodePtr PNTR vnpp;
1247
vnpp = gcp->userdata;
1248
switch (gcp->thistype)
1251
vnp = (ValNodePtr) (gcp->thisitem);
1252
if (vnp->choice == Seq_descr_source) {
1253
if (vnp->data.ptrvalue != NULL) {
1254
new = SeqDescrNew(NULL);
1255
new = MemCopy(new, vnp, sizeof(ValNode));
1258
return FALSE; /*only top level BioSource will be returned*/
1268
static Int2 GetGcodeFromBioseq(BioseqPtr bsp)
1274
ValNodePtr vnp = NULL;
1276
entityID = ObjMgrGetEntityIDForPointer(bsp);
1277
MemSet ((Pointer) (&gs), 0, sizeof (GatherScope));
1278
gs.get_feats_location = TRUE;
1279
MemSet ((Pointer) (gs.ignore), (int)(TRUE), (size_t) (OBJ_MAX * sizeof(Boolean)));
1280
gs.ignore[OBJ_SEQDESC] = FALSE;
1282
GatherEntity(entityID, &vnp, get_src, &gs);
1284
ErrPostStr(SEV_WARNING, 0, 0, "BioSource not found");
1288
biop = vnp->data.ptrvalue;
1289
code = BioSourceToGeneticCode(biop);
1291
code = 1; /* try standard genetic code if it's not found */
1297
extern ValNodePtr GetOrfList (BioseqPtr bsp, Int2 limit)
1301
CharPtr vals, codes;
1302
ValNodePtr vnp, list;
1304
gcode = GetGcodeFromBioseq(bsp);
1306
gcode = 1; /* use universal */
1307
gcp = GeneticCodeFind(gcode, NULL);
1313
for (vnp = (ValNodePtr)gcp->data.ptrvalue; vnp != NULL; vnp = vnp->next)
1315
if (vnp->choice == 6) /* sncbieaa */
1316
vals = (CharPtr)vnp->data.ptrvalue;
1317
else if (vnp->choice == 3) /* ncbieaa */
1318
codes = (CharPtr)vnp->data.ptrvalue;
1323
list = find_all_orf(bsp, vals, codes, limit, 0, 0);
1328
extern ValNodePtr GetAltList (ValNodePtr list)
1331
SeqLocPtr slp, slpnext;
1334
for (vnp = list; vnp; vnp = vnp->next) {
1335
slp = (SeqLocPtr) vnp->data.ptrvalue;
1336
if (slp && slp->next) {
1337
slpnext = slp->next;
1339
slpnext->next = slp;
1340
vnp->data.ptrvalue = slpnext;