75 if (feat_it->IsSetProduct()
76 && feat_it->GetProduct().Equals(product_loc)
77 && feat_it->GetOriginalSeq_feat().GetPointer() != orig_feat.
GetPointer()) {
122 cmd->AddCommand(*cit_cmd);
127 cmd->AddCommand(*del_feat);
137 cmd->AddCommand(*del_product);
147 product_to_cds.clear();
150 for (
auto tse : tses)
154 if (feat_it->IsSetProduct())
158 product_to_cds[product].insert(fh);
179 cmd->AddCommand(*cit_cmd);
184 cmd->AddCommand(*del_feat);
192 product_to_cds[product].erase(fh);
193 if (product && product.
IsProtein() && product_to_cds[product].empty()) {
195 cmd->AddCommand(*del_product);
215 cmd->AddCommand(*delSet);
221 cmd->AddCommand(*scmd);
234 if (!bsh || !bsh.
IsNa())
259 return delete_features_cmd;
267 if ((*it)->IsSource() && (*it)->GetSource().IsSetOrg()) {
268 src_descs.emplace_back(*it, &se);
284 copy->Assign(*entry);
316 cmd->AddCommand(*clean);
325 copy->Assign(*entry);
346 if (rmv_user_object) {
355 changes =
cleanup.ExtendedCleanup(new_seh, cleanup_flags);
366 cmd->AddCommand(*clean);
376 validator::CTaxValidationAndCleanup tval;
379 vector<CRef<COrg_ref> > original_orgs = tval.GetTaxonomyLookupRequest();
380 if (original_orgs.empty())
385 vector< CRef<COrg_ref> > edited_orgs;
390 while (
i < original_orgs.size())
393 vector< CRef<COrg_ref> > tmp_original_orgs(original_orgs.begin() +
i, original_orgs.begin() +
i +
len);
394 vector< CRef<COrg_ref> > tmp_edited_orgs;
399 tmp_edited_orgs.push_back(cpy);
402 if (tmp_lookup_reply) {
403 string error_message;
404 tval.AdjustOrgRefsWithTaxLookupReply(*tmp_lookup_reply, tmp_edited_orgs, error_message);
411 edited_orgs.insert(edited_orgs.end(), tmp_edited_orgs.begin(), tmp_edited_orgs.end());
423 vector< CRef<COrg_ref> > spec_host_rq = tval.GetSpecificHostLookupRequest(
true);
425 while (
i < spec_host_rq.size())
428 vector< CRef<COrg_ref> > tmp_spec_host_rq(spec_host_rq.begin() +
i, spec_host_rq.begin() +
i +
len);
430 string error_message = tval.IncrementalSpecificHostMapUpdate(tmp_spec_host_rq, *tmp_spec_host_reply);
440 tval.AdjustOrgRefsForSpecificHosts(edited_orgs);
443 size_t num_descs = tval.NumDescs();
444 size_t num_updated_descs = 0;
445 for (
size_t n = 0;
n < num_descs;
n++) {
446 if (!original_orgs[
n]->
Equals(*(edited_orgs[
n]))) {
449 if (original_desc && orig_entry) {
451 new_desc->
Assign(*original_desc);
455 cmd->AddCommand(*subcmd);
462 size_t num_updated_feats = 0;
463 for (
size_t n = 0;
n < tval.NumFeats();
n++) {
464 if (!original_orgs[
n + num_descs]->
Equals(*edited_orgs[
n + num_descs])) {
468 new_feat->
SetData().SetBiosrc().SetOrg().Assign(*(edited_orgs[
n + num_descs]));
472 cmd->AddCommand(*chgFeat);
485 validator::CTaxValidationAndCleanup tval;
488 vector<CRef<COrg_ref> > original_orgs = tval.GetTaxonomyLookupRequest();
489 if (original_orgs.empty()) {
494 vector< CRef<COrg_ref> > edited_orgs;
497 while (
i < original_orgs.size())
500 vector< CRef<COrg_ref> > tmp_original_orgs(original_orgs.begin() +
i, original_orgs.begin() +
i +
len);
502 vector< CRef<COrg_ref> > tmp_edited_orgs;
507 tmp_edited_orgs.push_back(cpy);
511 if (tmp_lookup_reply) {
512 string error_message;
513 tval.AdjustOrgRefsWithTaxLookupReply(*tmp_lookup_reply, tmp_edited_orgs, error_message);
520 edited_orgs.insert(edited_orgs.end(), tmp_edited_orgs.begin(), tmp_edited_orgs.end());
534 vector< CRef<COrg_ref> > spec_host_rq = tval.GetSpecificHostLookupRequest(
true);
536 while (
i < spec_host_rq.size()) {
538 vector< CRef<COrg_ref> > tmp_spec_host_rq(spec_host_rq.begin() +
i, spec_host_rq.begin() +
i +
len);
541 string error_message = tval.IncrementalSpecificHostMapUpdate(tmp_spec_host_rq, *tmp_spec_host_reply);
551 tval.AdjustOrgRefsForSpecificHosts(edited_orgs);
554 size_t num_descs = tval.NumDescs();
555 size_t num_updated_descs = 0;
556 for (
size_t n = 0;
n < num_descs;
n++) {
557 if (!original_orgs[
n]->
Equals(*(edited_orgs[
n]))) {
560 if (original_desc && orig_entry) {
562 new_desc->
Assign(*original_desc);
566 cmd->AddCommand(*subcmd);
573 size_t num_updated_feats = 0;
574 for (
size_t n = 0;
n < tval.NumFeats();
n++) {
575 if (!original_orgs[
n + num_descs]->
Equals(*edited_orgs[
n + num_descs])) {
579 new_feat->
SetData().SetBiosrc().SetOrg().Assign(*(edited_orgs[
n + num_descs]));
583 cmd->AddCommand(*chgFeat);
597 validator::CTaxValidationAndCleanup tval;
600 vector<CRef<COrg_ref> > original_orgs = tval.GetTaxonomyLookupRequest();
601 if (original_orgs.empty())
606 vector< CRef<COrg_ref> > edited_orgs;
611 while (
i < original_orgs.size())
614 vector< CRef<COrg_ref> > tmp_original_orgs(original_orgs.begin() +
i, original_orgs.begin() +
i +
len);
615 vector< CRef<COrg_ref> > tmp_edited_orgs;
620 tmp_edited_orgs.push_back(cpy);
624 string error_message;
625 tval.AdjustOrgRefsWithTaxLookupReply(*tmp_lookup_reply, tmp_edited_orgs, error_message);
633 edited_orgs.insert(edited_orgs.end(), tmp_edited_orgs.begin(), tmp_edited_orgs.end());
637 vector< CRef<COrg_ref> > spec_host_rq = tval.GetSpecificHostLookupRequest(
true);
639 while (
i < spec_host_rq.size())
642 vector< CRef<COrg_ref> > tmp_spec_host_rq(spec_host_rq.begin() +
i, spec_host_rq.begin() +
i +
len);
644 string error_message = tval.IncrementalSpecificHostMapUpdate(tmp_spec_host_rq, *tmp_spec_host_reply);
654 tval.AdjustOrgRefsForSpecificHosts(edited_orgs);
657 size_t num_descs = tval.NumDescs();
658 size_t num_updated_descs = 0;
659 for (
size_t n = 0;
n < num_descs;
n++) {
660 if (!original_orgs[
n]->
Equals(*(edited_orgs[
n]))) {
663 if (original_desc && orig_entry) {
665 new_desc->
Assign(*original_desc);
669 cmd->AddCommand(*subcmd);
676 size_t num_updated_feats = 0;
677 for (
size_t n = 0;
n < tval.NumFeats();
n++) {
678 if (!original_orgs[
n + num_descs]->
Equals(*edited_orgs[
n + num_descs])) {
682 new_feat->
SetData().SetBiosrc().SetOrg().Assign(*(edited_orgs[
n + num_descs]));
686 cmd->AddCommand(*chgFeat);
700 vector<pair<const CSeqdesc*, const CSeq_entry*>> src_descs;
701 vector<CConstRef<CSeq_feat> > src_feats;
705 for (
auto&& desc_it : src_descs) {
706 const CSeqdesc& old_desc = *desc_it.first;
708 new_desc->
Assign(old_desc);
711 cmd->AddCommand(*subcmd);
718 new_feat->
Assign(*old_feat);
719 new_feat->
SetData().SetBiosrc().SetDisableStrainForwarding(disable);
722 cmd->AddCommand(*chgFeat);
744 rq->SetOrg().Assign(org);
751 CTaxon3_reply::TReply::const_iterator reply_it = reply->GetReply().begin();
752 while (reply_it != reply->GetReply().end()) {
753 if ((*reply_it)->IsData()
754 && (*reply_it)->GetData().GetOrg().IsSetTaxname()) {
755 bool is_species_level =
false, force_consult =
false, has_nucleomorphs =
false;
756 (*reply_it)->GetData().GetTaxFlags (is_species_level, force_consult, has_nucleomorphs);
757 if (is_species_level) {
773 vector<pair<const CSeqdesc*, const CSeq_entry*>> src_descs;
774 vector<bool> is_species_level;
779 for (
auto&& desc_it : src_descs) {
780 const CSeqdesc& desc = *desc_it.first;
784 is_species_level.push_back(
false);
792 is_species_level.push_back(
false);
800 CTaxon3_reply::TReply::const_iterator reply_it = reply->GetReply().begin();
802 while (reply_it != reply->GetReply().end()) {
803 if ((*reply_it)->IsData()
804 && (*reply_it)->GetData().GetOrg().IsSetTaxname()) {
805 bool species_level =
false, force_consult =
false, has_nucleomorphs =
false;
806 (*reply_it)->GetData().GetTaxFlags (species_level, force_consult, has_nucleomorphs);
808 is_species_level[pos] =
true;
818 for (
auto&& desc_it : src_descs) {
819 const CSeqdesc& old_desc = *desc_it.first;
821 new_desc->
Assign(old_desc);
824 cmd->AddCommand(*subcmd);
832 new_feat->
Assign(*old_feat);
833 new_feat->
SetData().SetBiosrc().RemoveCultureNotes(is_species_level[pos]);
836 cmd->AddCommand(*chgFeat);
852 if (!product || (product && product.
IsNa())) {
859 bool molinfo_changed =
false;
865 molinfo_changed =
true;
870 if (molinfo_changed) {
874 cmd->AddCommand(*ecmd);
877 cmd->AddCommand(*ecmd);
897 bool any_cmd =
false;
902 cmd->AddCommand(*synch_molinfo);
910 new_prot->
Assign(*(
f->GetSeq_feat()));
928 prot.SetData().SetProt();
930 id->Assign(*(product.
GetId().front().GetSeqId()));
931 prot.SetLocation().SetInt().SetId(*
id);
932 prot.SetLocation().SetInt().SetFrom(0);
936 prot.SetPartial(partial5 || partial3);
945 if ((*it)->IsSetData() && (*it)->GetData().IsProt()) {
946 prot.SetData().SetProt().Assign((*it)->GetData().GetProt());
952 if (cds.
GetXref().size() == 0) {
966 prot->Assign(*((*existing).GetSeq_feat()));
998 cds.
SetProduct().SetWhole().Assign(*product_id);
1002 new_product->
SetId().push_back(product_id);
1006 prot_entry->
SetSeq(*new_product);
1013 if ((*it)->IsSetData() && (*it)->GetData().IsProt()) {
1014 prot->SetData().SetProt().Assign((*it)->GetData().GetProt());
1020 if (cds.
GetXref().size() == 0) {
1031 cmd->AddCommand(*subcmd);
1081 if (new_protein_bioseq && new_protein_bioseq->
IsSetInst())
1084 if ( !new_protein_bioseq ) {
1092 if (prot_seq.empty()) {
1100 prot_seq = prot_seq.substr(0, prot_seq.length() - 1);
1104 new_protein_bioseq->
SetInst().SetSeq_data().SetNcbieaa().Set(prot_seq);
1105 new_protein_bioseq->
SetInst().SetLength(
TSeqPos(prot_seq.length()));
1115 cmd->AddCommand(*chgInst);
1119 if (synch_molinfo) {
1120 cmd->AddCommand(*synch_molinfo);
1127 new_feat->
Assign(prot_feat_ci->GetOriginalFeature());
1158 cmd->AddCommand(*chgFeat);
1180 bool cds_change =
false;
1194 cmd->AddCommand(*chgFeat);
1229 cmd->AddCommand(*chgFeat);
1231 if (adjust_gene && gene) {
1236 if (gene_stop > cds_stop) {
1237 diff = gene_stop - cds_stop;
1240 if (gene_stop < cds_stop) {
1241 diff = cds_stop - gene_stop;
1250 cmd->AddCommand(*chgGene);
1278 cmd->AddCommand(*flip);
1337 bool modified =
false;
1339 prot_seq.erase(prot_seq.end() - 1);
1341 new_inst->
SetSeq_data().SetIupacaa().Set(prot_seq);
1345 new_inst->
SetSeq_data().SetNcbieaa().Set(prot_seq);
1353 cmd->AddCommand(*chgInst);
1358 for ( ; feat_ci; ++feat_ci ) {
1366 if (feat_stop > new_inst->
GetLength() -1 ) {
1369 cmd->AddCommand(*chgFeat);
1384 string fname = reg_view.
GetString(
"ProductRules");
1389 #ifdef NEW_DISCREPANCY_API
1394 copy->Assign(*entry);
1397 scope2.AddDefaults();
1402 if (suspect_rules.empty()) {
1406 discrSet->SetSuspectRules(suspect_rules);
1411 product->Summarize();
1412 auto report = discrSet->Autofix();
1413 if (report.empty()) {
1417 for (
auto J : report) {
1425 cmd->AddCommand(*clean);
1434 copy->Assign(*entry);
1443 if (suspect_rules.empty()) {
1447 discrSet->SetSuspectRules(suspect_rules);
1449 discrSet->Parse(*
copy.GetNCPointer());
1450 discrSet->Summarize();
1453 if (
tests.size() != 1) {
1459 for (
auto it : reports) {
1460 for (
auto obj : it->GetDetails()) {
1461 if (obj->CanAutofix()) {
1466 if (tofix.empty()) {
1471 discrSet->Autofix(tofix,
result);
1481 cmd->AddCommand(*clean);
1492 copy->Assign(*entry);
1499 if (suspect_rules.empty()) {
1503 discrSet->SetSuspectRules(suspect_rules);
1507 auto lcl_product = discrSet->RunTests({
test_name }, *
copy,
"");
1508 lcl_product->Summarize();
1509 auto lcl_report = discrSet->Autofix();
1510 if (lcl_report.empty()) {
1514 report = lcl_report;
1519 cmd->AddCommand(*clean);
1529 bool retranslate,
bool adjust_gene,
const CSeq_feat& orig_feat,
CScope& scope,
1530 int&
offset,
bool create_general_only)
1534 new_feat->
Assign(orig_feat);
1536 bool any_change = policy.ApplyPolicyToFeature(*new_feat, scope);
1542 if (adjust_gene_cmd) {
1543 cmd->AddCommand(*adjust_gene_cmd);
1557 if (retranslate_cmd) {
1558 cmd->AddCommand(*retranslate_cmd);
1564 cmd->AddCommand(*synch);
1586 new_gene->
Assign(*old_gene);
1588 bool gene_change =
false;
1619 bool any_change =
false;
1622 for (
auto copy_pair : cds_gene_pairs) {
1624 new_cds->
Assign(*(copy_pair.first.GetOriginalSeq_feat()));
1626 new_gene->
Assign(*(copy_pair.second.GetOriginalSeq_feat()));
1629 cmd->AddCommand(*chgGene);
1631 cmd->AddCommand(*chgCDS);
1658 bool any_change =
false;
1663 cp->
Assign(*(
f->GetSeq_feat()));
1667 cmd->AddCommand(*chgFeat);
1709 bool modified =
false;
1712 if (product.empty()) {
1714 message +=
"reset the mRNA product name ";
1717 else if (!
rna.IsSetExt() || (
rna.IsSetExt() && !
NStr::Equal(
rna.GetExt().GetName(), product))) {
1718 rna.SetExt().SetName(product);
1719 message =
"applied " + product +
" to mRNA product name ";
1727 cmd.Reset(
new CCmdComposite(
"Update mRNA product to match CDS product name"));
1728 cmd->AddCommand(*chgFeat);
1766 new_mrna->
Assign(*orig_mrna);
1768 bool modified =
false;
1771 new_mrna->
SetData().SetRna().SetRnaProductName(prot_product, remainder);
1778 cmd->AddCommand(*chgFeat);
@ eExtreme_Positional
numerical value
@ eExtreme_Biological
5' and 3'
void ExtendStop(CSeq_loc &loc, TSeqPos len, CScope &scope)
bool AdjustProteinFeaturePartialsToMatchCDS(CSeq_feat &new_prot, const CSeq_feat &cds)
AdjustProteinFeaturePartialsToMatchCDS A function to change an existing MolInfo to match a coding reg...
CRef< objects::CSeq_id > GetNewProtId(objects::CBioseq_Handle bsh, int &offset, string &id_label, bool general_only)
void RemoveCultureNotes(bool is_species_level=true)
void SetDisableStrainForwarding(bool val)
TSeqPos GetLength(void) const
static vector< TFeatGenePair > GetNormalizableGeneQualPairs(CBioseq_Handle bsh)
@ eClean_NoNcbiUserObjects
static bool NormalizeGeneQuals(CSeq_feat &cds, CSeq_feat &gene)
void AddCommand(IEditCommand &command)
virtual void Execute()
Do the editing action.
static CIRef< IEditCommand > RemoveCitations(objects::CSeq_entry_Handle &seh, const objects::CPub_equiv &pubs)
static CGuiRegistry & GetInstance()
access the application-wide singleton
CRegistryReadView GetReadView(const string §ion) const
get a read-only view at a particular level.
Base class for all object manager exceptions.
@RNA_ref.hpp User-defined methods of the data storage class.
class CRegistryReadView provides a nested hierarchical view at a particular key.
string GetString(const string &key, const string &default_val=kEmptyStr) const
ESubtype GetSubtype(void) const
SeqMap related exceptions.
const CSeq_descr & GetDescr(void) const
bool IsSetDescr(void) const
namespace ncbi::objects::
Seq-loc iterator class – iterates all intervals from a seq-loc in the correct order.
virtual CRef< CTaxon3_reply > SendRequest(const CTaxon3_request &request)
virtual CRef< CTaxon3_reply > SendOrgRefList(const vector< CRef< COrg_ref > > &list, COrg_ref::fOrgref_parts result_parts=COrg_ref::eOrgref_default, fT3reply_parts t3result_parts=eT3reply_default)
void SetMolinfoForProtein(CRef< objects::CSeq_entry > protein, bool partial5, bool partial3)
CRef< objects::CSeq_feat > AddEmptyProteinFeatureToProtein(CRef< objects::CSeq_entry > protein, bool partial5, bool partial3)
static const int chunk_size
static void cleanup(void)
vector< CRef< CReportItem > > TReportItemList
vector< CRef< CReportObj > > TReportObjectList
eTestNames GetDiscrepancyCaseName(string_view)
void ReverseComplement(const BidirectionalIterator &first, const BidirectionalIterator &last)
bool RemoveDuplicateGoTerms(CSeq_feat &feat)
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
void Error(CExceptionArgs_Base &args)
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
const string & GetMsg(void) const
Get message string.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Optimized implementation of CSerialObject::Assign, which is not so efficient.
CConstRef< CSeq_id > GetSeqId(void) const
bool IsPartialStart(ESeqLocExtremes ext) const
check start or stop of location for e_Lim fuzz
ENa_strand GetStrand(void) const
Get the location's strand.
void SetId(CSeq_id &id)
set the 'id' field in all parts of this location
TSeqPos GetStart(ESeqLocExtremes ext) const
Return start and stop positions of the seq-loc.
const CSeq_id * GetId(void) const
Get the id of the location return NULL if has multiple ids or no id at all.
bool IsPartialStop(ESeqLocExtremes ext) const
TSeqPos GetStop(ESeqLocExtremes ext) const
bool AdjustProteinMolInfoToMatchCDS(CMolInfo &molinfo, const CSeq_feat &cds)
AdjustProteinMolInfoToMatchCDS A function to change an existing MolInfo to match a coding region.
const CSeq_feat * GetCDSForProduct(const CBioseq &product, CScope *scope)
Get the encoding CDS feature of a given protein sequence.
static CRef< CBioseq > TranslateToProtein(const CSeq_feat &cds, CScope &scope)
CConstRef< CSeq_feat > GetOverlappingGene(const CSeq_loc &loc, CScope &scope, ETransSplicing eTransSplicing=eTransSplicing_Auto)
CConstRef< CSeq_feat > GetmRNAforCDS(const CSeq_feat &cds, CScope &scope)
GetmRNAforCDS A function to find a CSeq_feat representing the appropriate mRNA for a given CDS.
static void Translate(const string &seq, string &prot, const CGenetic_code *code, bool include_stop=true, bool remove_trailing_X=false, bool *alt_start=NULL, bool is_5prime_complete=true, bool is_3prime_complete=true)
Translate a string using a specified genetic code.
static CRef< CObjectManager > GetInstance(void)
Return the existing object manager or create one.
CSeq_entry_Handle AddTopLevelSeqEntry(CSeq_entry &top_entry, TPriority pri=kPriority_Default, EExist action=eExist_Default)
Add seq_entry, default priority is higher than for defaults or loaders Add object to the score with p...
CSeq_entry_Handle GetSeq_entryHandle(CDataLoader *loader, const TBlobId &blob_id, EMissing action=eMissing_Default)
Get Seq-entry handle by its blob-id, with possible loading.
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
void AddDefaults(TPriority pri=kPriority_Default)
Add default data loaders from object manager.
void GetAllTSEs(TTSE_Handles &tses, enum ETSEKind kind=eManualTSEs)
CSeq_feat_Handle GetSeq_featHandle(const CSeq_feat &feat, EMissing action=eMissing_Default)
vector< CSeq_entry_Handle > TTSE_Handles
virtual CSeq_id_Handle GetLocationId(void) const
CConstRef< CBioseq > GetCompleteBioseq(void) const
Get the complete bioseq.
TClass GetClass(void) const
CBioseq_set_Handle GetParentBioseq_set(void) const
Return a handle for the parent Bioseq-set, or null handle.
CSeq_entry_Handle GetParentEntry(void) const
Get parent Seq-entry handle.
const CSeqFeatData & GetData(void) const
CSeq_entry_Handle GetSeq_entry_Handle(void) const
Get parent Seq-entry handle.
virtual const CSeq_loc & GetProduct(void) const
bool IsSetProduct(void) const
CConstRef< CSeq_id > GetSeqId(void) const
Get id which can be used to access this bioseq handle Throws an exception if none is available.
virtual const CSeq_loc & GetLocation(void) const
CBioseq_set_Handle GetParentBioseq_set(void) const
Get parent bioseq-set handle.
bool IsProtein(void) const
CSeq_entry_Handle GetParentEntry(void) const
Return a handle for the parent seq-entry of the bioseq.
TInst_Length GetInst_Length(void) const
bool IsSetClass(void) const
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.
CScope & GetScope(void) const
Get scope this handle belongs to.
const TInst_Seq_data & GetInst_Seq_data(void) const
CScope & GetScope(void) const
Get scope this handle belongs to.
CConstRef< CSeq_feat > GetOriginalSeq_feat(void) const
CSeq_entry_Handle GetTopLevelEntry(void) const
Return a handle for the top-level seq-entry.
CSeq_entry_Handle GetTopLevelEntry(void) const
Get top level Seq-entry handle.
const TId & GetId(void) const
virtual CSeq_id_Handle GetProductId(void) const
CSeqVector GetSeqVector(EVectorCoding coding, ENa_strand strand=eNa_strand_plus) const
Get sequence: Iupacna or Iupacaa if use_iupac_coding is true.
const TInst & GetInst(void) const
@ eCoding_Ncbi
Set coding to binary coding (Ncbi4na or Ncbistdaa)
const CSeq_loc & GetLocation(void) const
const CSeq_feat & GetOriginalFeature(void) const
Get original feature with unmapped location/product.
CConstRef< CSeq_feat > GetSeq_feat(void) const
Get current seq-feat.
CSeq_entry_Handle GetSeq_entry_Handle(void) const
void GetSeqData(TSeqPos start, TSeqPos stop, string &buffer) const
Fill the buffer string with the sequence data for the interval [start, stop).
void SetCoding(TCoding coding)
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.
void Reset(void)
Reset reference object.
uint32_t Uint4
4-byte (32-bit) unsigned integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static bool EndsWith(const CTempString str, const CTempString end, ECase use_case=eCase)
Check if a string ends with a specified suffix value.
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
static bool Equal(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2, ECase use_case=eCase)
Test for equality of a substring with another string.
const TOrg & GetOrg(void) const
Get the Org member data.
void SetOrg(TOrg &value)
Assign a value to Org data member.
const TName & GetName(void) const
Get the Name member data.
bool IsSetName(void) const
protein name Check if a value has been assigned to Name data member.
TType GetType(void) const
Get the Type member data.
TXref & SetXref(void)
Assign a value to Xref data member.
const TPub & GetPub(void) const
Get the variant data.
bool IsSetData(void) const
the specific data Check if a value has been assigned to Data data member.
void SetLocation(TLocation &value)
Assign a value to Location data member.
bool IsCdregion(void) const
Check if variant Cdregion is selected.
void SetPartial(TPartial value)
Assign a value to Partial data member.
void SetProduct(TProduct &value)
Assign a value to Product data member.
bool IsSetXref(void) const
cite other relevant features Check if a value has been assigned to Xref data member.
const TLocation & GetLocation(void) const
Get the Location member data.
const TData & GetData(void) const
Get the Data member data.
bool IsPub(void) const
Check if variant Pub is selected.
void SetData(TData &value)
Assign a value to Data data member.
bool CanGetLocation(void) const
Check if it is safe to call GetLocation method.
const TBiosrc & GetBiosrc(void) const
Get the variant data.
const TProduct & GetProduct(void) const
Get the Product member data.
const TProt & GetProt(void) const
Get the variant data.
const TXref & GetXref(void) const
Get the Xref member data.
vector< CRef< CSeqFeatXref > > TXref
void ResetXref(void)
Reset Xref data member.
const TRna & GetRna(void) const
Get the variant data.
bool IsSetProduct(void) const
product of process Check if a value has been assigned to Product data member.
bool IsRna(void) const
Check if variant Rna is selected.
bool IsSetLocation(void) const
feature made from Check if a value has been assigned to Location data member.
bool CanGetTo(void) const
Check if it is safe to call GetTo method.
TTo GetTo(void) const
Get the To member data.
bool IsInt(void) const
Check if variant Int is selected.
const TInt & GetInt(void) const
Get the variant data.
const TSet & GetSet(void) const
Get the variant data.
bool IsSetSeq_set(void) const
Check if a value has been assigned to Seq_set data member.
bool IsSet(void) const
Check if variant Set is selected.
const TSeq_set & GetSeq_set(void) const
Get the Seq_set member data.
list< CRef< CSeq_entry > > TSeq_set
TSeq & SetSeq(void)
Select the variant.
@ eClass_nuc_prot
nuc acid and coded proteins
list< CRef< CSeqdesc > > Tdata
TId & SetId(void)
Assign a value to Id data member.
bool IsSetSeq_data(void) const
the sequence Check if a value has been assigned to Seq_data data member.
bool IsNcbieaa(void) const
Check if variant Ncbieaa is selected.
const TInst & GetInst(void) const
Get the Inst member data.
bool IsIupacaa(void) const
Check if variant Iupacaa is selected.
const TSource & GetSource(void) const
Get the variant data.
const Tdata & Get(void) const
Get the member data.
bool IsSetInst(void) const
the sequence data Check if a value has been assigned to Inst data member.
TLength GetLength(void) const
Get the Length member data.
void SetInst(TInst &value)
Assign a value to Inst data member.
TSource & SetSource(void)
Select the variant.
void SetBiomol(TBiomol value)
Assign a value to Biomol data member.
bool IsSetId(void) const
equivalent identifiers Check if a value has been assigned to Id data member.
void SetLength(TLength value)
Assign a value to Length data member.
void ResetInst(void)
Reset Inst data member.
void SetSeq_data(TSeq_data &value)
Assign a value to Seq_data data member.
const TPub & GetPub(void) const
Get the Pub member data.
const TMolinfo & GetMolinfo(void) const
Get the variant data.
TMolinfo & SetMolinfo(void)
Select the variant.
@ eRepr_raw
continuous sequence
@ e_Ncbieaa
extended ASCII 1 letter aa codes
@ e_Molinfo
info on the molecule and techniques
@ eMol_na
just a nucleic acid
TRequest & SetRequest(void)
Assign a value to Request data member.
function< CRef< CTaxon3_reply >(const vector< CRef< COrg_ref > > &list)> taxupdate_func_t
void ReverseComplementFeature(CSeq_feat &feat, CScope &scope)
CRef< CSeq_loc > SeqLocExtend(const CSeq_loc &loc, size_t pos, CScope *scope)
constexpr bool empty(list< Ts... >) noexcept
static bool Equals(const CVariation::TPlacements &p1, const CVariation::TPlacements &p2)
void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)
double f(double x_, const double &y_)
static SQLCHAR output[256]
static char test_name[128]
static DbTestEntry * tests
CRef< CCmdComposite > GetDeleteAllFeaturesCommand(CSeq_entry_Handle seh, size_t &count, bool remove_proteins)
CRef< CCmdComposite > TrimStopsFromCompleteCDS(const CSeq_feat &cds, CScope &scope)
TrimStopsFromCompleteCDS If the CDS is 3' complete and the protein sequence ends with a stop codon,...
static bool s_IsNucLocation(CSeq_feat_Handle fh)
void SetProteinFeature(CSeq_feat &prot, CBioseq_Handle product, const CSeq_feat &cds)
CRef< CCmdComposite > TranslateCDSCommand(CScope &scope, CSeq_feat &cds, bool &cds_change, int &offset, bool create_general_only)
bool GetRemoveDuplicateGOTermsCommand(CBioseq_Handle bsh, CRef< CCmdComposite > cmd)
CRef< CCmdComposite > CleanupCommand(CSeq_entry_Handle orig_seh, bool extended, bool do_tax)
static bool s_IsFarLocation(CSeq_feat_Handle fh)
CRef< CCmdComposite > GetDeleteFeatureCommand(const CSeq_feat_Handle &fh, bool remove_proteins)
static const char * kDiscrepancyEdit
CRef< CCmdComposite > GetEditLocationCommand(const edit::CLocationEditPolicy &policy, bool retranslate, bool adjust_gene, const CSeq_feat &orig_feat, CScope &scope, int &offset, bool create_general_only)
GetEditLocationCommand Changes the location properties of a feature according to a location policy.
static bool s_AreThereOtherCDSForThisProduct(const CSeq_feat_Handle &fh)
CRef< CCmdComposite > GetSynchronizeProductMolInfoCommand(CScope &scope, const CSeq_feat &cds)
CRef< CCmdComposite > TaxonomyLookupCommand(CSeq_entry_Handle seh)
bool s_IsSpeciesLevel(const COrg_ref &org)
CRef< CCmdComposite > GetEnableStrainForwardingCommand(CSeq_entry_Handle seh)
CRef< CCmdComposite > GetRetranslateCDSCommand(CScope &scope, CSeq_feat &cds, bool &cds_change, bool create_general_only)
CRef< CCmdComposite > GetSynchronizeProteinPartialsCommand(CScope &scope, const CSeq_feat &cds)
CRef< CCmdComposite > GetChangeStrainForwardingCommand(CSeq_entry_Handle seh, bool disable)
CRef< CCmdComposite > CreateOrAdjustProteinFeature(CBioseq_Handle product, CSeq_feat &cds, bool &cds_change)
CRef< CCmdComposite > GetDeleteSequenceCommand(CBioseq_Handle bsh)
CRef< CCmdChangeSeq_feat > AdjustGene(const CSeq_feat &orig_feat, const CSeq_feat &new_feat, CScope &scope)
CRef< CCmdComposite > SpecificHostCleanupCommand(CSeq_entry_Handle seh)
bool GetNormalizeGeneQualsCommand(CBioseq_Handle bsh, CRef< CCmdComposite > cmd)
void GetProductToCDSMap(CScope &scope, map< CBioseq_Handle, set< CSeq_feat_Handle > > &product_to_cds)
CRef< CCmdComposite > AutofixCommand(CSeq_entry_Handle orig_seh, const string &test_name, string *output, const string &suspect_rules)
CRef< CCmdComposite > GetRmCultureNotesCommand(CSeq_entry_Handle seh)
static void s_GetSourceDescriptors(const CSeq_entry &se, vector< pair< const CSeqdesc *, const CSeq_entry * >> &src_descs)
CRef< CCmdComposite > CleanupHugeFileCommand(CSeq_entry_Handle orig_seh, bool extended, bool do_tax, objects::taxupdate_func_t &updater, bool rmv_user_object)
CRef< CCmdComposite > GetDisableStrainForwardingCommand(CSeq_entry_Handle seh)
CRef< CCmdComposite > SetTranslExcept(CSeq_entry_Handle seh, const string &comment, bool strict, bool extend, bool adjust_gene)
SetTranslExcept A function to set a code break at the 3' end of coding regions in a Seq-entry to indi...
CRef< CCmdComposite > AutofixCommandHugeMode(CSeq_entry_Handle orig_seh, const string &str_test_name, map< string, size_t > &report, const string &suspect_rules)
CRef< CCmdComposite > GetReverseComplimentSequenceCommand(CBioseq_Handle bsh)
CRef< CCmdComposite > UpdatemRNAProduct(const CSeq_feat &protein, CScope &scope, string &message)
void AdjustProteinFeature(CSeq_feat &prot, CBioseq_Handle product, CSeq_feat &cds, bool &cds_change)
static string s_GetProductRules()
CRef< CCmdComposite > CachedTaxonomyLookupCommand(CSeq_entry_Handle seh, objects::taxupdate_func_t &updater)