78 bool scoreIsValid,
double score,
81 const vector<pair<string, string>>&
attributes)
94 mpScore.reset(
new double(score));
111 const vector<pair<string, string>>&
attributes)
114 vector<string> alwaysIgnored = {
120 vector<string> sometimesIgnored = {
125 auto key = keyValuePair.first;
126 auto value = keyValuePair.second;
128 auto itAI = find(alwaysIgnored.begin(), alwaysIgnored.end(),
key);
129 if (itAI != alwaysIgnored.end()) {
137 if (
key ==
"Parent") {
160 auto itCI = find(sometimesIgnored.begin(), sometimesIgnored.end(),
key);
161 if (itCI != sometimesIgnored.end()) {
176 if (
key !=
"Dbxref") {
179 vector<string> dbxRefs;
182 for (
auto dbxRef: dbxRefs) {
216 if (!data.IsGene()) {
220 auto& geneRef = data.SetGene();
222 geneRef.SetLocus(
value);
225 if (
key ==
"locus_tag") {
226 geneRef.SetLocus_tag(
value);
229 if (
key ==
"gene_synonym") {
230 vector<string> synonyms;
232 for (
auto synonym: synonyms) {
233 geneRef.SetSyn().push_back(synonym);
248 if (!data.IsCdregion()) {
251 auto& cdsRef = data.SetCdregion();
253 if (
key ==
"transl_except") {
254 vector<string> codeBreaks;
256 for (
auto codeBreakStr: codeBreaks) {
261 cdsRef.SetCode_break().push_back(pCodeBreak);
267 if (
key ==
"transl_table") {
270 cdsRef.SetCode().Set().push_back(pCe);
287 auto& rnaRef = data.SetRna();
289 if (
key ==
"ncrna_class") {
290 rnaRef.SetExt().SetGen().SetClass(
value);
304 vector<string> multiValueAttrs = {
305 "ec_number",
"function",
"go_process",
"inference"
307 auto attrIt = find(multiValueAttrs.begin(), multiValueAttrs.end(),
key);
308 if (attrIt == multiValueAttrs.end()) {
311 vector<string> allValues;
313 for (
auto singleValue: allValues) {
325 out <<
"CGff3ImportData:\n";
User-defined methods of the data storage class.
User-defined methods of the data storage class.
static const struct attribute attributes[]
const CIdResolver & mIdResolver
bool xInitializeDataGene(const std::string &, const std::string &)
CRef< CSeq_feat > GetData() const
virtual void Serialize(CNcbiOstream &) override
void xInitializeAttributes(const std::vector< std::pair< std::string, std::string >> &)
void Initialize(const std::string &, const std::string &, const std::string &, TSeqPos, TSeqPos, bool, double, ENa_strand, const std::string &, const std::vector< std::pair< std::string, std::string >> &)
bool xInitializeDataRna(const std::string &, const std::string &)
CGff3ImportData(const CIdResolver &, CImportMessageHandler &)
bool xInitializeDataCds(const std::string &, const std::string &)
unique_ptr< double > mpScore
bool xInitializeComment(const std::string &, const std::string &)
bool xInitializeMultiValue(const std::string &, const std::string &)
bool xInitializeDbxref(const std::string &, const std::string &)
ESubtype GetSubtype(void) const
namespace ncbi::objects::
void AddOrReplaceQualifier(const string &qual_name, const string &qual_val)
Add a qualifier to this feature, or replace the value for the first one if it already exists.
void AddQualifier(const string &qual_name, const string &qual_val)
Add a qualifier to this feature.
static bool SoTypeToFeature(const string &, CSeq_feat &, bool=false)
static CRef< CCode_break > MakeCodeBreak(const CSeq_id &, const std::string &)
static CCdregion::TFrame PhaseToFrame(const std::string &)
std::ofstream out("events_result.xml")
main entry point for tests
unsigned int TSeqPos
Type for sequence locations and lengths.
const CSeq_id * GetId(void) const
Get the id of the location return NULL if has multiple ids or no id at all.
void Reset(void)
Reset reference object.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
static int StringToInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to int.
static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)
Split a string using specified delimiters.
static string URLDecode(const CTempString str, EUrlDecode flag=eUrlDec_All)
URL-decode string.
static bool SplitInTwo(const CTempString str, const CTempString delim, string &str1, string &str2, TSplitFlags flags=0)
Split a string into two pieces using the specified delimiters.
void SetTag(TTag &value)
Assign a value to Tag data member.
void SetDb(const TDb &value)
Assign a value to Db data member.
TDbxref & SetDbxref(void)
Assign a value to Dbxref data member.
void SetLocation(TLocation &value)
Assign a value to Location data member.
void SetComment(const TComment &value)
Assign a value to Comment data member.
const TLocation & GetLocation(void) const
Get the Location member data.
const TData & GetData(void) const
Get the Data member data.
void SetData(TData &value)
Assign a value to Data data member.
ENa_strand
strand of nucleic acid
const struct ncbi::grid::netcache::search::fields::KEY key
const CharType(& source)[N]
Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...