CFixSuspectProductName::CFixSuspectProductName()
60CFixSuspectProductName::~CFixSuspectProductName()
64 voidCFixSuspectProductName::SetRulesFilename(
const string& filename)
66m_filename = filename;
69 voidCFixSuspectProductName::SetupOutput(std::function<std::ostream&()>
f)
76 if(m_rules.NotEmpty() && !m_rules->Get().empty())
79 for(
const auto& rule : m_rules->Get()) {
80 if(rule->CanGetReplace() && rule->StringMatchesSuspectProductRule(product_name))
88 voidCFixSuspectProductName::ReportFixedProduct(
const string& oldproduct,
const string& newproduct,
const CSeq_loc& loc,
const string& locustag)
const 93std::ostream& report_ostream = m_output();
97report_ostream <<
"Changed "<< oldproduct <<
" to "<< newproduct <<
" "<<
label<<
" "<< locustag <<
"\n\n";
102 staticconstexpr string_view hypotetic_protein_name =
"hypothetical protein";
104std::lock_guard<COnceMutex>
g{m_mutex};
106 if(m_mutex.IsFirstRun() && m_rules.Empty())
109 if(filename.empty()) {
113filename = rules_env;
119 boolmodified =
false;
126 auto& prot_name = feature.
SetData().SetProt().SetName().front();
128 if(0 !=
NStr::Compare(prot_name, hypotetic_protein_name)) {
130 while(
autorule = x_FixSuspectProductName(prot_name)) {
133rule, *scope, prot_name,
134[&mapped, &feattree] {
143[&mapped, &feattree] {
169 autofeattree =
Ref(
newfeature::CFeatTree(seh));
172[](
const CBioseq& bioseq){
returnbioseq.
IsAa(); },
174this->FixSuspectProductNames(feature, scope, feattree);
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.
static CNcbiApplication * Instance(void)
Singleton method.
namespace ncbi::objects::
CConstRef< objects::CSuspect_rule_set > GetProductRules(const string &name="")
string FixProductName(const objects::CSuspect_rule *rule, objects::CScope &scope, string &prot_name, GetFeatureFunc get_mrna, GetFeatureFunc get_cds)
const CNcbiEnvironment & GetEnvironment(void) const
Get the application's cached environment.
const string & Get(const string &name, bool *found=NULL) const
Get environment value by name.
void GetLabel(string *label) const
Appends a label suitable for display (e.g., error messages) label must point to an existing string ob...
CMappedFeat GetBestParentForFeat(const CMappedFeat &feat, CSeqFeatData::ESubtype parent_subtype, CFeatTree *feat_tree=0, const SAnnotSelector *base_sel=0)
CSeq_feat_Handle GetSeq_featHandle(const CSeq_feat &feat, EMissing action=eMissing_Default)
CConstRef< CSeq_entry > GetCompleteSeq_entry(void) const
Complete and get const reference to the seq-entry.
CScope & GetScope(void) const
Get scope this handle belongs to.
TObjectType * GetPointer(void) const THROWS_NONE
Get pointer,.
CRef< C > Ref(C *object)
Helper functions to get CRef<> and CConstRef<> objects.
void Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static int Compare(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2, ECase use_case=eCase)
Compare of a substring with another string.
static const char label[]
TProcessed GetProcessed(void) const
Get the Processed member data.
bool IsSetProcessed(void) const
Check if a value has been assigned to Processed data member.
bool IsSetName(void) const
protein name Check if a value has been assigned to Name data member.
bool IsSetData(void) const
the specific data Check if a value has been assigned to Data data member.
bool IsProt(void) const
Check if variant Prot is selected.
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.
const TProt & GetProt(void) const
Get the variant data.
void VisitAllFeatures(objects::CSeq_entry_EditHandle &entry_h, _M m)
Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
static int match(PCRE2_SPTR start_eptr, PCRE2_SPTR start_ecode, uint16_t top_bracket, PCRE2_SIZE frame_size, pcre2_match_data *match_data, match_block *mb)
int g(Seg_Gsm *spe, Seq_Mtf *psm, Thd_Gsm *tdg)
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