(
void)
const= 0;
172 function<
bool(
const CSeqdesc&)> f_verify,
176 function<
bool(
const CSeqdesc&)> f_verify,
199m_fReportError(fReportError),
200m_SkippedMods(skipped_mods)
217 static constunordered_map<string,TMemFuncPtr>
234 autoit = s_MethodMap.find(mod_name);
235 if(it != s_MethodMap.end()) {
236 automem_func_ptr = it->second;
237(this->*mem_func_ptr)(mod_entry);
248 if(name ==
"location") {
252 if(it == s_GenomeStringToEnum.end()) {
260 if(name ==
"origin") {
264 if(it == s_OriginStringToEnum.end()) {
272 if(name ==
"focus") {
313 for(
const auto&
mod: mod_entry.second) {
314 const auto&
value=
mod.GetValue();
321 if(
mod.IsSetAttrib()) {
322pSubSource->SetAttrib(
mod.GetAttrib());
324 m_pDescrCache->SetSubtype().push_back(std::move(pSubSource));
331 const autoset_size = primer_set.
Get().size();
332vector<string>
names;
334 const autonum_names =
names.size();
336 autoit = primer_set.
Set().begin();
337 for(
size_t i=0;
i<num_names; ++
i) {
342(*it)->SetName().Set(
names[
i]);
347pPrimer->SetName().Set(
names[
i]);
348primer_set.
Set().push_back(std::move(pPrimer));
356 const autoset_size = primer_set.
Get().size();
359 const autonum_seqs = seqs.size();
361 autoit = primer_set.
Set().begin();
362 for(
size_t i=0;
i<num_seqs; ++
i) {
367(*it)->SetSeq().Set(seqs[
i]);
372pPrimer->SetSeq().Set(seqs[
i]);
373primer_set.
Set().push_back(std::move(pPrimer));
381vector<string>
names;
383reaction_names.insert(reaction_names.end(),
names.begin(),
names.end());
391 if(seqs.size() > 1) {
392 if(seqs.front().front() ==
'(') {
393seqs.front().erase(0,1);
395 if(seqs.back().back() ==
')') {
396seqs.back().erase(seqs.back().size()-1,1);
400 for(
auto& seq : seqs) {
411 if(mod_name ==
"fwd-primer-name") {
412vector<string>
names;
413 for(
const auto&
mod: mod_entry.second)
419 autoit = pcr_reaction_set.Set().begin();
420 for(
const auto& reaction_names :
names) {
421 if(it == pcr_reaction_set.Set().end()) {
424pcr_reaction_set.Set().push_back(std::move(pPCRReaction));
434 if(mod_name ==
"fwd-primer-seq") {
436 for(
const auto&
mod: mod_entry.second)
441 autoit = pcr_reaction_set.Set().begin();
442 for(
const auto& reaction_seqs : seqs) {
443 if(it == pcr_reaction_set.Set().end()) {
446pcr_reaction_set.Set().push_back(std::move(pPCRReaction));
456 if(mod_name ==
"rev-primer-name")
458vector<string>
names;
459 for(
const auto&
mod: mod_entry.second) {
462 if(!
names.empty()) {
464 const size_tnum_reactions = pcr_reaction_set.Get().size();
465 const size_tnum_names =
names.size();
466 if(num_names <= num_reactions) {
467 autoit = pcr_reaction_set.Set().rbegin();
468 for(
int i=num_names-1;
i>=0; --
i) {
473 autoit = pcr_reaction_set.Set().begin();
474 for(
size_t i=0;
i<num_reactions; ++
i) {
478 for(
auto i=num_reactions;
i<num_names; ++
i) {
481pcr_reaction_set.Set().push_back(std::move(pPCRReaction));
489 if(mod_name ==
"rev-primer-seq")
492 for(
const auto&
mod: mod_entry.second) {
497 const size_tnum_reactions = pcr_reaction_set.Get().size();
498 const size_tnum_seqs = seqs.size();
499 if(num_seqs <= num_reactions) {
500 autoit = pcr_reaction_set.Set().rbegin();
501 for(
int i=num_seqs-1;
i>=0; --
i) {
505 autoit = pcr_reaction_set.Set().begin();
506 for(
size_t i=0;
i<num_reactions; ++
i) {
510 for(
auto i=num_reactions;
i<num_seqs; ++
i) {
513pcr_reaction_set.Set().push_back(std::move(pPCRReaction));
527 if(name ==
"taxname") {
530 if(!preserve_taxid &&
538 if(name ==
"taxid") {
542taxid = NStr::StringToNumeric<TTaxId>(
value);
549preserve_taxid =
true;
554 if(name ==
"common") {
560 if(name ==
"dbxref") {
574vector<CRef<CDbtag>> dbtags;
575 for(
const auto& value_attrib : mod_entry.second) {
576 const auto&
value= value_attrib.GetValue();
578 autocolon_pos =
value.find(
":");
581 if(colon_pos < (
value.length()-1)) {
591pDbtag->SetTag().SetStr(
tag);
592dbtags.push_back(std::move(pDbtag));
602 if(name ==
"lineage") {
608 if(name ==
"division") {
616 usingTFunction =
function<void(
COrgName&,
int)>;
618unordered_map<string, TFunction>
619s_GetCodeSetterMethods =
624 autoit = s_GetCodeSetterMethods.find(name);
625 if(it != s_GetCodeSetterMethods.end()) {
653 for(
const auto&
mod: mod_entry.second) {
656 if(
mod.IsSetAttrib()) {
657pOrgMod->SetAttrib(
mod.GetAttrib());
667 static constunordered_map<string, string> s_NameToLabel =
668{{
"sra",
"Sequence Read Archive"},
669{
"biosample",
"BioSample"},
670{
"bioproject",
"BioProject"}};
672 const auto&
label= s_NameToLabel.at(name);
682list<CTempString> value_list;
683 for(
const auto&
mod: mod_entry.second) {
684list<CTempString> value_sublist;
685 const auto& vals =
mod.GetValue();
687value_list.splice(value_list.end(), value_sublist);
690 if(value_list.empty()) {
698 constlist<CTempString>& vals,
707 for(
autopUserField : dblink.
SetData()) {
709pUserField->IsSetLabel() &&
710pUserField->GetLabel().IsStr() &&
721dblink.
SetData().push_back(pField);
724pField->
SetData().SetStrs().assign(vals.begin(), vals.end());
767 for(
const auto&
mod: mod_entry.second) {
768vals.push_back(
mod.GetValue());
771 string label= (mod_entry.first ==
"ft-map") ?
773 "BaseModification-FileTrackURL";
775 for(
auto val: vals) {
778pField->SetLabel().SetStr(
label);
780pField->SetData().SetStr(
val);
781user.SetData().push_back(pField);
788list<CStringUTF8> accession_list;
789 for(
const auto&
mod: mod_entry.second) {
790list<CTempString> value_sublist;
791 const auto& vals =
mod.GetValue();
794list<CStringUTF8> accession_sublist;
796 transform(value_sublist.begin(), value_sublist.end(), back_inserter(accession_sublist),
803accession_list.splice(accession_list.end(), accession_sublist);
806 if(accession_list.empty()) {
810 automake_user_field = [](
const CStringUTF8& accession) {
812pField->SetLabel().SetId(0);
814pSubfield->SetLabel().SetStr(
"accession");
815pSubfield->SetData().SetStr(accession);
816pField->SetData().SetFields().push_back(std::move(pSubfield));
821user.SetData().resize(accession_list.size());
822 transform(accession_list.begin(), accession_list.end(),
823user.SetData().begin(), make_user_field);
829list<string> id_list;
830 for(
const auto&
mod: mod_entry.second) {
831list<CTempString> value_sublist;
832 const auto& vals =
mod.GetValue();
834 for(
const auto&
val: value_sublist) {
838id_list.insert(id_list.end(),idrange.
begin(), idrange.
end());
842id_list.push_back(
value);
847gb_block.SetExtra_accessions().assign(id_list.begin(), id_list.end());
853list<CTempString> value_list;
854 for(
const auto&
mod: mod_entry.second) {
855list<CTempString> value_sublist;
856 const auto& vals =
mod.GetValue();
858value_list.splice(value_list.end(), value_sublist);
860 if(value_list.empty()) {
863 m_pDescrCache->SetGBblock().SetKeywords().assign(value_list.begin(), value_list.end());
872 for(
const auto&
mod: mod_entry.second) {
873list<CTempString> value_sublist;
874 const auto& vals =
mod.GetValue();
876list<int> id_sublist;
878 transform(value_sublist.begin(), value_sublist.end(), back_inserter(id_sublist),
885id_list.splice(id_list.end(), id_sublist);
887 if(id_list.empty()) {
891 automake_user_field = [](
const int& id) {
894pField->SetLabel().SetId(0);
895pSubfield->SetLabel().SetStr(
"ProjectID");
896pSubfield->SetData().SetInt(
id);
897pField->SetData().SetFields().push_back(pSubfield);
899pSubfield->SetLabel().SetStr(
"ParentID");
900pSubfield->SetData().SetInt(0);
901pField->SetData().SetFields().push_back(pSubfield);
906user.SetData().resize(id_list.size());
907 transform(id_list.begin(), id_list.end(),
908user.SetData().begin(), make_user_field);
914 for(
const auto&
mod: mod_entry.second) {
923 for(
const auto&
mod: mod_entry.second)
925 const auto&
value=
mod.GetValue();
928pmid = NStr::StringToNumeric<TEntrezId>(
value);
934 autopPub =
Ref(
new CPub());
935pPub->SetPmid().Set(pmid);
939.push_back(std::move(pPub));
957 const string& add_msg)
959 const auto& mod_name = mod_data.
GetName();
960 const auto& mod_value = mod_data.
GetValue();
961 string msg=
"Invalid value: "+ mod_name +
"="+ mod_value +
".";
963 msg+=
" "+ add_msg;
984 template<
classTObject>
1010pParentSet->IsSetClass() &&
1013 auto& bioseq_set =
const_cast<CBioseq_set&
>(*pParentSet);
1036!pDesc->
IsPub()) {
1040 auto& pub_desc = pDesc->
SetPub();
1041pub_desc.
SetPub().Set().remove_if([](
const CRef<CPub>& pPub) {
return(pPub && pPub->
IsPmid()); });
1042 returnpub_desc.GetPub().Get().empty();
1059 returnpDesc->SetPub();
1076 returnpDesc->SetComment();
1148pDesc->SetGenbank();
1163pDesc->SetMolinfo();
1220 function<
bool(
const CSeqdesc&)> f_verify,
1228 function<
bool(
const CSeqdesc&)> f_verify,
1232 autoit =
m_Cache.find(eChoice);
1234 return*(it->second);
1239 if(pDescrContainer->
IsSet()) {
1240 for(
auto& pDesc : pDescrContainer->
SetDescr().
Set()) {
1241 if(pDesc.NotEmpty() && f_verify(*pDesc)) {
1242 m_Cache.insert(make_pair(eChoice, pDesc));
1248 autopDesc = f_create();
1249 m_Cache.insert(make_pair(eChoice, pDesc));
1250pDescrContainer->
SetDescr().
Set().push_back(pDesc);
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
void transform(Container &c, UnaryFunction *op)
CConstRef< CBioseq_set > GetParentSet(void) const
CPCRReactionSet * m_pPCRReactionSet
CBioSource::TSubtype TSubtype
SDescrContainer_Base TDescrContainer
unique_ptr< TDescrContainer > m_pNucProtSetContainer
void x_SetUserType(const string &type, CUser_object &user_object)
CUser_object & SetFileTrack(void)
unordered_map< EChoice, CRef< CSeqdesc >, hash< underlying_type< EChoice >::type > > TMap
CPCRReactionSet & SetPCR_primers(void)
CDescrCache(CBioseq &bioseq)
CGB_block & SetGBblock(void)
CSeqdesc & x_SetDescriptor(const EChoice eChoice, function< bool(const CSeqdesc &)> f_verify, function< CRef< CSeqdesc >(void)> f_create)
unique_ptr< TDescrContainer > m_pBioseqContainer
CMolInfo & SetMolInfo(void)
TDescrContainer * m_pPrimaryContainer
CUser_object & SetDBLink(void)
CBioSource & SetBioSource(void)
CPubdesc & SetPubdesc(void)
CUser_object & SetGenomeProjects(void)
string & SetComment(void)
CUser_object & SetTpaAssembly(void)
TSubtype & SetSubtype(void)
TOrgMods & SetOrgMods(void)
CDescrContainer(TObject &object)
CSeq_descr & SetDescr(void)
void x_SetMolInfoType(const TModEntry &mod_entry)
void x_SetOrgMod(const TModEntry &mod_entry)
CDescrModApply(CBioseq &bioseq, FReportError fReportError, TSkippedMods &skipped_mods)
void x_SetMolInfoCompleteness(const TModEntry &mod_entry)
bool x_TryBioSourceMod(const TModEntry &mod_entry, bool &preserve_taxid)
bool x_TryOrgNameMod(const TModEntry &mod_entry)
virtual ~CDescrModApply()
bool x_TryOrgRefMod(const TModEntry &mod_entry, bool &preserve_taxid)
TSkippedMods & m_SkippedMods
void x_SetTpaAssembly(const TModEntry &mod_entry)
bool x_TryPCRPrimerMod(const TModEntry &mod_entry)
CModAdder::FReportError FReportError
void x_SetFileTrack(const TModEntry &mod_entry)
CModAdder::TSkippedMods TSkippedMods
void x_SetPMID(const TModEntry &mod_entry)
void x_SetComment(const TModEntry &mod_entry)
CModHandler::TMods::value_type TModEntry
void x_SetGBblockKeywords(const TModEntry &mod_entry)
void x_SetGBblockIds(const TModEntry &mod_entry)
static const string & x_GetModValue(const TModEntry &mod_entry)
void x_SetDBLink(const TModEntry &mod_entry)
FReportError m_fReportError
unique_ptr< CDescrCache > m_pDescrCache
void x_SetDBLinkFieldVals(const string &label, const list< CTempString > &vals, CUser_object &db_link)
void x_SetDBLinkField(const string &label, const TModEntry &mod_entry, CDescrCache &descr_cache)
void x_SetDBxref(const TModEntry &mod_entry)
static const string & x_GetModName(const TModEntry &mod_entry)
void x_SetMolInfoTech(const TModEntry &mod_entry)
void x_ReportInvalidValue(const CModData &mod_data, const string &add_msg="")
void x_SetSubtype(const TModEntry &mod_entry)
bool Apply(const TModEntry &mod_entry)
void x_SetGenomeProjects(const TModEntry &mod_entry)
const string & GetValue(void) const
const string & GetName(void) const
static const string & GetCanonicalName(const TModEntry &mod_entry)
static const string & AssertReturnSingleValue(const TModEntry &mod_entry)
@OrgMod.hpp User-defined methods of the data storage class.
@Pubdesc.hpp User-defined methods of the data storage class.
@Seq_descr.hpp User-defined methods of the data storage class.
static bool NeedsNoText(const TSubtype &subtype)
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
Include a standard set of the NCBI C++ Toolkit most basic headers.
static const auto s_OrgModStringToEnum
static const unordered_map< string, CMolInfo::TTech > s_TechStringToEnum
static bool s_EmptyAfterRemovingPMID(CRef< CSeqdesc > &pDesc)
static const auto s_SubSourceStringToEnum
static void s_SetPrimerNames(const string &primer_names, CPCRPrimerSet &primer_set)
static const unordered_map< string, CMolInfo::TCompleteness > s_CompletenessStringToEnum
static bool s_IsUserType(const CUser_object &user_object, const string &type)
static void s_AppendPrimerNames(const string &mod, vector< string > &reaction_names)
static void s_AppendPrimerSeqs(const string &mod, vector< string > &reaction_seqs)
static void s_SetPrimerSeqs(const string &primer_seqs, CPCRPrimerSet &primer_set)
static const struct name_t names[]
SStrictId_Entrez::TId TEntrezId
TEntrezId type for entrez ids which require the same strictness as TGi.
SStrictId_Tax::TId TTaxId
Taxon id type.
@ eDiag_Error
Error message.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
const_iterator end(void) const
const_iterator begin(void) const
CRef< C > Ref(C *object)
Helper functions to get CRef<> and CConstRef<> objects.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define BEGIN_SCOPE(ns)
Define a new scope.
static CTempString TruncateSpaces_Unsafe(const CTempString str, ETrunc where=eTrunc_Both)
Truncate whitespace in a string.
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 bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
static CStringUTF8 AsUTF8(const CTempString &src, EEncoding encoding, EValidate validate=eNoValidate)
Convert into UTF8 from a C/C++ string.
static unsigned int StringToUInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to unsigned int.
static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another string.
static string & ToLower(string &str)
Convert string to lower case â string& version.
@ fSplit_Tokenize
All delimiters are merged and trimmed, to get non-empty tokens only.
static const char label[]
const Tdata & Get(void) const
Get the member data.
list< CRef< CSubSource > > TSubtype
void SetPcr_primers(TPcr_primers &value)
Assign a value to Pcr_primers data member.
void SetOrg(TOrg &value)
Assign a value to Org data member.
Tdata & Set(void)
Assign a value to data member.
TSubtype & SetSubtype(void)
Assign a value to Subtype data member.
bool IsSetData(void) const
the object itself Check if a value has been assigned to Data data member.
bool IsStr(void) const
Check if variant Str is selected.
bool IsSetType(void) const
type of object within class Check if a value has been assigned to Type data member.
TData & SetData(void)
Assign a value to Data data member.
const TStr & GetStr(void) const
Get the variant data.
void SetLabel(TLabel &value)
Assign a value to Label data member.
void SetType(TType &value)
Assign a value to Type data member.
void SetData(TData &value)
Assign a value to Data data member.
const TType & GetType(void) const
Get the Type member data.
TMgcode & SetMgcode(void)
Assign a value to Mgcode data member.
TPgcode & SetPgcode(void)
Assign a value to Pgcode data member.
list< CRef< COrgMod > > TMod
TGcode & SetGcode(void)
Assign a value to Gcode data member.
bool IsPmid(void) const
Check if variant Pmid is selected.
@ eClass_nuc_prot
nuc acid and coded proteins
bool IsGenbank(void) const
Check if variant Genbank is selected.
const TUser & GetUser(void) const
Get the variant data.
bool IsMolinfo(void) const
Check if variant Molinfo is selected.
void SetPub(TPub &value)
Assign a value to Pub data member.
TPub & SetPub(void)
Select the variant.
bool IsComment(void) const
Check if variant Comment is selected.
bool IsSource(void) const
Check if variant Source is selected.
bool IsPub(void) const
Check if variant Pub is selected.
Tdata & Set(void)
Assign a value to data member.
bool IsUser(void) const
Check if variant User is selected.
@ eCompleteness_has_left
5' or NH3 end present
@ eCompleteness_complete
complete biological entity
@ eCompleteness_has_right
3' or COOH end present
@ eCompleteness_no_left
missing 5' or NH3 end
@ eCompleteness_partial
partial but no details given
@ eCompleteness_no_right
missing 3' or COOH end
@ eCompleteness_no_ends
missing both ends
@ eTech_htgs_2
ordered High Throughput sequence contig
@ eTech_physmap
from physical mapping techniques
@ eTech_htc
high throughput cDNA
@ eTech_both
concept transl. w/ partial pept. seq.
@ eTech_targeted
targeted locus sets/studies
@ eTech_seq_pept_homol
sequenced peptide, ordered by homology
@ eTech_composite_wgs_htgs
composite of WGS and HTGS
@ eTech_sts
Sequence Tagged Site.
@ eTech_htgs_3
finished High Throughput sequence
@ eTech_seq_pept_overlap
sequenced peptide, ordered by overlap
@ eTech_htgs_1
unordered High Throughput sequence contig
@ eTech_concept_trans
conceptual translation
@ eTech_tsa
transcriptome shotgun assembly
@ eTech_standard
standard sequencing
@ eTech_wgs
whole genome shotgun sequencing
@ eTech_seq_pept
peptide was sequenced
@ eTech_survey
one-pass genomic sequence
@ eTech_barcode
barcode of life project
@ eTech_htgs_0
single genomic reads for coordination
@ eTech_derived
derived from other data, not a primary entity
@ eTech_fli_cdna
full length insert cDNA
@ eTech_est
Expressed Sequence Tag.
@ eTech_concept_trans_a
conceptual transl. supplied by author
@ eTech_genemap
from genetic mapping techniques
unsigned int
A callback function used to compare two keys in a database.
use only n Cassandra database for the lookups</td > n</tr > n< tr > n< td > yes</td > n< td > do not use tables BIOSEQ_INFO and BLOB_PROP in the Cassandra database
const TStringToEnumMap< CMolInfo::TBiomol > g_BiomolStringToEnum
TStringToEnumMap< CSubSource::ESubtype > g_InitModNameSubSrcSubtypeMap(void)
TStringToEnumMap< COrgMod::ESubtype > g_InitModNameOrgSubtypeMap(void)
string g_GetNormalizedModVal(const string &unnormalized)
TStringToEnumMap< CBioSource::EGenome > g_InitModNameGenomeMap(void)
TStringToEnumMap< CBioSource::EOrigin > g_InitModNameOriginMap(void)
const GenericPointer< typename T::ValueType > T2 value
@ eModSubcode_InvalidValue
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
virtual ~SDescrContainer_Base(void)=default
virtual bool IsSet(void) const =0
virtual CSeq_descr & SetDescr(void)=0
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4