NCBI C++ ToolKit
|
#include <corelib/ncbistd.hpp>
#include <corelib/ncbistr.hpp>
#include <objects/seq/Seq_descr.hpp>
#include <objects/seq/Seqdesc.hpp>
#include <objects/seqfeat/BioSource.hpp>
#include <objects/seqtable/Seq_table.hpp>
#include <objects/seqtable/SeqTable_column.hpp>
#include <objmgr/bioseq_handle.hpp>
Go to the source code of this file.
Go to the SVN repository for this file.
Classes | |
class | CBiosampleFieldDiff |
Typedefs | |
typedef map< string, CRef< CSeq_descr > > | TBioSamples |
typedef map< string, CRef< CSeq_descr > >::iterator | TBioSamplesIterator |
typedef map< string, EStatus > | TStatuses |
typedef map< string, EStatus >::iterator | TStatusesIterator |
typedef pair< string, biosample_util::EStatus > | TStatus |
typedef vector< CRef< CBiosampleFieldDiff > > | TBiosampleFieldDiffList |
Enumerations | |
enum | EStatus { eStatus_Unknown = 0 , eStatus_Live , eStatus_Hup , eStatus_Withdrawn , eStatus_Suppressed , eStatus_ToBeCurated , eStatus_Replaced } |
typedef vector< CRef<CBiosampleFieldDiff> > TBiosampleFieldDiffList |
Definition at line 119 of file biosample_util.hpp.
typedef map< string, CRef< CSeq_descr > > TBioSamples |
Definition at line 52 of file biosample_util.hpp.
typedef map< string, CRef< CSeq_descr > >::iterator TBioSamplesIterator |
Definition at line 53 of file biosample_util.hpp.
typedef pair<string, biosample_util::EStatus> TStatus |
Definition at line 69 of file biosample_util.hpp.
typedef map<string, EStatus>::iterator TStatusesIterator |
Definition at line 68 of file biosample_util.hpp.
enum EStatus |
Enumerator | |
---|---|
eStatus_Unknown | |
eStatus_Live | |
eStatus_Hup | |
eStatus_Withdrawn | |
eStatus_Suppressed | |
eStatus_ToBeCurated | |
eStatus_Replaced |
Definition at line 57 of file biosample_util.hpp.
void AddBioseqToTable | ( | CBioseq_Handle | bh, |
CSeq_table & | table, | ||
bool | with_id, | ||
bool | include_comments = false , |
||
const string & | expected_prefix = "" |
||
) |
Definition at line 751 of file biosample_util.cpp.
References AddValueToTable(), CSeqdesc_Base::e_Pub, CSeqdesc_Base::e_Source, CSeqdesc_Base::e_User, eUnknown, CPub_equiv_Base::Get(), CAffil_Base::C_Std::GetAffil(), GetBestBioseqLabel(), GetBioProjectIDs(), GetBiosampleIDs(), CAffil_Base::C_Std::GetDiv(), CBioSource::GetNameValPairs(), CPubdesc_Base::GetPub(), CSeqdesc_Base::GetPub(), CSeqdesc_Base::GetSource(), CAffil_Base::GetStd(), CAffil_Base::GetStr(), GetStructuredCommentFields(), CSeqdesc_Base::GetUser(), i, int, CAffil_Base::C_Std::IsSetAffil(), CAffil_Base::C_Std::IsSetDiv(), CAffil_Base::IsStd(), CAffil_Base::IsStr(), ITERATE, kAffilDept, kAffilInst, kBioProject, kSequenceID, label, msg(), NCBI_THROW, row, s_IsCitSub(), s_IsReportableStructuredComment(), table, and val.
Referenced by CBiosampleChkApp::ProcessBioseqHandle().
Definition at line 847 of file biosample_util.cpp.
References NStr::EqualNocase(), and HarmonizeAttributeName().
Referenced by AddStructuredCommentToAttributes().
bool DoDiffsContainConflicts | ( | const TBiosampleFieldDiffList & | diffs, |
CNcbiOstream * | log | ||
) |
Definition at line 606 of file biosample_util.cpp.
References NStr::IsBlank(), ITERATE, and log.
Referenced by CBiosampleChkApp::ProcessBioseqHandle().
void GenerateDiffListFromBioSource | ( | const CSeq_descr & | bioSample, |
const CBioSource & | bioSource, | ||
TBiosampleFieldDiffList & | diffs | ||
) |
Definition at line 1394 of file biosample_util.cpp.
References CSeq_descr_Base::Get(), GetFieldDiffs(), CSeqdesc_Base::GetSource(), and CSeqdesc_Base::IsSource().
Referenced by CompareBioSampleAccessionToBioSource(), GenerateDiffListFromDescriptors(), and CBsDiffApp::xCompareSeqEntry().
bool GenerateDiffListFromBioSource | ( | const string & | bioSampleAcc, |
const CBioSource & | bioSource, | ||
CBioSource & | bioSampleSource, | ||
TBiosampleFieldDiffList & | diffs | ||
) |
Definition at line 1431 of file biosample_util.cpp.
References CSerialObject::Assign(), CSeq_descr_Base::Get(), GetBiosampleData(), GetFieldDiffs(), CSeqdesc_Base::GetSource(), CSeqdesc_Base::IsSource(), and SaveSerialObject().
string GetBestBioseqLabel | ( | CBioseq_Handle | bsh | ) |
Definition at line 881 of file biosample_util.cpp.
References CSeq_id::BestRank(), FindBestChoice(), CBioseq_Handle::GetId(), CConstRef< C, Locker >::GetPointer(), CSeq_id_Base::IsGenbank(), ITERATE, label, and NULL.
Referenced by AddBioseqToTable(), GetBioseqDiffs(), PrintBioseqXML(), CBiosampleChkApp::ProcessBioseqForUpdate(), and CBiosampleChkApp::ProcessBioseqHandle().
vector<string> GetBioProjectIDs | ( | CBioseq_Handle | bh | ) |
Definition at line 343 of file biosample_util.cpp.
References CSeqdesc_Base::e_User, GetDBLinkIDs(), and ITERATE.
Referenced by AddBioseqToTable(), and PrintBioseqXML().
CRef< CSeq_descr > GetBiosampleData | ( | const string & | accession, |
bool | use_dev_server = false , |
||
TBioSamples * | cache = NULL |
||
) |
Definition at line 93 of file biosample_util.cpp.
References map_checker< Container >::end(), map_checker< Container >::find(), NStr::IntToString(), NULL, PrepareUrl(), and CRef< C, Locker >::Reset().
Referenced by BOOST_AUTO_TEST_CASE(), GenerateDiffListFromBioSource(), GetBioseqDiffs(), LoadBioSampleFromAcc(), and CBiosampleChkApp::ProcessBioseqForUpdate().
vector<string> GetBiosampleIDs | ( | CBioseq_Handle | bh | ) |
Definition at line 327 of file biosample_util.cpp.
References ITERATE.
Referenced by AddBioseqToTable(), GetBioseqDiffs(), PrintBioseqXML(), CBiosampleStatusReport::ProcessBioseq(), and CBiosampleChkApp::ProcessBioseqForUpdate().
EStatus GetBiosampleStatus | ( | const string & | accession, |
bool | use_dev_server = false , |
||
TStatuses * | cache = NULL |
||
) |
Definition at line 184 of file biosample_util.cpp.
References xml::node::begin(), map_checker< Container >::end(), xml::node::end(), NStr::Equal(), eStatus_Unknown, map_checker< Container >::find(), xml::node::get_name(), xml::document::get_root_node(), GetBioSampleStatusFromNode(), PrepareUrl(), and ProcessBiosampleStatusNode().
Referenced by CBiosampleStatusReport::AddSummary(), and CBiosampleChkApp::Run().
Definition at line 245 of file biosample_util.cpp.
References map_checker< Container >::begin(), count, map_checker< Container >::end(), NStr::IsBlank(), and ProcessBulkBioSample().
Definition at line 264 of file biosample_util.cpp.
References eStatus_Hup, eStatus_Live, eStatus_Replaced, eStatus_Suppressed, eStatus_ToBeCurated, eStatus_Unknown, eStatus_Withdrawn, and kEmptyStr.
Referenced by CBiosampleStatusReport::AddSummary(), and CBiosampleChkApp::Run().
TBiosampleFieldDiffList GetBioseqDiffs | ( | CBioseq_Handle | bh, |
const string & | biosample_accession, | ||
size_t & | num_processed, | ||
vector< string > & | unprocessed_ids, | ||
bool | use_dev_server = false , |
||
bool | compare_structured_comments = false , |
||
const string & | expected_prefix = "" , |
||
TBioSamples * | cache = NULL |
||
) |
Definition at line 907 of file biosample_util.cpp.
References CSeqdesc_Base::e_Source, CSeqdesc_Base::e_User, NStr::EqualNocase(), eUnknown, CSeq_descr_Base::Get(), GetBestBioseqLabel(), GetBiosampleData(), GetBiosampleIDs(), GetFieldDiffs(), CSeqdesc_Base::GetSource(), CComment_rule::GetStructuredCommentPrefix(), CSeqdesc_Base::GetUser(), ITERATE, msg(), NCBI_THROW, NULL, ResolveSuppliedBioSampleAccession(), and s_IsReportableStructuredComment().
Referenced by CBiosampleChkApp::GetBioseqDiffs(), and CCompareWithBiosample::x_LoadData().
TBiosampleFieldDiffList GetFieldDiffs | ( | const string & | sequence_id, |
const string & | biosample_id, | ||
CConstRef< CUser_object > | src, | ||
CConstRef< CUser_object > | sample | ||
) |
Definition at line 573 of file biosample_util.cpp.
References GetAvailableFields(), ITERATE, and s_ShouldIgnoreStructuredCommentFieldDiff().
TBiosampleFieldDiffList GetFieldDiffs | ( | const string & | sequence_id, |
const string & | biosample_id, | ||
const CBioSource & | src, | ||
const CBioSource & | sample | ||
) |
Definition at line 515 of file biosample_util.cpp.
References CBioSource::GetBiosampleDiffs(), and ITERATE.
Referenced by GenerateDiffListFromBioSource(), and GetBioseqDiffs().
Definition at line 1168 of file biosample_util.cpp.
References NStr::EqualNocase(), CAffil_Base::C_Std::GetAffil(), CAffil_Base::C_Std::GetDiv(), CAffil_Base::GetStd(), CAffil_Base::GetStr(), CAffil_Base::C_Std::IsSetAffil(), CAffil_Base::C_Std::IsSetDiv(), CAffil_Base::IsStd(), CAffil_Base::IsStr(), and NStr::Join().
Referenced by PrintBioseqXML(), and CBiosampleChkApp::ProcessSeqSubmit().
void PrettyPrint | ( | const TBiosampleFieldDiffList & | diffList, |
CNcbiOstream & | ostr, | ||
size_t | keyWidth = 20 , |
||
size_t | valueWidth = 40 |
||
) |
Definition at line 1604 of file biosample_util.cpp.
References sPrintField(), and string.
Referenced by PrintDiffList().
void PrintBioseqXML | ( | CBioseq_Handle | bh, |
const string & | id_prefix, | ||
CNcbiOstream * | report_stream, | ||
const string & | bioproject_accession, | ||
const string & | default_owner, | ||
const string & | hup_date, | ||
const string & | comment, | ||
bool | first_seq_only, | ||
bool | report_structured_comments, | ||
const string & | expected_prefix | ||
) |
Definition at line 1190 of file biosample_util.cpp.
References AddBioSourceToAttributes(), AddContact(), AddStructuredCommentToAttributes(), data, CSeqdesc_Base::e_Pub, CSeqdesc_Base::e_Source, CSeqdesc_Base::e_User, CTime::eCurrent, NStr::EqualNocase(), eUnknown, CPub_equiv_Base::Get(), xml::node::get_attributes(), xml::document::get_root_node(), CAuth_list_Base::GetAffil(), GetBestBioseqLabel(), GetBioProjectIDs(), GetBiosampleIDs(), CPubdesc_Base::GetPub(), CSeqdesc_Base::GetPub(), CSeqdesc_Base::GetSource(), CSeqdesc_Base::GetUser(), xml::attributes::insert(), xml::node::insert(), NStr::IsBlank(), CAuth_list_Base::IsSetAffil(), CPubdesc_Base::IsSetPub(), ITERATE, msg(), NCBI_THROW, NULL, OwnerFromAffil(), NStr::ReplaceInPlace(), s_IsReportableStructuredComment(), xml::document::set_encoding(), and xml::document::set_is_standalone().
Referenced by CBiosampleChkApp::ProcessBioseqHandle().
bool ResolveSuppliedBioSampleAccession | ( | const string & | biosample_accession, |
vector< string > & | biosample_ids | ||
) |
Definition at line 855 of file biosample_util.cpp.
References NStr::EqualNocase(), NStr::IsBlank(), and ITERATE.
Referenced by GetBioseqDiffs(), and CBiosampleChkApp::ProcessBioseqForUpdate().
bool UpdateBiosourceFromBiosample | ( | const CBioSource & | existingBioSource, |
CBioSource & | newBioource | ||
) |
Definition at line 1467 of file biosample_util.cpp.
References CSerialObject::Assign(), COrgName_Base::GetMod(), CBioSource_Base::GetOrg(), COrg_ref_Base::GetOrgname(), CBioSource_Base::GetSubtype(), COrg_ref::GetTaxId(), CBioSource::HasSubtype(), CBioSource_Base::IsSetOrg(), COrg_ref_Base::IsSetOrgname(), CBioSource_Base::IsSetSubtype(), CBioSource::IsSetTaxname(), CBioSource_Base::SetOrg(), CBioSource_Base::SetSubtype(), and ZERO_TAX_ID.
bool UpdateBiosourceFromBiosample | ( | const TBiosampleFieldDiffList & | diffs, |
const CBioSource & | existingBioSource, | ||
CBioSource & | newBioource | ||
) |
Definition at line 1546 of file biosample_util.cpp.
References COrgName_Base::GetMod(), CBioSource_Base::GetOrg(), COrg_ref_Base::GetOrgname(), CBioSource_Base::GetSubtype(), CSubSource::GetSubtypeName(), COrgMod::GetSubtypeName(), CBioSource_Base::IsSetOrg(), COrg_ref_Base::IsSetOrgname(), CBioSource_Base::IsSetSubtype(), CBioSource_Base::SetOrg(), CBioSource_Base::SetSubtype(), sGetDiffByFieldName(), and ZERO_TAX_ID.