NCBI C++ ToolKit
|
#include <corelib/ncbistd.hpp>
#include <corelib/ncbistr.hpp>
#include <objects/seqfeat/Seq_feat.hpp>
#include <objects/seqfeat/SeqFeatData.hpp>
#include <objects/seqfeat/Org_ref.hpp>
#include <objects/seqset/Bioseq_set.hpp>
#include <objects/biblio/Id_pat.hpp>
#include <objects/biblio/Auth_list.hpp>
#include <objmgr/seq_vector.hpp>
#include <serial/iterator.hpp>
#include <vector>
#include <list>
Go to the source code of this file.
Go to the SVN repository for this file.
Typedefs | |
typedef const CSeq_feat::TDbxref | TDbtags |
Enumerations | |
enum | EAccessionFormatError { eAccessionFormat_valid = 0 , eAccessionFormat_no_start_letters , eAccessionFormat_wrong_number_of_digits , eAccessionFormat_null , eAccessionFormat_too_long , eAccessionFormat_missing_version , eAccessionFormat_bad_version } |
enum | EDateValid { eDateValid_valid = 0x0 , eDateValid_bad_str = 0x01 , eDateValid_bad_year = 0x02 , eDateValid_bad_month = 0x04 , eDateValid_bad_day = 0x08 , eDateValid_bad_season = 0x10 , eDateValid_bad_other = 0x20 , eDateValid_empty_date = 0x40 } |
enum | EBioseqEndIsType { eBioseqEndIsType_None = 0 , eBioseqEndIsType_Last , eBioseqEndIsType_All } |
enum | EDuplicateFeatureType { eDuplicate_Not = 0 , eDuplicate_Duplicate , eDuplicate_SameIntervalDifferentLabel , eDuplicate_DuplicateDifferentTable , eDuplicate_SameIntervalDifferentLabelDifferentTable } |
typedef const CSeq_feat::TDbxref TDbtags |
Definition at line 199 of file utilities.hpp.
Definition at line 105 of file utilities.hpp.
enum EBioseqEndIsType |
Enumerator | |
---|---|
eBioseqEndIsType_None | |
eBioseqEndIsType_Last | |
eBioseqEndIsType_All |
Definition at line 156 of file utilities.hpp.
enum EDateValid |
Enumerator | |
---|---|
eDateValid_valid | |
eDateValid_bad_str | |
eDateValid_bad_year | |
eDateValid_bad_month | |
eDateValid_bad_day | |
eDateValid_bad_season | |
eDateValid_bad_other | |
eDateValid_empty_date |
Definition at line 122 of file utilities.hpp.
Enumerator | |
---|---|
eDuplicate_Not | |
eDuplicate_Duplicate | |
eDuplicate_SameIntervalDifferentLabel | |
eDuplicate_DuplicateDifferentTable | |
eDuplicate_SameIntervalDifferentLabelDifferentTable |
Definition at line 191 of file utilities.hpp.
void AdjustSpecificHostForTaxServer | ( | string & | spec_host | ) |
Definition at line 2032 of file utilities.cpp.
References ArraySize(), i, NStr::ReplaceInPlace(), sIgnoreHostWordList, and NStr::TruncateSpacesInPlace().
Referenced by SpecificHostValueToCheck().
Definition at line 1064 of file utilities.cpp.
References ENUM_METHOD_NAME, CEnumeratedTypeValues::FindName(), GetBioseqIdLabel(), CBioseq_Base::GetInst(), CSeq_inst_Base::GetLength(), CSeq_inst_Base::GetMol(), CSeq_inst_Base::GetRepr(), NStr::IntToString(), CSeq_inst_Base::IsSetLength(), str(), and string.
Referenced by CValidErrorFormat::GetDescriptorLabel(), CValidError_imp::PostErr(), and CValidError_bioseq::x_ReportOverlappingPeptidePair().
Definition at line 3080 of file utilities.cpp.
References CSeq_loc_CI::GetSeq_id(), IsInOrganelleSmallGenomeSet(), IsSameBioseq(), and CSeq_id::Match().
Referenced by CRemoveUnindexedFeatures::apply(), CValidError_imp::BadMultipleSequenceLocation(), and CValidError_imp::ValidateSeqLocIds().
CBioseq_Handle BioseqHandleFromLocation | ( | CScope * | m_Scope, |
const CSeq_loc & | loc | ||
) |
Definition at line 1277 of file utilities.cpp.
References CScope::eGetBioseq_All, CScope::GetBioseqHandle(), CSeq_id_Handle::GetHandle(), and m_Scope.
Referenced by CValidator::CCacheImpl::GetBioseqHandleFromLocation(), GetSequenceStringFromLoc(), IsDeltaOrFarSeg(), s_AreLinkedToDifferentFeats(), and s_GetSeq_featAcc().
void CalculateEffectiveTranslationLengths | ( | const string & | transl_prot, |
const CSeqVector & | prot_vec, | ||
size_t & | len, | ||
size_t & | prot_len | ||
) |
Definition at line 2597 of file utilities.cpp.
References NStr::EndsWith(), len, and CSeqVector::size().
Referenced by CCDSTranslationProblems::CalculateTranslationProblems(), GetMismatches(), and CCDSTranslationProblems::x_GetTranslationMismatches().
void CheckBioseqEndsForNAndGap | ( | const CBioseq_Handle & | bsh, |
EBioseqEndIsType & | begin_n, | ||
EBioseqEndIsType & | begin_gap, | ||
EBioseqEndIsType & | end_n, | ||
EBioseqEndIsType & | end_gap, | ||
bool & | begin_ambig, | ||
bool & | end_ambig | ||
) |
Definition at line 1422 of file utilities.cpp.
References CheckBioseqEndsForNAndGap(), eBioseqEndIsType_None, CBioseq_Handle::eCoding_Iupac, CBioseq_Handle::GetSeqVector(), and ShouldCheckForNsAndGap().
Referenced by BOOST_AUTO_TEST_CASE(), and CValidError_bioseq::ValidateNsAndGaps().
void CheckBioseqEndsForNAndGap | ( | const CSeqVector & | vec, |
EBioseqEndIsType & | begin_n, | ||
EBioseqEndIsType & | begin_gap, | ||
EBioseqEndIsType & | end_n, | ||
EBioseqEndIsType & | end_gap, | ||
bool & | begin_ambig, | ||
bool & | end_ambig | ||
) |
Definition at line 1317 of file utilities.cpp.
References eBioseqEndIsType_All, eBioseqEndIsType_Last, eBioseqEndIsType_None, i, CSeqVector::IsInGap(), CSeqVector::IsNucleotide(), s_PosIsNNotGap(), and CSeqVector::size().
Referenced by CheckBioseqEndsForNAndGap().
Definition at line 780 of file utilities.cpp.
References eDateValid_bad_day, eDateValid_bad_month, eDateValid_bad_other, eDateValid_bad_season, eDateValid_bad_str, eDateValid_bad_year, eDateValid_valid, NStr::Equal(), CDate_Base::GetStd(), CDate_Base::GetStr(), isalpha(), NStr::IsBlank(), CDate_Base::IsStd(), and CDate_Base::IsStr().
Referenced by CValidError_imp::ValidateCitSub(), CValidError_imp::ValidatePubArticleNoPMID(), CValidError_imp::ValidatePubGen(), and CValidError_desc::ValidateSeqDesc().
Definition at line 2871 of file utilities.cpp.
References NULL.
Referenced by CheckAdjacentSpliceSites(), CheckSpliceSite(), and CCDSTranslationProblems::x_Is5AtEndSpliceSiteOrGap().
Definition at line 2876 of file utilities.cpp.
References NULL.
Referenced by CheckAdjacentSpliceSites(), CheckSpliceSite(), and CCDSTranslationProblems::x_Is5AtEndSpliceSiteOrGap().
Definition at line 2881 of file utilities.cpp.
References NULL.
Referenced by CheckAdjacentSpliceSites(), CheckSpliceSite(), and CCDSTranslationProblems::x_Is5AtEndSpliceSiteOrGap().
Definition at line 2886 of file utilities.cpp.
References NULL.
Referenced by CheckAdjacentSpliceSites(), CheckSpliceSite(), and CCDSTranslationProblems::x_Is5AtEndSpliceSiteOrGap().
void ConvertToEntrezTerm | ( | string & | title | ) |
Definition at line 2220 of file utilities.cpp.
References isspace(), s_ConvertChar(), and NStr::TruncateSpacesInPlace().
Referenced by pub_report::CSkipPubJournalHook::IsJournalMissing(), and CDoiLookup::LookupIsojta().
Definition at line 2393 of file utilities.cpp.
References NStr::IsBlank(), and ITERATE.
Referenced by CCDSTranslationProblems::CalculateTranslationProblems(), GetInternalStopErrorMessage(), GetStartCodonErrorMessage(), and HasInternalStop().
size_t CountProteinStops | ( | const CSeqVector & | sv | ) |
Definition at line 2504 of file utilities.cpp.
Referenced by HasStopInProtein(), and CValidError_bioseq::ValidateRawConst().
Definition at line 2939 of file utilities.cpp.
References CSpliceProblems::CalculateSpliceProblems(), DoesCodingRegionHaveUnnecessaryException(), DoesmRNAHaveUnnecessaryException(), CSeqFeatData::eSubtype_mRNA, CScope::GetBioseqHandle(), CSeq_feat_Base::GetData(), CSeq_feat_Base::GetLocation(), CSeqFeatData::GetSubtype(), CSeqFeatData_Base::IsCdregion(), CSpliceProblems::IsExceptionUnnecessary(), IsPseudo(), CSeq_feat_Base::IsSetData(), CSeq_feat_Base::IsSetExcept_text(), and CSeq_feat_Base::IsSetLocation().
Referenced by CRemoveUnnecessaryExceptions::apply(), and BOOST_AUTO_TEST_CASE().
Definition at line 768 of file utilities.cpp.
References NStr::EndsWith(), and str().
Referenced by CSingleFeatValidator::ValidateCharactersInField().
Definition at line 2546 of file utilities.cpp.
References eSeqlocPartial_Start, eSeqlocPartial_Stop, CSeq_feat_Base::GetLocation(), CSeq_feat_Base::GetProduct(), CSeq_feat_Base::IsSetProduct(), and SeqLocPartialCheck().
Referenced by CCDSTranslationProblems::CalculateTranslationProblems(), GetMismatches(), HasNoStop(), CCDSTranslationProblems::x_GetCdTransErrors(), and CCDSTranslationProblems::x_GetTranslationMismatches().
Definition at line 1985 of file utilities.cpp.
References NStr::EqualCase(), NStr::EqualNocase(), COrgMod_Base::eSubtype_gb_synonym, COrgMod_Base::eSubtype_old_name, FOR_EACH_SYN_ON_ORGREF, COrg_ref_Base::GetCommon(), COrgName_Base::GetMod(), COrg_ref_Base::GetOrgname(), COrg_ref_Base::GetTaxname(), NStr::IsBlank(), COrg_ref_Base::IsSetCommon(), COrgName_Base::IsSetMod(), COrg_ref_Base::IsSetOrgname(), COrg_ref_Base::IsSetTaxname(), match(), and str().
Referenced by CSpecificHostRequest::AddReply(), and InterpretSpecificHostResult().
returns the corrected specific host, if the specific host is invalid and can be corrected returns an empty string, if the specific host is invalid and cannot be corrected returns the original value except the preceding/trailing spaces, if the specific host is valid
Definition at line 2189 of file utilities.cpp.
References val.
Referenced by BOOST_AUTO_TEST_CASE().
Definition at line 2999 of file utilities.cpp.
References CSeq_id_Base::e_Ddbj, CSeq_id_Base::e_Embl, CSeq_id_Base::e_Genbank, CSeq_id_Base::e_Other, CSeq_id_Base::e_Tpg, NStr::EndsWith(), GetAccession(), and s_IsGenbankMasterAccession().
Referenced by CValidError_bioseq::IsMaster(), and s_IsMaster().
Definition at line 427 of file utilities.cpp.
References s_GetBioseqAcc(), and dtl::version.
Referenced by CValidError_imp::PostErr(), and CTbl2AsnApp::ProcessHugeFile().
string GetAccessionFromBioseqSet | ( | const CBioseq_set & | bsst, |
int * | version | ||
) |
Definition at line 433 of file utilities.cpp.
References kEmptyStr, s_GetBioseqAcc(), s_GetSeqFromSet(), and dtl::version.
Referenced by CValidErrorFormat::GetBioseqSetLabel(), CValidError_imp::PostErr(), and CTbl2AsnApp::ProcessHugeFile().
string GetAccessionFromObjects | ( | const CSerialObject * | obj, |
const CSeq_entry * | ctx, | ||
CScope & | scope, | ||
int * | version | ||
) |
Definition at line 443 of file utilities.cpp.
References ctx, CScope::GetBioseqHandle(), CBioseq_set_Handle::GetCompleteBioseq_set(), CSeq_loc::GetId(), CSeq_graph_Base::GetLoc(), CSeq_annot_Handle::GetParentEntry(), GetReportableSeqIdForAlignment(), CSeq_entry_Base::GetSeq(), CSeq_entry_Handle::GetSeq(), CScope::GetSeq_annotHandle(), CScope::GetSeq_entryHandle(), CSeq_entry_Base::GetSet(), CSeq_entry_Handle::GetSet(), CSerialObject::GetThisTypeInfo(), NStr::IsBlank(), CSeq_entry_Base::IsSeq(), CSeq_entry_Handle::IsSeq(), CSeq_entry_Base::IsSet(), CSeq_entry_Handle::IsSet(), s_GetAccessionForSeqdesc(), s_GetBioseqAcc(), s_GetSeq_featAcc(), s_GetSeqFromSet(), and dtl::version.
Referenced by CValidError_imp::PostErr(), CTable2AsnValidator::Validate(), and CValidError_align::x_ValidateDim().
Definition at line 981 of file utilities.cpp.
References CBioseq_Base::GetId().
Referenced by AppendBioseqLabel(), GetValidatorLocationLabel(), and CSingleFeatValidator::ValidateSplice().
CBioseq_Handle GetCDSProductSequence | ( | const CSeq_feat & | feat, |
CScope * | scope, | ||
const CTSE_Handle & | tse, | ||
bool | far_fetch, | ||
bool & | is_far | ||
) |
Definition at line 2574 of file utilities.cpp.
References CScope::GetBioseqHandle(), CScope::GetBioseqHandleFromTSE(), GetId(), CSeq_feat_Base::GetProduct(), and CSeq_feat_Base::IsSetProduct().
Referenced by HasNoStop().
Definition at line 855 of file utilities.cpp.
References eDateValid_bad_day, eDateValid_bad_month, eDateValid_bad_other, eDateValid_bad_season, eDateValid_bad_str, eDateValid_bad_year, eDateValid_empty_date, and flags.
Referenced by CValidError_imp::PostBadDateError().
CBioseq_set_Handle GetGenProdSetParent | ( | const CBioseq_Handle & | set | ) |
Definition at line 575 of file utilities.cpp.
References CBioseq_set_Base::eClass_gen_prod_set, and GetSetParent().
CBioseq_set_Handle GetGenProdSetParent | ( | const CBioseq_set_Handle & | set | ) |
Definition at line 570 of file utilities.cpp.
References CBioseq_set_Base::eClass_gen_prod_set, and GetSetParent().
Referenced by CValidError_bioseqset::ValidateNucProtSet(), and CSingleFeatValidator::x_ValidateExceptText().
Definition at line 125 of file utilities.cpp.
References CScope::AddDefaults(), CScope::GetGi(), CSeq_id_Handle::GetHandle(), CObjectManager::GetInstance(), and ZERO_GI.
vector<TSeqPos> GetMismatches | ( | const CSeq_feat & | feat, |
const CBioseq_Handle & | prot_handle, | ||
const string & | transl_prot | ||
) |
Definition at line 2658 of file utilities.cpp.
References CSeq_data_Base::e_Ncbieaa, GetMismatches(), CBioseq_Handle::GetSeqVector(), CBioseq_Handle::IsAa(), and CSeqVector::SetCoding().
vector<TSeqPos> GetMismatches | ( | const CSeq_feat & | feat, |
const CSeqVector & | prot_vec, | ||
const string & | transl_prot | ||
) |
Definition at line 2626 of file utilities.cpp.
References CalculateEffectiveTranslationLengths(), FeatureHasEnds(), CSeq_feat_Base::GetPartial(), CSeqVector::GetScope(), i, CSeq_feat_Base::IsSetPartial(), and len.
Referenced by GetMismatches(), and HasNoStop().
CBioseq_Handle GetNucBioseq | ( | const CBioseq_Handle & | bioseq | ) |
Definition at line 608 of file utilities.cpp.
References GetNucBioseq(), CBioseq_Handle::GetParentEntry(), CSeq_entry_Handle::GetParentEntry(), CSeq_entry_Handle::GetSet(), CBioseq_Handle::IsNucleotide(), CSeq_entry_Handle::IsSet(), and nuc.
CBioseq_Handle GetNucBioseq | ( | const CBioseq_set_Handle & | bioseq_set | ) |
Definition at line 587 of file utilities.cpp.
References CSeq_inst_Base::eMol_na, CBioseq_set_Handle::GetParentEntry(), CSeq_entry_Handle::GetParentEntry(), CSeq_entry_Handle::GetSet(), CSeq_entry_Handle::IsSet(), and nuc.
Referenced by CValidError_imp::AddBioseqWithNoPub(), GetNucBioseq(), and CValidError_bioseq::ValidateBioseqContext().
CBioseq_set_Handle GetNucProtSetParent | ( | const CBioseq_Handle & | bioseq | ) |
Definition at line 581 of file utilities.cpp.
References CBioseq_set_Base::eClass_nuc_prot, and GetSetParent().
Referenced by CValidError_bioseq::ValidateBioseqContext().
CConstRef<CSeq_id> GetReportableSeqIdForAlignment | ( | const CSeq_align & | align, |
CScope & | scope | ||
) |
Definition at line 399 of file utilities.cpp.
References CScope::GetBioseqHandle(), CSeq_align_Base::C_Segs::GetDendiag(), CSeq_align_Base::GetDim(), CSeq_align_Base::GetSegs(), CSeq_align::GetSeq_id(), i, IsBioseqInSameSeqEntryAsAlign(), CSeq_align_Base::C_Segs::IsDendiag(), CSeq_align_Base::IsSetDim(), CSeq_align_Base::IsSetSegs(), and CSeq_align_Base::C_Segs::IsStd().
Referenced by GetAccessionFromObjects(), CValidError_imp::PostErr(), and CValidError_align::x_ValidateDim().
CScope::TIds GetSeqIdsForGI | ( | TGi | gi | ) |
Definition at line 142 of file utilities.cpp.
References CScope::AddDefaults(), CScope::GetIds(), CObjectManager::GetInstance(), and CSeq_id_Base::SetGi().
Referenced by CValidError_bioseq::ValidateIDSetAgainstDb().
CSeqVector GetSequenceFromFeature | ( | const CSeq_feat & | feat, |
CScope & | scope, | ||
CBioseq_Handle::EVectorCoding | coding = CBioseq_Handle::eCoding_Iupac , |
||
bool | product = false |
||
) |
Definition at line 214 of file utilities.cpp.
References CSeq_feat_Base::CanGetLocation(), CSeq_feat_Base::CanGetProduct(), CSeq_feat_Base::GetLocation(), CSeq_feat_Base::GetProduct(), and GetSequenceFromLoc().
Referenced by CGapFeatValidator::Validate(), and CSingleFeatValidator::x_ValidateRptUnitVal().
CSeqVector GetSequenceFromLoc | ( | const CSeq_loc & | loc, |
CScope & | scope, | ||
CBioseq_Handle::EVectorCoding | coding = CBioseq_Handle::eCoding_Iupac |
||
) |
Definition at line 203 of file utilities.cpp.
References CSeqMap::CreateSeqMapForSeq_loc(), and eNa_strand_plus.
Referenced by GetSequenceFromFeature(), CSingleFeatValidator::x_CalculateLocationGaps(), and CSingleFeatValidator::x_IsMostlyNs().
Definition at line 175 of file utilities.cpp.
References BioseqHandleFromLocation(), CFastaOstream::fAssembleParts, CFastaOstream::fInstantiateGaps, kEmptyStr, NStr::ReplaceInPlace(), CFastaOstream::SetFlag(), and CFastaOstream::WriteSequence().
Referenced by CGapFeatValidator::Validate(), CValidError_bioseq::ValidateRawConst(), and CRNAValidator::x_ValidateTrnaCodons().
CBioseq_set_Handle GetSetParent | ( | const CBioseq_Handle & | bioseq, |
CBioseq_set::TClass | set_class | ||
) |
Definition at line 551 of file utilities.cpp.
References CBioseq_set_Handle::GetClass(), CBioseq_Handle::GetParentEntry(), CSeq_entry_Handle::GetParentEntry(), CSeq_entry_Handle::GetSet(), GetSetParent(), CSeq_entry_Handle::IsSet(), and CBioseq_set_Handle::IsSetClass().
CBioseq_set_Handle GetSetParent | ( | const CBioseq_set_Handle & | set, |
CBioseq_set::TClass | set_class | ||
) |
Definition at line 532 of file utilities.cpp.
References CBioseq_set_Handle::GetClass(), CSeq_entry_Handle::GetParentEntry(), CSeq_entry_Handle::GetSet(), CSeq_entry_Handle::IsSet(), and CBioseq_set_Handle::IsSetClass().
Referenced by GetGenProdSetParent(), GetNucProtSetParent(), and GetSetParent().
Definition at line 958 of file utilities.cpp.
References CSeq_loc::Assign(), CScope::GetBioseqHandle(), GetBioseqIdLabel(), CBioseq_Handle::GetCompleteBioseq(), CSeq_loc::GetLabel(), CSeq_loc_Base::GetWhole(), NStr::IsBlank(), CSeq_loc_Base::IsWhole(), NStr::ReplaceInPlace(), and UpdateToBestId().
Referenced by CValidErrorFormat::GetFeatureLocationLabel(), CValidErrorFormat::GetFeatureProductLocLabel(), CCdregionValidator::MapToNTCoords(), CValidError_imp::ValidateSeqLoc(), CValidError_imp::x_CheckLoc(), CCdregionValidator::x_ValidateCodebreak(), and CValidError_graph::x_ValidateGraphLocation().
Definition at line 755 of file utilities.cpp.
References NStr::Find(), and str().
Referenced by CSingleFeatValidator::ValidateCharactersInField().
Definition at line 2481 of file utilities.cpp.
References CScope::GetBioseqHandle(), CSeq_feat_Base::GetData(), CSeq_feat_Base::GetProduct(), HasBadProteinStart(), CBioseq_Handle::IsAa(), CSeqFeatData_Base::IsCdregion(), CSeq_feat_Base::IsSetData(), CSeq_feat_Base::IsSetProduct(), and MakeSeqVectorForResidueCounting().
bool HasBadProteinStart | ( | const CSeqVector & | sv | ) |
Definition at line 2467 of file utilities.cpp.
References CSeqVector::IsInGap(), and CSeqVector::size().
Referenced by CConvertBadCdsAndRnaToMiscFeat::apply(), HasBadProteinStart(), and CValidError_bioseq::ValidateRawConst().
Definition at line 2362 of file utilities.cpp.
References CSeq_feat_Base::CanGetExcept(), CSeq_feat_Base::CanGetExcept_text(), NStr::EqualNocase(), FOR_EACH_GBQUAL_ON_FEATURE, CSeq_feat_Base::GetData(), CSeq_feat_Base::GetExcept(), CSeq_feat_Base::GetExcept_text(), CSeq_feat_Base::GetLocation(), HasBadStartCodon(), CSeqFeatData_Base::IsCdregion(), CSeq_feat_Base::IsSetData(), ReportTranslationErrors(), and TranslateCodingRegionForValidation().
Referenced by CConvertBadCdsAndRnaToMiscFeat::apply(), BOOST_AUTO_TEST_CASE(), CCDSTranslationProblems::CalculateTranslationProblems(), and GetInternalStopErrorMessage().
Definition at line 2307 of file utilities.cpp.
References eExtreme_Biological, and CSeq_loc::IsPartialStart().
Referenced by HasBadStartCodon().
Definition at line 1088 of file utilities.cpp.
References NStr::IsBlank(), isdigit(), and str().
Referenced by CProtValidator::Validate(), and CCdregionValidator::x_ValidateFeatComment().
Definition at line 2416 of file utilities.cpp.
References CSeq_feat_Base::CanGetExcept(), CSeq_feat_Base::CanGetExcept_text(), CountInternalStopCodons(), NStr::EqualNocase(), NStr::Find(), FOR_EACH_GBQUAL_ON_FEATURE, CSeq_feat_Base::GetData(), CSeq_feat_Base::GetExcept(), CSeq_feat_Base::GetExcept_text(), CSeqFeatData_Base::IsCdregion(), CSeq_feat_Base::IsSetData(), kUnclassifiedTranslationDiscrepancy, ReportTranslationErrors(), and TranslateCodingRegionForValidation().
Referenced by CConvertBadCdsAndRnaToMiscFeat::apply(), and BOOST_AUTO_TEST_CASE().
Definition at line 1966 of file utilities.cpp.
References data, NStr::EqualNocase(), and ITERATE.
Referenced by CSpecificHostRequest::AddReply(), and InterpretSpecificHostResult().
Definition at line 2673 of file utilities.cpp.
References NStr::EndsWith(), FeatureHasEnds(), CScope::GetBioseqHandle(), GetCDSProductSequence(), CSeq_feat_Base::GetLocation(), GetMismatches(), CSeq_feat_Base::GetPartial(), CBioseq_Handle::GetTSE_Handle(), CSeq_feat_Base::IsSetPartial(), and TranslateCodingRegionForValidation().
Referenced by CConvertBadCdsAndRnaToMiscFeat::apply(), and BOOST_AUTO_TEST_CASE().
Definition at line 2519 of file utilities.cpp.
References CountProteinStops(), CScope::GetBioseqHandle(), CSeq_feat_Base::GetData(), CSeq_feat_Base::GetProduct(), CBioseq_Handle::IsAa(), CSeqFeatData_Base::IsCdregion(), CSeq_feat_Base::IsSetData(), CSeq_feat_Base::IsSetProduct(), and MakeSeqVectorForResidueCounting().
Referenced by CConvertBadCdsAndRnaToMiscFeat::apply(), and BOOST_AUTO_TEST_CASE().
string InterpretSpecificHostResult | ( | const string & | host, |
const CT3Reply & | reply, | ||
const string & | orig_host = kEmptyStr |
||
) |
Definition at line 2085 of file utilities.cpp.
References FindMatchInOrgRef(), NStr::FindNoCase(), CT3Reply_Base::GetData(), CT3Reply_Base::GetError(), CT3Error_Base::GetMessage(), CT3Data_Base::GetOrg(), COrg_ref_Base::GetTaxname(), HasMisSpellFlag(), NStr::IsBlank(), IsCommonName(), CT3Reply_Base::IsData(), CT3Reply_Base::IsError(), CT3Error_Base::IsSetMessage(), and NStr::StartsWith().
Referenced by CSpecificHostRequest::AddReply().
Definition at line 3102 of file utilities.cpp.
References NStr::EqualNocase(), and first().
Referenced by CValidError_imp::ValidateAuthorsInPubequiv(), and CValidError_imp::ValidateSubmitBlock().
Definition at line 3116 of file utilities.cpp.
References NStr::EqualNocase(), and last().
Referenced by CValidError_imp::ValidateAuthorsInPubequiv(), and CValidError_imp::ValidateSubmitBlock().
Definition at line 884 of file utilities.cpp.
References CSeqdesc_Base::e_Molinfo, CMolInfo_Base::eTech_tsa, CScope::GetBioseqHandle(), CSeqdesc_Base::GetMolinfo(), CMolInfo_Base::GetTech(), and CMolInfo_Base::IsSetTech().
Referenced by CValidError_bioseq::ValidateNsAndGaps().
Definition at line 114 of file utilities.cpp.
References NStr::IsBlank(), ITERATE, and str().
Referenced by CValidError_imp::HasName().
bool IsClassInEntry | ( | const CSeq_entry & | se, |
CBioseq_set::EClass | clss | ||
) |
Definition at line 1944 of file utilities.cpp.
References data, NStr::eCase, NStr::eNocase, NStr::Equal(), and ITERATE.
Referenced by CSpecificHostRequest::AddReply(), and InterpretSpecificHostResult().
Definition at line 826 of file utilities.cpp.
References CDate_Base::GetStd(), CDate_Base::IsStd(), and t.
Referenced by BOOST_AUTO_TEST_CASE(), and CValidError_imp::ValidateSubmitBlock().
Definition at line 90 of file utilities.cpp.
References BioseqHandleFromLocation(), CBioseq_set_Base::eClass_nuc_prot, CBioseq_set_Base::eClass_parts, CSeq_inst_Base::eRepr_delta, CSeq_inst_Base::eRepr_seg, CSeq_entry_Handle::GetCompleteSeq_entry(), CBioseq_Handle::GetInst_Repr(), CBioseq_Handle::GetTopLevelEntry(), IsClassInEntry(), and CBioseq_Handle::IsSetInst_Repr().
Referenced by CCdregionValidator::x_ReportTranslationProblems().
bool IsDicistronic | ( | const CSeq_feat_Handle & | f | ) |
Definition at line 1825 of file utilities.cpp.
References f(), NStr::FindNoCase(), and NPOS.
Referenced by IsDicistronicGene().
bool IsDicistronicGene | ( | const CSeq_feat_Handle & | f | ) |
Indicates whether feature is a dicistronic gene.
f | Seq-feat-Handle [in] |
Definition at line 1818 of file utilities.cpp.
References CSeqFeatData::eSubtype_gene, f(), and IsDicistronic().
Referenced by CValidError_bioseq::x_SuppressDicistronic().
EDuplicateFeatureType IsDuplicate | ( | const CSeq_feat_Handle & | f1, |
const CSeq_feat_Handle & | f2, | ||
bool | check_partials = false , |
||
bool | case_sensitive = false |
||
) |
Reports how two features duplicate each other.
f1 | Seq-feat-Handle [in] |
f2 | Seq-feat-Handle [in] |
Definition at line 1838 of file utilities.cpp.
References Compare(), eDuplicate_Duplicate, eDuplicate_DuplicateDifferentTable, eDuplicate_Not, eDuplicate_SameIntervalDifferentLabel, eDuplicate_SameIntervalDifferentLabelDifferentTable, eSame, CSeqFeatData::eSubtype_pub, CSeqFeatData::eSubtype_region, CSeqFeatData::eSubtype_variation, fCompareOverlapping, CSeq_feat_Handle::GetData(), CSeq_feat_Handle::GetDbxref(), CSeq_feat_Handle::GetLocation(), CSeq_feat_Handle::GetScope(), CSeqFeatData::GetSubtype(), CSeq_feat_Handle::IsSetDbxref(), PartialsSame(), s_AreCodingRegionsLinkedToDifferentmRNAs(), s_AreDifferentVariations(), s_AreFeatureLabelsSame(), s_AreFullLengthCodingRegionsWithDifferentFrames(), s_AremRNAsLinkedToDifferentCodingRegions(), s_IsDifferentDbxrefs(), s_IsSameSeqAnnot(), and s_IsSameStrand().
Referenced by CRmDupFeaturesDlg::GetCommand(), GetDuplicateFeaturesForRemoval(), CRemoveFeaturesDlg::RemoveDuplicateFeatures(), and CValidError_bioseq::x_ReportDupOverlapFeaturePair().
bool IsFarLocation | ( | const CSeq_loc & | loc, |
const CSeq_entry_Handle & | seh | ||
) |
Definition at line 159 of file utilities.cpp.
References CScope::GetBioseqHandleFromTSE(), and CSeq_entry_Handle::GetScope().
Referenced by CRemoveUnindexedFeatures::apply(), CRemoveFeaturesDlg::GetProductId(), CValidError_bioseq::NumOfIntervals(), CCdsToMatPeptide::RemoveProteins(), CDesktopAlignItem::s_ContainsFarPointers(), s_IsFarLocation(), CValidError_bioseq::ValidateSeqFeatContext(), and CValidError_imp::x_IsFarFetchFailure().
Definition at line 3050 of file utilities.cpp.
References CSeqdesc_Base::e_Source, CBioseq_set_Base::eClass_nuc_prot, CBioseq_set_Base::eClass_small_genome_set, CScope::GetBioseqHandle(), CBioSource_Base::GetGenome(), CBioseq_Handle::GetParentBioseq_set(), CSeqdesc_Base::GetSource(), IsOrganelle(), and CBioSource_Base::IsSetGenome().
Referenced by BadMultipleSequenceLocation(), and CValidError_imp::IsInOrganelleSmallGenomeSet().
Definition at line 2150 of file utilities.cpp.
References NStr::Find(), CTaxon1::GetOrgRef(), CTaxon1::GetTaxIdByName(), CTaxon1::Init(), INVALID_TAX_ID, isalpha(), IsCommon(), NPOS, val, and ZERO_TAX_ID.
Referenced by CSpecificHostRequest::AddReply(), and BOOST_AUTO_TEST_CASE().
bool IsLocFullLength | ( | const CSeq_loc & | loc, |
const CBioseq_Handle & | bsh | ||
) |
Definition at line 1451 of file utilities.cpp.
References CSeq_interval_Base::GetFrom(), CBioseq_Handle::GetInst_Length(), CSeq_loc_Base::GetInt(), CSeq_interval_Base::GetTo(), and CSeq_loc_Base::IsInt().
Referenced by s_AreFullLengthCodingRegionsWithDifferentFrames(), CValidError_bioseq::x_ValidatePubFeatures(), and CValidError_bioseq::x_ValidateSourceFeatures().
Definition at line 2801 of file utilities.cpp.
References FOR_EACH_SEQID_ON_BIOSEQ, and IsNG().
Definition at line 2790 of file utilities.cpp.
References GetAccession(), and NStr::StartsWith().
Referenced by IsNG(), and CValidError_bioseq::ValidateSeqIds().
Definition at line 2777 of file utilities.cpp.
References FOR_EACH_SEQID_ON_BIOSEQ, and IsNTNCNWACAccession().
Definition at line 2766 of file utilities.cpp.
References GetAccession(), and IsNTNCNWACAccession().
Definition at line 2755 of file utilities.cpp.
References NStr::StartsWith().
Referenced by GetBioseqEndWarning(), IsNTNCNWACAccession(), CValidError_bioseq::ValidateDelta(), CValidError_bioseq::ValidateSeqIds(), and CSingleFeatValidator::x_ValidateExceptText().
bool IsOrganelle | ( | const CBioseq_Handle & | seq | ) |
Definition at line 2857 of file utilities.cpp.
References CSeqdesc_Base::e_Source, CBioSource_Base::GetGenome(), CSeqdesc_Base::GetSource(), IsOrganelle(), and CBioSource_Base::IsSetGenome().
Definition at line 2831 of file utilities.cpp.
References CBioSource_Base::eGenome_apicoplast, CBioSource_Base::eGenome_chloroplast, CBioSource_Base::eGenome_chromatophore, CBioSource_Base::eGenome_chromoplast, CBioSource_Base::eGenome_cyanelle, CBioSource_Base::eGenome_hydrogenosome, CBioSource_Base::eGenome_kinetoplast, CBioSource_Base::eGenome_leucoplast, CBioSource_Base::eGenome_mitochondrion, CBioSource_Base::eGenome_nucleomorph, CBioSource_Base::eGenome_plastid, and CBioSource_Base::eGenome_proplastid.
Referenced by CSpliceProblems::CalculateSpliceProblems(), IsInOrganelleSmallGenomeSet(), CValidError_feat::IsIntronShort(), IsOrganelle(), CAdjustForConsensusSpliceSite::s_IsBioseqGood_AdjustEnds(), CIntronValidator::Validate(), CValidError_bioseq::ValidateFeatPartialInContext(), CMRnaForCDS::x_ChkAndMakeMRna(), CIntronValidator::x_IsIntronShort(), CValidError_bioseq::x_ReportStartStopPartialProblem(), CValidError_bioseq::x_SetupCommonFlags(), and CValidError_bioseq::x_ValidateAbuttingRNA().
|
inline |
Definition at line 88 of file utilities.hpp.
Referenced by s_PartialAtGapOrNs(), CIntronValidator::Validate(), CValidError_bioseq::ValidateRawConst(), CCDSTranslationProblems::x_Is5AtEndSpliceSiteOrGap(), CValidError_bioseq::x_IsPartialAtSpliceSiteOrGap(), and CValidError_graph::x_ValidateGraphValues().
Definition at line 2714 of file utilities.cpp.
References CScope::AddDefaults(), CScope::GetBioseqHandle(), CSeq_id_Handle::GetHandle(), CScope::GetIds(), and CObjectManager::GetInstance().
Referenced by IsSequenceFetchable(), and CValidError_feat::ValidateInferenceAccession().
Definition at line 2740 of file utilities.cpp.
References IsSequenceFetchable().
returns true and error_msg will be empty, if specific host is valid returns true and error_msg will be "Host is empty", if specific host is empty returns false if specific host is invalid
Definition at line 2182 of file utilities.cpp.
References CTaxValidationAndCleanup::IsOneSpecificHostValid(), and val.
Referenced by BOOST_AUTO_TEST_CASE(), and CMakeBadSpecificHostTable::x_CheckSpecificHosts().
Definition at line 2817 of file utilities.cpp.
References NStr::EqualNocase().
Referenced by CValidError_imp::ValidateSeqLocIds(), and CValidError_bioseq::x_CheckGeneralIDs().
CRef<CSeqVector> MakeSeqVectorForResidueCounting | ( | const CBioseq_Handle & | bsh | ) |
Definition at line 2455 of file utilities.cpp.
References CSeq_data_Base::e_Ncbieaa, CSeq_data_Base::e_Ncbistdaa, CSeq_data_Base::e_not_set, CBioseq_Handle::eCoding_Iupac, CBioseq_Handle::GetInst(), CSeq_inst_Base::GetSeq_data(), CSeq_inst_Base::IsSetSeq_data(), CSeqVector::SetCoding(), and CSeq_data_Base::Which().
Referenced by HasBadProteinStart(), HasStopInProtein(), and CValidError_bioseq::ValidateRawConst().
Definition at line 1463 of file utilities.cpp.
References eExtreme_Biological, CSeq_loc::IsPartialStart(), and CSeq_loc::IsPartialStop().
Referenced by IsDuplicate(), CValidError_bioseq::x_ReportDupOverlapFeaturePair(), and CCdregionValidator::x_ValidateProductPartials().
Definition at line 2341 of file utilities.cpp.
References NStr::FindNoCase(), ITERATE, and NPOS.
Referenced by CCDSTranslationProblems::CalculateTranslationProblems(), HasBadStartCodon(), and HasInternalStop().
Definition at line 717 of file utilities.cpp.
References CObject_id::Compare(), CFeat_id_Base::GetLocal(), and CFeat_id_Base::IsLocal().
Referenced by s_IdXrefsAreReciprocal(), s_IdXrefsNotReciprocal(), and CValidError_bioseq::x_IdXrefsNotReciprocal().
Definition at line 6595 of file validerror_bioseq.cpp.
References FOR_EACH_SEQFEATXREF_ON_SEQFEAT, CSeq_feat_Base::GetId(), CFeat_id_Base::IsLocal(), CSeq_feat_Base::IsSetId(), match(), and s_FeatureIdsMatch().
Referenced by s_SetUpXrefPairs(), and CValidError_bioseq::x_IdXrefsAreReciprocal().
bool s_PartialAtGapOrNs | ( | CScope * | scope, |
const CSeq_loc & | loc, | ||
unsigned int | tag, | ||
bool | only_gap = false |
||
) |
Definition at line 1176 of file utilities.cpp.
References CBioseq_Handle::eCoding_Iupac, eNa_strand_minus, eSeqlocPartial_Nostart, eSeqlocPartial_Nostop, first(), CScope::GetBioseqHandle(), CRange_Base::GetFrom(), CSeq_loc::GetId(), CSeq_loc_CI::GetRange(), CSeq_loc_CI::GetRangeAsSeq_loc(), CBioseq_Handle::GetSeqVector(), CSeq_loc_CI::GetStrand(), CRange_Base::GetTo(), isalpha(), CSeqVector::IsInGap(), IsResidue(), last(), len, result, CSeqVector::size(), swap(), and tag.
Referenced by CValidError_bioseq::ValidateFeatPartialInContext(), and CCDSTranslationProblems::x_CheckCDSFrame().
Definition at line 727 of file utilities.cpp.
References NStr::Find(), NStr::IsBlank(), isdigit(), and str().
Referenced by CValidError_desc::ValidateTitle(), and CProtValidator::x_ValidateProteinName().
Definition at line 1155 of file utilities.cpp.
References FOR_EACH_SEQID_ON_BIOSEQ.
Referenced by CValidError_imp::AddBioseqWithNoBiosource(), CValidError_imp::AddProtWithoutFullRef(), CValidError_bioseq::CheckForMissingChromosome(), SeqIsPatent(), CValidError_bioseq::ValidateBioseqContext(), CValidError_bioseq::ValidateNsAndGaps(), CValidError_bioseq::ValidateSeqDescContext(), CValidError_bioseq::ValidateSeqFeatContext(), and CValidError_bioseq::ValidateSeqIds().
bool SeqIsPatent | ( | const CBioseq_Handle & | seq | ) |
Definition at line 1170 of file utilities.cpp.
References CBioseq_Handle::GetCompleteBioseq(), and SeqIsPatent().
bool ShouldCheckForNsAndGap | ( | const CBioseq_Handle & | bsh | ) |
Definition at line 1307 of file utilities.cpp.
References CSeq_inst_Base::eTopology_circular, CBioseq_Handle::GetInst_Length(), CBioseq_Handle::GetInst_Topology(), and CBioseq_Handle::IsSetInst_Topology().
Referenced by CheckBioseqEndsForNAndGap(), s_WillReportTerminalGap(), and CValidError_bioseq::ValidateNsAndGaps().
Definition at line 2042 of file utilities.cpp.
References AdjustSpecificHostForTaxServer(), NStr::Find(), NStr::IsBlank(), isupper(), kEmptyStr, NStr::StartsWith(), NStr::TruncateSpacesInPlace(), and val.
Referenced by CSpecificHostRequest::CSpecificHostRequest().
string TranslateCodingRegionForValidation | ( | const CSeq_feat & | feat, |
CScope & | scope, | ||
bool & | alt_start | ||
) |
Definition at line 2266 of file utilities.cpp.
References CSerialObject::Assign(), FixGeneticCode(), CScope::GetBioseqHandle(), CSeqFeatData_Base::GetCdregion(), CCdregion_Base::GetCode(), CSeq_feat_Base::GetData(), CCdregion_Base::GetFrame(), CBioseq_Handle::GetInst_Length(), CSeq_feat_Base::GetLocation(), CSeq_loc_Base::GetWhole(), CCdregion_Base::IsSetCode(), CCdregion_Base::IsSetFrame(), CSeq_loc_Base::IsWhole(), kEmptyStr, CSeq_feat_Base::SetData(), tmp, and CSeqTranslator::Translate().
Referenced by CCDSTranslationProblems::CalculateTranslationProblems(), HasBadStartCodon(), HasInternalStop(), HasNoStop(), and CCDSTranslationProblems::x_IsThreeBaseNonsense().
EAccessionFormatError ValidateAccessionString | ( | const string & | accession, |
bool | require_version | ||
) |
Definition at line 624 of file utilities.cpp.
References eAccessionFormat_bad_version, eAccessionFormat_missing_version, eAccessionFormat_no_start_letters, eAccessionFormat_null, eAccessionFormat_too_long, eAccessionFormat_valid, eAccessionFormat_wrong_number_of_digits, isalpha(), NStr::IsBlank(), isdigit(), isupper(), NStr::StartsWith(), and str().
Referenced by CValidError_bioseq::ValidateSeqId(), CSingleFeatValidator::x_ValidateCompareVal(), and CSingleFeatValidator::x_ValidateSeqFeatProduct().