60 #define THIS_FILE "utilfeat.cpp"
104 if (loc_str.find(
'<') == string::npos && loc_str.find(
'>') == string::npos)
122 for (
const auto& cur : qlist) {
123 if (cur->GetQual() != qual)
126 const string&
val = cur->GetVal();
149 optional<string> qvalue;
151 for (TQualVector::iterator cur = qlist.begin(); cur != qlist.end(); ++cur) {
152 if ((*cur)->GetQual() != qual)
155 const string&
val = (*cur)->GetVal();
183 for (TQualVector::iterator cur = qlist.begin(); cur != qlist.end();) {
184 if ((*cur)->GetQual() != qual) {
189 cur = qlist.erase(cur);
213 for (
str += 3; *
str ==
' ';)
215 for (p =
str; (*p >=
'a' && *p <=
'z') || (*p >=
'A' && *p <=
'Z');)
258 for (
const auto& descr : descrs) {
259 if (! descr->IsSource() || ! descr->GetSource().IsSetOrg() ||
260 ! descr->GetSource().GetOrg().IsSetTaxname())
263 const COrg_ref& org_ref = descr->GetSource().GetOrg();
268 if (!
mod->IsSetSubname() || !
mod->IsSetSubtype())
286 if (descr->GetSource().IsSetSubtype()) {
287 for (
const auto& subtype : descr->GetSource().GetSubtype()) {
292 const Char* p =
StringIStr(subtype->GetName().c_str(),
"common:");
296 for (p += 7; *p ==
' ';)
317 for (
auto& entry : seq_entries) {
319 if (bio_set->IsSetDescr())
324 if (bioseq->IsSetDescr())
333 for (
auto& descr : descrs) {
334 if (! descr->IsGenbank())
337 if (! descr->GetGenbank().IsSetSource())
340 CGB_block& gb_block = descr->SetGenbank();
342 char* pper =
nullptr;
345 if (p[
len - 1] ==
'.') {
356 for (q++; *q ==
' ';)
363 vector<string>::const_iterator name =
names.begin();
364 for (name += 2; name !=
names.end(); ++name) {
386 for (
t = s +
len + 1; *
t ==
' ';)
407 const string& first_name =
names[0];
408 const string& second_name =
names[1];
426 for (
auto& entry : seq_entries) {
428 if (bioseq->IsSetDescr())
437 vector<string>
names;
450 const static Char STR_TO_REPLACE[] =
"minus";
463 size_t pos =
str.find(STR_TO_REPLACE);
464 while (pos != string::npos) {
465 str.replace(pos,
sizeof(STR_TO_REPLACE) - 1,
"c");
466 pos =
str.find(STR_TO_REPLACE);
477 return loc_str.substr(0, 50);
string tata_save(string_view t)
static char ValidAminoAcid(string_view abbrev)
Template class for iteration on objects of class C.
#define ERR_QUALIFIER_AntiCodonLacksSequence
#define ERR_FEATURE_UnknownQualSpelling
list< CRef< objects::CSeq_entry > > TEntryList
std::list< CRef< objects::CSeqdesc > > TSeqdescList
bool StringEquNI(const char *s1, const char *s2, size_t n)
bool StringEquN(const char *s1, const char *s2, size_t n)
size_t StringLen(const char *s)
static const struct name_t names[]
static DLIST_TYPE *DLIST_NAME() last(DLIST_LIST_TYPE *list)
static const char * str(char *buf, int n)
void GetLabel(string *label) const
Appends a label suitable for display (e.g., error messages) label must point to an existing string ob...
CBeginInfo Begin(C &obj)
Get starting point of object hierarchy.
uint8_t Uint1
1-byte (8-bit) unsigned integer
int32_t Int4
4-byte (32-bit) signed integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static int CompareNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive compare of a substring with another string.
static string Sanitize(CTempString str, TSS_Flags flags=fSS_print)
Sanitize a string, allowing only specified classes of characters.
void ResetSource(void)
Reset Source data member.
const TSource & GetSource(void) const
Get the Source member data.
void SetGenome(TGenome value)
Assign a value to Genome data member.
const TMod & GetMod(void) const
Get the Mod member data.
bool IsSetCommon(void) const
common name Check if a value has been assigned to Common data member.
const TTaxname & GetTaxname(void) const
Get the Taxname member data.
const TCommon & GetCommon(void) const
Get the Common member data.
bool IsSetMod(void) const
Check if a value has been assigned to Mod data member.
bool IsSetOrgname(void) const
Check if a value has been assigned to Orgname data member.
const TOrgname & GetOrgname(void) const
Get the Orgname member data.
@ eSubtype_gb_acronym
used by taxonomy database
@ eSubtype_gb_synonym
used by taxonomy database
@ eSubtype_gb_anamorph
used by taxonomy database
constexpr bool empty(list< Ts... >) noexcept
bool DeleteQual(TQualVector &qlist, const Char *qual)
const char * ParFlat_GImod[]
Uint1 GetQualValueAa(const char *qval, bool checkseq)
string location_to_string(const CSeq_loc &loc)
static void CheckDelGbblockSourceFromDescrs(TSeqdescList &descrs, const vector< string > &names)
static void GetTaxnameNameFromDescrs(const TSeqdescList &descrs, vector< string > &names)
string CpTheQualValue(const TQualVector &qlist, const Char *qual)
bool GetGenomeInfo(CBioSource &bsp, string_view bptr)
static void GetTaxnameName(TEntryList &seq_entries, vector< string > &names)
bool SeqLocHaveFuzz(const CSeq_loc &loc)
const char * valid_organelle[]
void MaybeCutGbblockSource(TEntryList &seq_entries)
void MakeLocStrCompatible(string &str)
optional< string > GetTheQualValue(TQualVector &qlist, const Char *qual)
static void CheckDelGbblockSource(TEntryList &seq_entries, const vector< string > &names)
Int2 StringMatchIcase(const Char **array, string_view text)
void fta_StringCpy(char *dst, const char *src)
Char * StringIStr(const Char *where, const Char *what)
std::vector< CRef< objects::CGb_qual > > TQualVector