96 #define THIS_FILE "loadfeat.cpp"
101 #define Seq_descr_GIBB_mol_unknown CMolInfo::eBiomol_unknown
102 #define Seq_descr_GIBB_mol_genomic CMolInfo::eBiomol_genomic
103 #define Seq_descr_GIBB_mol_preRNA CMolInfo::eBiomol_pre_RNA
104 #define Seq_descr_GIBB_mol_mRNA CMolInfo::eBiomol_mRNA
105 #define Seq_descr_GIBB_mol_rRNA CMolInfo::eBiomol_rRNA
106 #define Seq_descr_GIBB_mol_tRNA CMolInfo::eBiomol_tRNA
107 #define Seq_descr_GIBB_mol_uRNA CMolInfo::eBiomol_snRNA
108 #define Seq_descr_GIBB_mol_snRNA CMolInfo::eBiomol_snRNA
109 #define Seq_descr_GIBB_mol_scRNA CMolInfo::eBiomol_scRNA
110 #define Seq_descr_GIBB_mol_other_genetic CMolInfo::eBiomol_other_genetic
111 #define Seq_descr_GIBB_mol_cRNA CMolInfo::eBiomol_cRNA
112 #define Seq_descr_GIBB_mol_snoRNA CMolInfo::eBiomol_snoRNA
113 #define Seq_descr_GIBB_mol_trRNA CMolInfo::eBiomol_transcribed_RNA
114 #define Seq_descr_GIBB_mol_other CMolInfo::eBiomol_other
129 {
"asparagine",
'N' },
130 {
"aspartic acid",
'D' },
131 {
"aspartate",
'D' },
133 {
"glutamine",
'Q' },
134 {
"glutamic acid",
'E' },
135 {
"glutamate",
'E' },
137 {
"histidine",
'H' },
138 {
"isoleucine",
'I' },
141 {
"methionine",
'M' },
142 {
"phenylalanine",
'F' },
144 {
"selenocysteine",
'U' },
146 {
"threonine",
'T' },
147 {
"tryptophan",
'W' },
161 {
"Ala",
'A', 0, { 52, 53, 54, 55, -1, -1, -1, -1 } },
162 {
"Arg",
'R', 2, { 28, 29, 30, 31, -1, -1, -1, -1 } },
163 {
"Arg",
'R', 5, { 28, 29, 30, 31, -1, -1, -1, -1 } },
164 {
"Arg",
'R', 9, { 28, 29, 30, 31, -1, -1, -1, -1 } },
165 {
"Arg",
'R', 13, { 28, 29, 30, 31, -1, -1, -1, -1 } },
166 {
"Arg",
'R', 14, { 28, 29, 30, 31, -1, -1, -1, -1 } },
167 {
"Arg",
'R', 0, { 28, 29, 30, 31, 46, 47, -1, -1 } },
168 {
"Asn",
'N', 9, { 40, 41, 42, -1, -1, -1, -1, -1 } },
169 {
"Asn",
'N', 14, { 40, 41, 42, -1, -1, -1, -1, -1 } },
170 {
"Asn",
'N', 0, { 40, 41, -1, -1, -1, -1, -1, -1 } },
171 {
"Asp",
'D', 0, { 56, 57, -1, -1, -1, -1, -1, -1 } },
172 {
"Asx",
'B', 9, { 40, 41, 42, 56, 57, -1, -1, -1 } },
173 {
"Asx",
'B', 14, { 40, 41, 42, 56, 57, -1, -1, -1 } },
174 {
"Asx",
'B', 0, { 40, 41, 56, 57, -1, -1, -1, -1 } },
175 {
"Cys",
'C', 10, { 12, 13, 14, -1, -1, -1, -1, -1 } },
176 {
"Cys",
'C', 0, { 12, 13, -1, -1, -1, -1, -1, -1 } },
177 {
"Gln",
'Q', 6, { 10, 11, 26, 27, -1, -1, -1, -1 } },
178 {
"Gln",
'Q', 15, { 11, 26, 27, -1, -1, -1, -1, -1 } },
179 {
"Gln",
'Q', 0, { 26, 27, -1, -1, -1, -1, -1, -1 } },
180 {
"Glu",
'E', 0, { 58, 59, -1, -1, -1, -1, -1, -1 } },
181 {
"Glx",
'Z', 6, { 10, 11, 26, 27, 58, 59, -1, -1 } },
182 {
"Glx",
'Z', 0, { 11, 26, 27, 58, 59, -1, -1, -1 } },
183 {
"Glx",
'Z', 0, { 26, 27, 58, 59, -1, -1, -1, -1 } },
184 {
"Gly",
'G', 13, { 46, 47, 60, 61, 62, 63, -1, -1 } },
185 {
"Gly",
'G', 0, { 60, 61, 62, 63, -1, -1, -1, -1 } },
186 {
"His",
'H', 0, { 24, 25, -1, -1, -1, -1, -1, -1 } },
187 {
"Ile",
'I', 2, { 32, 33, -1, -1, -1, -1, -1, -1 } },
188 {
"Ile",
'I', 3, { 32, 33, -1, -1, -1, -1, -1, -1 } },
189 {
"Ile",
'I', 5, { 32, 33, -1, -1, -1, -1, -1, -1 } },
190 {
"Ile",
'I', 13, { 32, 33, -1, -1, -1, -1, -1, -1 } },
191 {
"Ile",
'I', 0, { 32, 33, 34, -1, -1, -1, -1, -1 } },
192 {
"Leu",
'L', 3, { 2, 3, -1, -1, -1, -1, -1, -1 } },
193 {
"Leu",
'L', 12, { 2, 3, 16, 17, 18, -1, -1, -1 } },
194 {
"Leu",
'L', 0, { 2, 3, 16, 17, 18, 19, -1, -1 } },
195 {
"Lys",
'K', 9, { 43, -1, -1, -1, -1, -1, -1, -1 } },
196 {
"Lys",
'K', 14, { 43, -1, -1, -1, -1, -1, -1, -1 } },
197 {
"Lys",
'K', 0, { 42, 43, -1, -1, -1, -1, -1, -1 } },
198 {
"Met",
'M', 2, { 34, 35, -1, -1, -1, -1, -1, -1 } },
199 {
"Met",
'M', 3, { 34, 35, -1, -1, -1, -1, -1, -1 } },
200 {
"Met",
'M', 5, { 34, 35, -1, -1, -1, -1, -1, -1 } },
201 {
"Met",
'M', 13, { 34, 35, -1, -1, -1, -1, -1, -1 } },
202 {
"Met",
'M', 0, { 35, -1, -1, -1, -1, -1, -1, -1 } },
203 {
"fMet",
'M', 2, { 34, 35, -1, -1, -1, -1, -1, -1 } },
204 {
"fMet",
'M', 3, { 34, 35, -1, -1, -1, -1, -1, -1 } },
205 {
"fMet",
'M', 5, { 34, 35, -1, -1, -1, -1, -1, -1 } },
206 {
"fMet",
'M', 13, { 34, 35, -1, -1, -1, -1, -1, -1 } },
207 {
"fMet",
'M', 0, { 35, -1, -1, -1, -1, -1, -1, -1 } },
208 {
"Phe",
'F', 0, { 0, 1, -1, -1, -1, -1, -1, -1 } },
209 {
"Pro",
'P', 0, { 20, 21, 22, 23, -1, -1, -1, -1 } },
210 {
"Sec",
'U', 0, { -1, -1, -1, -1, -1, -1, -1, -1 } },
211 {
"Ser",
'S', 5, { 4, 5, 6, 7, 44, 45, 46, 47 } },
212 {
"Ser",
'S', 9, { 4, 5, 6, 7, 44, 45, 46, 47 } },
213 {
"Ser",
'S', 12, { 4, 5, 6, 7, 19, 44, 45, -1 } },
214 {
"Ser",
'S', 14, { 4, 5, 6, 7, 44, 45, 46, 47 } },
215 {
"Ser",
'S', 0, { 4, 5, 6, 7, 44, 45, -1, -1 } },
216 {
"Thr",
'T', 3, { 16, 17, 18, 19, 36, 37, 38, 39 } },
217 {
"Thr",
'T', 0, { 36, 37, 38, 39, -1, -1, -1, -1 } },
218 {
"Trp",
'W', 1, { 15, -1, -1, -1, -1, -1, -1, -1 } },
219 {
"Trp",
'W', 6, { 15, -1, -1, -1, -1, -1, -1, -1 } },
220 {
"Trp",
'W', 10, { 15, -1, -1, -1, -1, -1, -1, -1 } },
221 {
"Trp",
'W', 11, { 15, -1, -1, -1, -1, -1, -1, -1 } },
222 {
"Trp",
'W', 12, { 15, -1, -1, -1, -1, -1, -1, -1 } },
223 {
"Trp",
'W', 15, { 15, -1, -1, -1, -1, -1, -1, -1 } },
224 {
"Trp",
'W', 0, { 14, 15, -1, -1, -1, -1, -1, -1 } },
225 {
"Tyr",
'Y', 14, { 8, 9, 10, -1, -1, -1, -1, -1 } },
226 {
"Tyr",
'Y', 0, { 8, 9, -1, -1, -1, -1, -1, -1 } },
227 {
"Val",
'V', 0, { 48, 49, 50, 51, -1, -1, -1, -1 } },
228 {
"TERM",
'*', 1, { 10, 11, 14, -1, -1, -1, -1, -1 } },
229 {
"TERM",
'*', 2, { 10, 11, 46, 47, -1, -1, -1, -1 } },
230 {
"TERM",
'*', 6, { 14, -1, -1, -1, -1, -1, -1, -1 } },
231 {
"TERM",
'*', 11, { 10, 11, 14, -1, -1, -1, -1, -1 } },
232 {
"TERM",
'*', 12, { 10, 11, 14, -1, -1, -1, -1, -1 } },
233 {
"TERM",
'*', 14, { 11, -1, -1, -1, -1, -1, -1, -1 } },
234 {
"TERM",
'*', 15, { 10, 14, -1, -1, -1, -1, -1, -1 } },
235 {
"TERM",
'*', 0, { 10, 11, -1, -1, -1, -1, -1, -1 } },
236 {
"OTHER",
'X', 0, { -1, -1, -1, -1, -1, -1, -1, -1 } },
237 {
nullptr,
'\0', 0, { -1, -1, -1, -1, -1, -1, -1, -1 } }
256 "expressed sequence tag",
257 "partial cDNA sequence",
258 "transcribed sequence fragment",
260 "putatively transcribed partial sequence",
387 "UNIPROT/SWISS-PROT",
389 "UNIPROTKB/SWISS-PROT",
430 "artificial_location",
435 "environmental_sample",
442 "mobile_element_type",
448 "ribosomal_slippage",
469 "autocatalytically_spliced_intron",
470 "hammerhead_ribozyme",
511 "DNase_I_hypersensitive_site",
513 "enhancer_blocking_element",
515 "imprinting_control_region",
517 "locus_control_region",
518 "matrix_attachment_region",
522 "polyA_signal_sequence",
524 "recoding_stimulatory_region",
525 "replication_regulatory_region",
526 "ribosome_binding_site",
531 "transcriptional_cis_regulatory_region",
587 for (; dbp; dbp = dbpnext) {
610 for (p =
value; *p !=
'\0'; p++)
636 #ifdef BIOSEQ_FIND_METHOD
638 bsp = BioseqFind(sip);
640 return (bsp->length);
649 if (
id.IsGenbank() ||
id.IsEmbl() ||
id.IsDdbj() ||
id.IsTpg() ||
650 id.IsTpe() ||
id.IsTpd())
651 text_id =
id.GetTextseq_Id();
656 for (use_indx = 0; use_indx < pp->
indx; use_indx++) {
658 vernum = pp->
entrylist[use_indx]->vernum;
659 if (text_id_acc == acnum &&
660 (pp->
accver ==
false || vernum == text_id_ver))
664 if (use_indx >= pp->
indx) {
669 if (
len !=
static_cast<size_t>(-1))
676 if (pp->
accver ==
false || text_id_ver < 0) {
686 if (*pp->
buf ==
'\0')
737 line = line.substr(4);
739 size_t colon = line.find(
':');
740 if (colon == string::npos) {
745 string tail = line.substr(colon + 1);
746 line = line.substr(0, colon);
761 buf =
"UniProt/Swiss-Prot";
763 buf =
"UniProt/TrEMBL";
770 string buf(
"UniProtKB");
771 buf += line.substr(7);
776 const Char* strid =
nullptr;
779 const Char* p = tail.c_str();
781 for (strid = p; *p >=
'0' && *p <=
'9';)
783 if (*p ==
'\0' && *strid !=
'0') {
790 for (strid = p; *p >=
'0' && *p <=
'9';)
809 for (; *
r >=
'0' && *
r <=
'9';)
815 if (*
r !=
'\0' || q != p)
822 if (*p !=
'e' && *p !=
'g' && *p !=
'd') {
827 const Char* q = p + 1;
832 for (
r = q; *
r >=
'0' && *
r <=
'9';)
834 if (*q ==
'\0' || *
r !=
'\0') {
850 tag->SetTag().SetStr(strid);
852 tag->SetTag().SetId(intid);
883 for (CSeq_feat::TQual::iterator qual = feat.
SetQual().begin(); qual != feat.
SetQual().end();) {
884 if (! (*qual)->IsSetQual() || (*qual)->GetQual() !=
"db_xref") {
895 db_refs.push_back(dbtag);
900 qual = feat.
SetQual().erase(qual);
939 if (cur_loc->
IsInt())
971 for (ptr =
str; *ptr !=
' ' && *ptr !=
'\0';)
980 while (*eptr ==
' ' || *eptr ==
')')
1056 const CSeq_id* cur_id =
nullptr;
1058 switch (cur_loc->
Which()) {
1062 cur_id = cur_loc->
GetId();
1068 cur_id = cur_loc->
GetId();
1074 cur_id = cur_loc->
GetId();
1082 cur_id = cur_loc->
GetId();
1087 cur_id = cur_loc->
GetId();
1097 if (! accession || ! cur_id)
1114 else if (strand != cur_loc->
GetStrand())
1128 if (!
str || *
str ==
'\0')
1167 for (; dbp; dbp = dbp->
mpNext) {
1172 if (pubdesc.
Empty())
1176 feat->
SetData().SetPub(*pubdesc);
1184 for (p = q; *p !=
'\0' && *p !=
'(';)
1201 for (p = dbp->
mOffset + col_data; *p !=
'\0' && *p !=
'(';)
1206 for (; subdbp; subdbp = subdbp->
mpNext) {
1250 feats.push_back(feat);
1256 feats.push_back(feat);
1298 if (pubdesc.
Empty() || ! pubdesc->IsSetPub())
1305 imp_feat.
SetKey(
"Site-ref");
1306 imp_feat.
SetLoc(
"sites");
1315 feat->
SetCit().SetPub().push_back(pub);
1317 if (pubdesc->IsSetComment())
1324 feats.push_back(feat);
1339 return "unknown location";
1363 for (q = p + 4; *q ==
' ';)
1366 for (pars = 0, p = q; *p !=
'\0'; p++) {
1367 if (*p ==
',' && pars == 0)
1371 else if (*p ==
')') {
1404 ErrPostEx(
SEV_WARNING,
ERR_FEATURE_FourBaseAntiCodon,
"tRNA feature at \"%s\" has anticodon with location spanning four bases: \"%s\". Cannot generate corresponding codon value from the DNA sequence.", loc.empty() ?
"unknown" : loc.c_str(), loc_str);
1414 if (xrange != anticodon_range) {
1450 len = comment.size();
1452 if (
len > 15 &&
len < 20) {
1453 if (
StringEquNI(comment.c_str() +
len - 15,
"S ribosomal RNA", 15)) {
1457 }
else if (
len > 6 &&
len < 20) {
1465 if (qval_str.empty())
1469 for (p = qval; p; p += 13) {
1476 for (p = qval; p; p = qval +
len) {
1484 len = p - qval + 13;
1494 s.append(
" ribosomal RNA");
1501 for (p = qval, q = p; q; q = p + 13) {
1514 if (p && p > qval && p[15] ==
'\0') {
1516 if (*p >=
'0' && *p <=
'9')
1524 if (p == qval || (p[9] !=
' ' && p[9] !=
'\0')) {
1532 len = p - qval + 14;
1566 rna_ref.
SetExt().SetName(qval);
1576 if (acp->
intaa == ch)
1579 return (acp->
intaa);
1590 for (tap =
taa; tap->
name; tap++)
1600 return (acp->
intaa);
1636 if (! product ||
StringLen(product) < 7)
1639 bool digits =
false;
1641 for (p = prod; *p !=
'\0'; p++) {
1642 if (*p >=
'a' && *p <=
'z')
1644 else if ((*p < 'A' || *p >
'Z') && *p !=
'(' && *p !=
')') {
1645 if (*p >=
'0' && *p <=
'9')
1663 for (p = end; *p !=
'\0'; p++)
1664 if (*p ==
'(' || *p ==
')')
1668 if (start == prod && *end ==
'\0') {
1679 for (p = end; *p ==
' ' || *p ==
')' || *p ==
'(';)
1686 while (*p >=
'A' && *p <=
'Z')
1693 while (*p ==
' ' || *p ==
')' || *p ==
'(')
1695 for (q = p; *p >=
'A' && *p <=
'Z';)
1701 while (*p ==
' ' || *p ==
')' || *p ==
'(')
1703 for (q = p; *p >=
'A' && *p <=
'Z';)
1713 while (*p ==
' ' || *p ==
'(' || *p ==
')')
1719 for (p = start - 1; *p ==
' ' || *p ==
')' || *p ==
'('; p--)
1723 if (p > prod && p[1] ==
')') {
1724 for (p--; *p !=
'('; p--)
1728 for (p--; *p ==
' ' || *p ==
'(' || *p ==
'('; p--)
1734 for (q = p++; *q >=
'A' && *q <=
'Z'; q--)
1737 if (*q < 'A' || *q >
'Z')
1766 if (!
first && ! second && ! third && ! fourth &&
remove && ! digits)
1777 comment +=
"; fMet";
1797 for (p = comm; *p !=
'\0'; p++) {
1798 if (*p >=
'a' && *p <=
'z')
1800 else if (*p < 'A' || *p >
'Z')
1805 if (
StringEquN(comm,
"CODON RECOGNIZED ", 17)) {
1817 if (
StringEquN(comm,
"PUTATIVE ", 9) && comm[10] ==
' ' &&
1818 comm[14] ==
' ' &&
StringEquN(&comm[15],
"TRNA", 4)) {
1826 for (q = comm, p = q; p;) {
1854 char* qval =
nullptr;
1876 feat.
SetData().SetRna(*rna_ref);
1890 rna_gen->SetClass(p);
1896 rna_qual->
SetQual(
"tag_peptide");
1900 rna_quals->
Set().push_back(rna_qual);
1903 rna_gen->SetQuals(*rna_quals);
1912 if (p && p[0] != 0) {
1930 const Char* c_q =
nullptr;
1931 for (;; c_p += 5, c_q = c_p) {
1937 const Char* c_r =
nullptr;
1938 for (c_p = feat.
GetComment().c_str();; c_p += 4, c_r = c_p) {
1945 c_p = (c_q > c_r) ? c_q : c_r;
1952 while (*c_p ==
' ' || *c_p ==
'\t' || *c_p ==
',' || *c_p ==
';')
1972 if (rna_gen.
Empty())
1975 rna_gen->SetProduct(qval);
1977 rna_ref->
SetExt().SetName(qval);
1987 rna_ref->
SetExt().SetGen(*rna_gen);
2008 trnaa->SetAnticodon(*anticodon);
2009 rna_ref->
SetExt().SetTRNA(*trnaa);
2043 if (trnaa.
Empty()) {
2044 if (trnap.
Empty()) {
2046 rna_ref->
SetExt().SetTRNA(*trnac);
2052 rna_ref->
SetExt().SetTRNA(*trnap);
2056 rna_ref->
SetExt().SetTRNA(*trnac);
2060 trnap->SetCodon().assign(trnac->GetCodon().begin(), trnac->GetCodon().end());
2079 trnac->SetAnticodon(trnaa->SetAnticodon());
2080 trnaa->ResetAnticodon();
2083 trnac->SetCodon().assign(trnaa->GetCodon().begin(), trnaa->GetCodon().end());
2086 rna_ref->
SetExt().SetTRNA(*trnac);
2123 feat.
SetData().SetImp(*imp_feat);
2130 for (COrg_ref::TDb::iterator db = bio.
SetOrg().SetDb().begin(); db != bio.
SetOrg().SetDb().end(); ++db) {
2131 if (! (*db)->CanGetDb())
2134 COrg_ref::TDb::iterator tdb = db;
2135 for (++tdb; tdb != bio.
SetOrg().SetDb().end(); ++tdb) {
2136 if (! (*tdb)->IsSetDb())
2139 if ((*db)->GetDb() < (*tdb)->GetDb())
2142 if ((*db)->GetDb() == (*tdb)->GetDb()) {
2164 for (COrgName::TMod::iterator
mod = rmod.begin();
mod != rmod.end(); ++
mod) {
2165 COrgName::TMod::iterator tmod =
mod;
2166 for (++tmod; tmod != rmod.end(); ++tmod) {
2167 if ((*mod)->GetSubtype() < (*tmod)->GetSubtype())
2170 if ((*mod)->GetSubtype() == (*tmod)->GetSubtype() &&
2171 (*mod)->GetSubname() <= (*tmod)->GetSubname())
2184 for (CBioSource::TSubtype::iterator sub = rsub.begin(); sub != rsub.end(); ++sub) {
2185 CBioSource::TSubtype::iterator tsub = sub;
2186 for (++tsub; tsub != rsub.end(); ++tsub) {
2187 if ((*sub)->GetSubtype() < (*tsub)->GetSubtype())
2190 if ((*sub)->GetSubtype() == (*tsub)->GetSubtype() &&
2191 (*sub)->GetName() <= (*tsub)->GetName())
2203 bool has_comma =
val.find(
',') != string::npos;
2206 std::replace(
val.begin(),
val.end(),
',',
';');
2217 if (! fbp || fbp->
quals.empty())
2220 TQualVector::iterator
first = fbp->
quals.end();
2221 size_t len = 0, count = 0;
2223 for (TQualVector::iterator qual = fbp->
quals.begin(); qual != fbp->
quals.end();) {
2224 if ((*qual)->GetQual() !=
"rpt_unit") {
2231 if ((*qual)->GetVal().empty()) {
2232 qual = fbp->
quals.erase(qual);
2237 len += (*qual)->GetVal().size();
2257 const string&
val = (*first)->GetVal();
2258 if (*
val.begin() ==
'(' && *
val.rbegin() ==
')') {
2265 p.reserve(
len + count + 1);
2267 p.append((*first)->GetVal());
2269 for (TQualVector::iterator qual =
first; qual != fbp->
quals.end();) {
2270 if ((*qual)->GetQual() !=
"rpt_unit") {
2276 p.append((*qual)->GetVal());
2277 qual = fbp->
quals.erase(qual);
2280 (*first)->SetVal(p);
2294 if (! fbp || fbp->
quals.empty())
2304 for (TQualVector::iterator qual = fbp->
quals.begin(); qual != fbp->
quals.end();) {
2305 const string& qual_str = (*qual)->IsSetQual() ? (*qual)->GetQual() :
"";
2306 const string& val_str = (*qual)->IsSetVal() ? (*qual)->GetVal() :
"";
2307 if (qual_str ==
"experiment") {
2308 if (val_str ==
"experimental evidence, no additional details recorded") {
2310 qual = fbp->
quals.erase(qual);
2318 if (qual_str ==
"inference") {
2319 if (val_str ==
"non-experimental evidence, no additional details recorded") {
2321 qual = fbp->
quals.erase(qual);
2329 if (qual_str !=
"evidence") {
2349 qual = fbp->
quals.erase(qual);
2352 if (evi_exp + evi_not > 0 && exp_good + exp_bad + inf_good + inf_bad > 0) {
2364 if (evi_exp + exp_good > 0 && evi_not + inf_good > 0) {
2376 if ((exp_good > 0 && exp_bad > 0) || (inf_good > 0 && inf_bad > 0)) {
2382 ErrPostEx(
SEV_REJECT,
ERR_QUALIFIER_Conflict,
"The special \"no additional details recorded\" value for /experiment or /inference exists in conjunction with other /experiment or /inference qualifiers on the \"%s\" feature at \"%s\". This is currently unsupported.", fbp->
key ? fbp->
key :
"Unknown", fbp->
location ? fbp->
location :
"unknown location");
2388 if (exp_good + evi_exp > 0)
2390 else if (inf_good + evi_not > 0)
2413 char* loc =
nullptr;
2415 bool locmap =
false;
2438 if (pp->
debug ==
false) {
2446 if (! fbp->
quals.empty()) {
2454 if (! fbp->
quals.empty()) {
2459 if (! fbp->
quals.empty())
2462 if (! fbp->
quals.empty())
2465 if (! fbp->
quals.empty()) {
2475 exc_text +=
", trans-splicing";
2490 if (! fbp->
quals.empty()) {
2506 for (
const auto& cur : fbp->
quals) {
2507 const string& qual_str = cur->GetQual();
2508 if (qual_str ==
"pseudogene")
2512 if (qual_str ==
"translation" && (! cur->IsSetVal() || cur->GetVal().empty()))
2515 if (! qual_str.empty())
2516 feat->
SetQual().push_back(cur);
2538 for (TQualVector::iterator q = fbp->
quals.begin(); q != fbp->
quals.end(); ++q) {
2539 if ((*q)->GetQual() ==
"gene" ||
2540 (! qamode && (*q)->GetQual() ==
"product"))
2543 TQualVector::iterator tq = q;
2544 for (++tq; tq != fbp->
quals.end(); ++tq) {
2545 const string& q_qual = (*q)->GetQual();
2546 const string& tq_qual = (*tq)->GetQual();
2548 if (! tq_qual.empty()) {
2549 if (q_qual ==
"gene")
2558 const string q_val = (*q)->GetVal();
2559 const string tq_val = (*tq)->GetVal();
2564 if (! tq_val.empty()) {
2565 if (q_val[0] >=
'0' && q_val[0] <=
'9' &&
2566 tq_val[0] >=
'0' && tq_val[0] <=
'9') {
2567 if (atoi(q_val.c_str()) <= atoi(tq_val.c_str()))
2569 }
else if (q_val <= tq_val)
2585 for (
const auto& gbqp1 : qual1) {
2587 for (
const auto& gbqp2 : qual2) {
2588 const Char* qual_a = gbqp1->IsSetQual() ? gbqp1->GetQual().c_str() :
nullptr;
2589 const Char* qual_b = gbqp2->IsSetQual() ? gbqp2->GetQual().c_str() :
nullptr;
2591 const Char* val_a = gbqp1->IsSetVal() ? gbqp1->GetVal().c_str() :
nullptr;
2592 const Char* val_b = gbqp2->IsSetVal() ? gbqp2->GetVal().c_str() :
nullptr;
2612 if (! fbp1 && ! fbp2)
2614 if (! fbp1 || ! fbp2 ||
2633 if (!
val || *
val ==
'\0')
2636 for (p =
val; *p >=
'0' && *p <=
'9';)
2639 if (p ==
val || p[0] !=
'.' || p[1] !=
'.')
2643 for (p += 2, q = p; *q >=
'0' && *q <=
'9';)
2645 if (q == p || *q !=
'\0')
2649 if (i1 == 0 || i1 > i2 || i2 > (
Int4)length)
2659 if (! fbp || fbp->
quals.empty())
2662 for (TQualVector::iterator cur = fbp->
quals.begin(); cur != fbp->
quals.end();) {
2663 if (! (*cur)->IsSetQual() || ! (*cur)->IsSetVal()) {
2668 const string& qual_str = (*cur)->GetQual();
2669 const string& val_str = (*cur)->GetVal();
2685 cur = fbp->
quals.erase(cur);
2699 if (! dbp || ! dbp->
mpNext)
2702 for (; dbp; dbp = dbp->
mpNext) {
2708 for (tdbp = dbp->
mpNext; tdbp; tdbp = tdbpnext) {
2711 tdbpprev->
mpNext = tdbpnext;
2735 tdbpprev->
mpNext = tdbpnext;
2762 for (; dbp; dbp = dbp->
mpNext) {
2790 isLocusTag(
"locus_tag");
2792 for (; dbp; dbp = dbp->
mpNext) {
2796 size_t olt = std::count_if(fbp->
quals.begin(), fbp->
quals.end(), isOldLocusTag);
2797 size_t lt = std::count_if(fbp->
quals.begin(), fbp->
quals.end(), isLocusTag);
2807 for (
const auto& gbqp1 : fbp->
quals) {
2808 if (! gbqp1->IsSetQual() || ! gbqp1->IsSetVal() || ! isLocusTag(gbqp1))
2813 const string& gbqp1_val = gbqp1->GetVal();
2814 if (gbqp1_val.empty())
2817 for (
const auto& gbqp2 : fbp->
quals) {
2818 if (! gbqp2->IsSetQual() || ! gbqp2->IsSetVal())
2821 const string& gbqp2_val = gbqp2->GetVal();
2835 for (TQualVector::const_iterator gbqp1 = fbp->
quals.begin(); gbqp1 != fbp->
quals.end(); ++gbqp1) {
2836 const string& gbqp1_val = (*gbqp1)->GetVal();
2837 if (isOldLocusTag(*gbqp1) || gbqp1_val.empty())
2840 TQualVector::const_iterator gbqp2 = gbqp1;
2841 for (++gbqp2; gbqp2 != fbp->
quals.end(); ++gbqp2) {
2842 const string& gbqp2_val = (*gbqp2)->GetVal();
2843 if (isOldLocusTag(*gbqp2) || gbqp2_val.empty())
2852 if (gbqp2 != fbp->
quals.end())
2862 bool got_pseudogene;
2865 for (; dbp; dbp = dbp->
mpNext) {
2871 got_pseudogene =
false;
2873 for (TQualVector::iterator cur = fbp->
quals.begin(); cur != fbp->
quals.end();) {
2874 const string& qual_str = (*cur)->GetQual();
2875 const string& val_str = (*cur)->IsSetVal() ? (*cur)->GetVal() :
"";
2877 if (qual_str !=
"pseudogene") {
2878 if (! got_pseudo && qual_str ==
"pseudo")
2884 if (got_pseudogene) {
2887 cur = fbp->
quals.erase(cur);
2891 got_pseudogene =
true;
2893 if (val_str.empty()) {
2896 cur = fbp->
quals.erase(cur);
2907 cur = fbp->
quals.erase(cur);
2910 if (! got_pseudogene || ! got_pseudo)
2929 for (; dbp; dbp = dbp->
mpNext) {
2937 for (TQualVector::iterator cur = fbp->
quals.begin(); cur != fbp->
quals.end();) {
2938 const string& qual_str = (*cur)->GetQual();
2940 string& val_str = (*cur)->IsSetVal() ? (*cur)->SetVal() :
dummy;
2942 if (qual_str ==
"compare") {
2944 if (! val_str.empty()) {
2946 if (q && q[1] !=
'\0') {
2947 for (p = q + 1; *p >=
'0' && *p <=
'9';)
2961 cur = fbp->
quals.erase(cur);
2965 }
else if (qual_str ==
"citation")
2971 if (com_count > 0 || cit_count > 0 ||
3000 for (; dbp; dbp = dbp->
mpNext) {
3005 for (p =
location, q = p; *p !=
'\0'; p++)
3006 if (*p !=
' ' && *p !=
'\t' && *p !=
'\n')
3015 for (p =
location + 1; *p !=
'\0'; p++) {
3018 for (
r =
nullptr, q = p - 1;; q--) {
3020 if (*q !=
'_' && (*q < '0' || *q >
'9') &&
3021 (*q < 'a' || *q >
'z') && (*q < 'A' || *q >
'Z'))
3033 if (*q !=
'_' && (*q < '0' || *q >
'9') &&
3034 (*q < 'a' || *q >
'z') && (*q < 'A' || *q >
'Z')) {
3053 (q[1] ==
'z' || q[1] ==
'Z') && ibp->
is_tpa ==
false)
3088 using FTAOperonList = list<FTAOperon*>;
3089 FTAOperonList operonList;
3090 FTAOperonList residentList;
3091 bool success =
true;
3093 if (feats.empty()) {
3097 for (
const auto& pFeat : feats) {
3098 if (! pFeat->GetData().IsImp())
3101 const auto& featLocation = pFeat->GetLocation();
3102 const CImp_feat& featImp = pFeat->GetData().GetImp();
3106 for (
const auto& pQual : pFeat->GetQual()) {
3107 const auto& qual = *pQual;
3108 if (! qual.IsSetQual() || qual.GetQual() !=
"operon" ||
3109 ! qual.IsSetVal() || qual.GetVal().empty()) {
3119 operonList.push_back(pLatest);
3121 residentList.push_back(pLatest);
3124 for (
const auto& operon : operonList) {
3125 if (pLatest == operon) {
3128 if (pLatest->
mOperon != operon->mOperon) {
3136 if (opQualCount > 1) {
3141 if (opQualCount == 0 && featImp.
IsSetKey() && featImp.
GetKey() ==
"operon") {
3147 for (
const auto& resident : residentList) {
3148 bool matched =
false;
3149 for (
const auto& operon : operonList) {
3150 if (resident->mOperon != operon->mOperon) {
3157 ErrPostEx(
SEV_REJECT,
ERR_FEATURE_OperonLocationMisMatch,
"Feature \"%s\" at \"%s\" with /operon qualifier \"%s\" does not fall within the span of the operon feature at \"%s\".", resident->mFeatname.c_str(), resident->LocationStr().c_str(), resident->mOperon.c_str(), operon->LocationStr().c_str());
3162 ErrPostEx(
SEV_REJECT,
ERR_FEATURE_InvalidOperonQual,
"/operon qualifier \"%s\" on feature \"%s\" at \"%s\" has a value that does not match any of the /operon qualifiers on operon features.", resident->mOperon.c_str(), resident->mFeatname.c_str(), resident->LocationStr().c_str());
3166 for (
auto& resident : residentList) {
3169 for (
auto& operon : operonList) {
3180 if (! fbp || fbp->
quals.empty())
3183 for (TQualVector::iterator cur = fbp->
quals.begin(); cur != fbp->
quals.end(); ++cur) {
3184 const char* cur_qual = (*cur)->IsSetQual() ? (*cur)->GetQual().c_str() :
nullptr;
3185 const char* cur_val = (*cur)->IsSetVal() ? (*cur)->GetVal().c_str() :
nullptr;
3187 TQualVector::iterator
next = cur;
3189 const char* next_qual = (*next)->IsSetQual() ? (*next)->GetQual().c_str() :
nullptr;
3190 const char* next_val = (*next)->IsSetVal() ? (*next)->GetVal().c_str() :
nullptr;
3223 list<string> linkage_evidence_names;
3228 const char* gap_type;
3231 Int4 estimated_length;
3254 if (is_htg >= 0 && is_htg <= 2)
3258 else if (
key ==
"HTGS_PHASE0")
3260 else if (
key ==
"HTGS_PHASE1")
3262 else if (
key ==
"HTGS_PHASE2")
3264 else if (
key ==
"HTGS_PHASE3")
3270 finished_gap =
false;
3271 for (ibp->
gaps =
nullptr; dbp; dbp = dbp->
mpNext) {
3277 linkage_evidence_names.clear();
3278 asn_linkage_evidence.clear();
3284 if (! fbp || ! fbp->
key)
3287 prev_gap = curr_gap;
3290 prev_gap = curr_gap;
3298 linkage_evidence_names.clear();
3300 asn_linkage_evidence.clear();
3301 estimated_length = -1;
3303 for (
const auto& cur : fbp->
quals) {
3304 if (! cur->IsSetQual() || ! cur->IsSetVal())
3307 const string& cur_qual = cur->GetQual();
3308 const string& cur_val = cur->GetVal();
3310 if (cur_qual.empty() || cur_val.empty())
3313 if (cur_qual ==
"estimated_length") {
3314 if (cur_val ==
"unknown")
3315 estimated_length = -100;
3317 const char* cp = cur_val.c_str();
3318 for (; *cp >=
'0' && *cp <=
'9';)
3321 estimated_length = atoi(cur_val.c_str());
3323 }
else if (cur_qual ==
"gap_type")
3324 gap_type = cur_val.c_str();
3325 else if (cur_qual ==
"linkage_evidence") {
3326 linkage_evidence_names.push_back(cur_val);
3334 for (q = p; *p >=
'0' && *p <=
'9';)
3339 }
else if (*p ==
'.') {
3343 if (*fbp->
location ==
'<' && from != 1)
3345 else if (*p ==
'.') {
3348 for (q = p; *p >=
'0' && *p <=
'9';)
3352 if (*(q - 1) ==
'>' && to != (
int)ibp->
bases)
3358 if (from == 0 || to == 0 || from > to) {
3369 if (gap_type && is_htg > -1 &&
3370 !
StringEqu(gap_type,
"within scaffold") &&
3371 !
StringEqu(gap_type,
"repeat within scaffold"))
3372 ErrPostEx(
SEV_ERROR,
ERR_QUALIFIER_UnexpectedGapTypeForHTG,
"assembly_gap has /gap_type of \"%s\", but clone-based HTG records are only expected to have \"within scaffold\" or \"repeat within scaffold\" gaps. assembly_gap feature located at \"%d..%d\".", gap_type, from, to);
3374 if (is_htg == 0 || is_htg == 1) {
3375 for (
const string& evidence : linkage_evidence_names) {
3377 ErrPostEx(
SEV_ERROR,
ERR_QUALIFIER_LinkageShouldBeUnspecified,
"assembly gap has /linkage_evidence of \"%s\", but unoriented and unordered Phase0/Phase1 HTG records are expected to have \"unspecified\" evidence. assembly_gap feature located at \"%d..%d\".", evidence.c_str(), from, to);
3380 }
else if (is_htg == 2 || is_htg == 3) {
3381 for (
const string& evidence : linkage_evidence_names) {
3389 if (is_htg == 3 && ! finished_gap) {
3391 finished_gap =
true;
3408 asn_gap_type = snp->
num;
3410 if (linkage_evidence_names.empty() &&
3411 (
StringEqu(gap_type,
"within scaffold") ||
3412 StringEqu(gap_type,
"repeat within scaffold"))) {
3417 if (! linkage_evidence_names.empty()) {
3419 !
StringEqu(gap_type,
"within scaffold") &&
3420 !
StringEqu(gap_type,
"repeat within scaffold")) {
3423 "The /linkage_evidence qualifier is not legal for the assembly_gap feature at \"%d..%d\" with /gap_type \"%s\".",
3431 for (
const string& evidence : linkage_evidence_names) {
3433 if (evidence == snp->
str)
3438 "assembly_gap feature at \"%d..%d\" has an invalid linkage evidence : \"%s\".",
3447 new_evidence->SetType(snp->
num);
3448 asn_linkage_evidence.push_back(new_evidence);
3453 if (prev_gap + curr_gap == 3) {
3462 if (estimated_length == -1)
3466 }
else if (estimated_length == 0) {
3473 }
else if (estimated_length == -100) {
3474 if (is_htg >= 0 && to - from != 99) {
3477 }
else if (estimated_length != to - from + 1) {
3488 for (gfp = ibp->
gaps; gfp; gfp = gfp->
next) {
3489 if ((gfp->
from >= from && gfp->
from <= to) ||
3490 (gfp->
to >= from && gfp->
to <= to) ||
3491 (gfp->
from <= from && gfp->
to >= to)) {
3494 }
else if (to + 1 == gfp->
from || from - 1 == gfp->
to) {
3502 ErrPostEx(sev,
ERR_FEATURE_ContiguousGaps,
"Gap features at \"%d..%d\" and \"%d..%d\" are contiguous, and should probably be represented by a single gap that spans both.", from, to, gfp->
from, gfp->
to);
3518 if (! asn_linkage_evidence.empty()) {
3520 asn_linkage_evidence.clear();
3522 gfp->
next =
nullptr;
3540 for (tgfp = ibp->
gaps; tgfp; tgfp = tgfp->
next) {
3549 linkage_evidence_names.clear();
3550 asn_linkage_evidence.clear();
3559 ibp->
gaps =
nullptr;
3568 if (! entry || ! xip)
3571 for (; xip; xip = xip->
next) {
3576 for (xipqual = xip->
subtags; xipqual; xipqual = xipqual->
next) {
3588 quals.push_back(qual);
3601 if (! entry || ! xip)
3604 for (; xip; xip = xip->
next)
3617 for (xipfeat = xip->
subtags; xipfeat; xipfeat = xipfeat->
next) {
3658 for (
auto& cur : fbp->
quals) {
3659 if (! cur->IsSetQual() || ! cur->IsSetVal())
3662 const string& cur_qual = cur->GetQual();
3663 const string& cur_val = cur->GetVal();
3665 if (cur_qual !=
"note" || cur_val.empty())
3669 vector<Char>
buf(cur_val.size() + 1);
3671 const char* cp = cur_val.c_str();
3672 for (q = &
buf[0]; *cp !=
'\0'; ++cp) {
3674 if (*cp ==
';' && (cp[1] ==
' ' || cp[1] ==
';')) {
3675 for (++cp; *cp ==
' ' || *cp ==
';';)
3684 cur->SetVal(&
buf[0]);
3686 size += cur->GetVal().size();
3687 for (cp = cur->GetVal().c_str(); *cp !=
'\0'; ++cp)
3698 for (TQualVector::iterator cur = fbp->
quals.begin(); cur != fbp->
quals.end();) {
3699 if (! (*cur)->IsSetQual() || ! (*cur)->IsSetVal()) {
3704 const string& cur_qual = (*cur)->GetQual();
3705 const string& cur_val = (*cur)->GetVal();
3707 if (cur_qual !=
"note") {
3712 if (! cur_val.empty()) {
3720 for (
const char* cq = cur_val.c_str(); *cq !=
'\0'; *p++ = *cq++)
3725 cur = fbp->
quals.erase(cur);
3734 fbp->
quals.push_back(qual_new);
3761 if (!
str || *
str ==
'\0')
3764 for (p =
str; *p !=
'\0'; p++)
3765 if (*p >=
'A' && *p <=
'Z')
3773 char* p = &val_buf[0];
3776 for (; *p !=
'\0'; p++)
3777 if (*p ==
',' && p[1] !=
' ' && p[1] !=
'\0')
3782 vector<char>
buf(
i + val_buf.size());
3785 for (p = &val_buf[0]; *p !=
'\0'; p++) {
3787 if (*p ==
',' && p[1] !=
' ' && p[1] !=
'\0')
3798 vector<string>& lines)
3822 string bstr(bptr, eptr);
3825 vector<string> qualLines;
3828 string qualKey, qualVal;
3829 string featKey(fbp->
key);
3830 string featLocation(fbp->
location);
3832 while (! qualParser.
Done()) {
3839 fbp->
quals.push_back(pQual);
3851 if (!
str || *
str ==
'\0')
3864 }
else if (p && p[1] ==
'\0') {
3914 loc =
"1.." + to_string(ibp->
bases);
3915 for (num = 0; dbp; dbp = dbp->
mpNext, num++) {
3922 eptr = bptr + dbp->
len;
3924 for (p = bptr; *p !=
'\n';)
3933 for (ptr1 = bptr; *ptr1 ==
' ';)
3936 for (ptr2 = ptr1; *ptr2 !=
' ' && *ptr2 !=
'\n';)
3945 for (ptr1 = ptr2; *ptr1 ==
' ';)
3947 if (*ptr1 ==
'\n') {
3948 if (ibp->
is_mga ==
false) {
3962 for (ptr2 = ptr1; *ptr2 !=
'/' && ptr2 < eptr;)
3970 for (p = fbp->
location, q = p; *p !=
'\0'; p++)
3971 if (*p !=
' ' && *p !=
'\n')
4002 for (
const auto& cur : fbp->
quals) {
4003 const string& cur_qual = cur->GetQual();
4004 if (cur_qual ==
"gap_type" ||
4005 cur_qual ==
"assembly_evidence") {
4013 for (
const auto& cur : fbp->
quals) {
4014 const string& cur_qual = cur->GetQual();
4015 if (cur_qual ==
"submitter_seqid") {
4043 const char*
str = str1.c_str();
4063 for (
auto& cur : fbp->
quals) {
4064 if (! cur->IsSetQual() || ! cur->IsSetVal())
4067 const string& qual_str = cur->GetQual();
4068 const string& val_str = cur->GetVal();
4070 vector<Char> val_buf(val_str.begin(), val_str.end());
4071 val_buf.push_back(0);
4075 if (*p ==
'\0' && qual_str !=
"replace") {
4079 if (qual_str ==
"replace")
4084 if (qual_str ==
"satellite")
4099 if (! fbp || fbp->
quals.empty())
4102 for (TQualVector::iterator cur = fbp->
quals.begin(); cur != fbp->
quals.end();) {
4103 const string& qual_str = (*cur)->GetQual();
4105 if ((*cur)->IsSetVal()) {
4106 const string& val_str = (*cur)->GetVal();
4107 vector<Char> val_buf(val_str.begin(), val_str.end());
4108 val_buf.push_back(0);
4110 if (qual_str ==
"translation") {
4112 }
else if (qual_str ==
"rpt_unit") {
4114 }
else if (qual_str ==
"cons_splice") {
4116 }
else if (qual_str ==
"note") {
4117 for (p = &val_buf[0];;) {
4125 if (val_buf.size() > 30) {
4136 for (p = &val_buf[0]; *p ==
'\"' || *p ==
' ' || *p ==
'\t';)
4140 if (qual_str ==
"replace") {
4145 (*cur)->SetVal(&val_buf[0]);
4153 if (! (*cur)->IsSetVal()) {
4154 if (qual_str ==
"old_locus_tag")
4159 cur = fbp->
quals.erase(cur);
4162 }
else if ((*cur)->IsSetVal()) {
4168 if ((*cur)->IsSetVal() && qual_str ==
"note") {
4169 string val = (*cur)->GetVal();
4170 std::replace(
val.begin(),
val.end(),
'\"',
'\'');
4171 (*cur)->SetVal(
val);
4188 for (num = 0; dbp; dbp = dbp->
mpNext, num++) {
4195 if (fbp->
key[0] ==
'-' && fbp->
key[1] ==
'\0') {
4224 if (keyindx < 0 && ! deb) {
4233 if (! fbp->
quals.empty()) {
4243 }
else if (fbp->
spindex < 0) {
4258 const char*
str = str1.c_str();
4278 for (
auto& cur : fbp->
quals) {
4279 if (! cur->IsSetQual() || ! cur->IsSetVal())
4282 const string& qual_str = cur->GetQual();
4283 const string& val_str = cur->GetVal();
4285 vector<Char> val_buf(val_str.begin(), val_str.end());
4286 val_buf.push_back(0);
4290 if (*p ==
'\0' && qual_str !=
"replace") {
4294 if (qual_str ==
"replace")
4310 for (
const auto& qual : feat.
GetQual()) {
4311 if (! qual->IsSetQual() || qual->GetQual().empty() ||
4312 qual->GetQual() !=
"ncRNA_class")
4317 if (! qual->IsSetVal() || qual->GetVal().empty()) {
4342 ErrPostEx(
SEV_REJECT,
ERR_FEATURE_ncRNA_class,
"Feature \"ncRNA\" at location \"%s\" %s /ncRNA_class qualifier.", loc.empty() ?
"unknown" : loc.c_str(), (count == 0) ?
"lacks the mandatory" :
"has more than one");
4350 for (
auto qual = feat.
SetQual().begin(); qual != feat.
SetQual().end(); ++qual) {
4351 if (! (*qual)->IsSetQual() || (*qual)->GetQual() !=
"artificial_location")
4354 if ((*qual)->IsSetVal()) {
4355 const Char* p_val = (*qual)->GetVal().c_str();
4356 for (; *p_val ==
'\"';)
4360 (*qual)->ResetVal();
4363 string val = (*qual)->IsSetVal() ? (*qual)->GetVal() :
"";
4365 if (
val ==
"heterogenous population sequenced" ||
4366 val ==
"low-quality sequence region") {
4373 except_text +=
", ";
4394 for (
const auto& qual : feat.
GetQual()) {
4395 if (qual->IsSetQual() && qual->GetQual() ==
"mobile_element_type" &&
4396 qual->IsSetVal() && ! qual->GetVal().empty()) {
4397 const Char* p_val = qual->GetVal().c_str();
4398 for (; *p_val ==
'\"';)
4401 if (*p_val !=
'\0') {
4438 if (! fbp1->
key && fbp2->
key)
4440 if (fbp1->
key && ! fbp2->
key)
4442 if (fbp1->
key && fbp2->
key) {
4460 return fbp1->
num < fbp2->
num;
4470 vector<DataBlk*> temp;
4471 temp.reserve(total);
4473 temp.push_back(tdbp);
4478 for (
size_t i = 0;
i < total - 1; tdbp = tdbp->
mpNext,
i++)
4481 temp[total - 1]->
mpNext =
nullptr;
4488 if (! fbp || ! fbp->
key || ! rclass)
4496 qual->
SetQual(
"regulatory_class");
4498 fbp->
quals.push_back(qual);
4512 for (; dbp; dbp = dbp->
mpNext) {
4514 if (! fbp || ! fbp->
key)
4543 other_class =
false;
4546 for (
const auto& cur : fbp->
quals) {
4547 if (! cur->IsSetQual() || ! cur->IsSetVal())
4550 const string& qual_str = cur->GetQual();
4552 if (qual_str !=
"regulatory_class") {
4553 if (qual_str ==
"note")
4559 if (! cur->IsSetVal() || cur->GetVal().empty()) {
4562 p = (
char*)
"(empty)";
4577 const string& val_str = cur->GetVal();
4584 if (val_str ==
"other")
4591 p = (
char*)
"(empty)";
4608 p = (
char*)
"(empty)";
4620 }
else if (count > 1) {
4623 p = (
char*)
"(empty)";
4637 if (other_class && ! got_note) {
4640 p = (
char*)
"(empty)";
4658 const string& submitter_seqid,
4663 if (seqtype == 0 || seqtype == 1 || seqtype == 7)
4665 else if (seqtype == 4 || seqtype == 5 || seqtype == 8 || seqtype == 9)
4673 tag.SetTag().SetStr(submitter_seqid);
4675 bioseq.
SetId().push_back(gen_id);
4695 if (seqtype == 0 || seqtype == 3 || seqtype == 4 || seqtype == 6 ||
4696 seqtype == 10 || seqtype == 12) {
4702 if (seqtype == 1 || seqtype == 5 || seqtype == 7 || seqtype == 8 ||
4703 seqtype == 9 || seqtype == 11) {
4715 if (tbp->
str[0] ==
'-')
4729 if (seqtype == 0 || seqtype == 1 || seqtype == 4 || seqtype == 5 ||
4730 seqtype == 7 || seqtype == 8 || seqtype == 9 || seqtype == 10 ||
4749 CDelta_ext::Tdata::iterator
delta;
4754 if (! (*delta)->IsLoc())
4757 const CSeq_loc& locs = (*delta)->GetLoc();
4792 if (seqtype == 0 || seqtype == 1 || seqtype == 4 || seqtype == 5 ||
4793 seqtype == 7 || seqtype == 8 || seqtype == 9 || seqtype == 10 ||
4865 ids.push_back(seq_id);
4888 for (dbp = dab; dbp; dbp = dbp->
mpNext) {
4905 for (
i = 0; tdbp;
i++, tdbp = tdbp->
mpNext)
4929 if (seq_feats.empty()) {
4931 for (; dab; dab = dabnext) {
4945 for (CSeq_descr::Tdata::iterator descr = descr_list.begin(); descr != descr_list.end();) {
4946 if (! (*descr)->IsSource()) {
4951 descr = descr_list.erase(descr);
4955 descr_src->
SetSource(seq_feats.front()->SetData().SetBiosrc());
4957 descr_list.push_back(descr_src);
4958 seq_feats.pop_front();
4962 for (; dab; dab = dabnext) {
4971 if (dbp->
mDrop ==
true)
5009 if (imp_feat.
GetKey() ==
"intron" ||
5010 imp_feat.
GetKey() ==
"exon") {
5026 seq_feats.push_back(feat);
5036 "Mixed strands in SeqLoc of /trans_splicing feature: %s",
5042 seq_feats.push_back(feat);
5058 for (
auto& feat : seq_feats) {
5059 if (! feat->GetData().IsImp())
5062 const CImp_feat& imp_feat = feat->GetData().GetImp();
5082 SeqFeatPub(pp, entry, seq_feats, ids, col_data, ibp);
5083 if (seq_feats.empty() && ibp->
drop) {
5090 ImpFeatPub(pp, entry, seq_feats, *seq_id, col_data, ibp);
5093 if (seq_feats.empty())
5097 annot->
SetData().SetFtable().swap(seq_feats);
5099 bioseq.
SetAnnot().push_back(annot);
5109 if (! p || (tRNA && tRNA < p))
5111 if (! p || (rRNA && rRNA < p))
5113 if (! p || (snRNA && snRNA < p))
5115 if (! p || (scRNA && scRNA < p))
5117 if (! p || (uRNA && uRNA < p))
5119 if (! p || (snoRNA && snoRNA < p))
5128 if (p == snRNA || p == uRNA)
5151 char* mRNA =
nullptr;
5152 char* tRNA =
nullptr;
5153 char* rRNA =
nullptr;
5154 char* snRNA =
nullptr;
5155 char* scRNA =
nullptr;
5156 char* uRNA =
nullptr;
5157 char* snoRNA =
nullptr;
5194 while (*
r !=
';' && *
r !=
'\n' && *
r !=
'\0')
5197 while (*
r !=
';' && *
r !=
' ' && *
r !=
'\t' && *
r !=
'\n' &&
5200 if (
r - molstr > 10)
5211 if (ibp->
moltype ==
"genomic DNA") {
5221 }
else if (ibp->
moltype ==
"genomic RNA") {
5230 }
else if (ibp->
moltype ==
"mRNA") {
5239 }
else if (ibp->
moltype ==
"tRNA") {
5248 }
else if (ibp->
moltype ==
"rRNA") {
5257 }
else if (ibp->
moltype ==
"snoRNA") {
5266 }
else if (ibp->
moltype ==
"snRNA") {