NCBI C++ ToolKit
Classes | Typedefs | Enumerations | Functions
biosample_util.hpp File Reference
#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>
+ Include dependency graph for biosample_util.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Go to the SVN repository for this file.


class  CBiosampleFieldDiff


typedef map< string, CRef< CSeq_descr > > TBioSamples
typedef map< string, CRef< CSeq_descr > >::iterator TBioSamplesIterator
typedef map< string, EStatusTStatuses
typedef map< string, EStatus >::iterator TStatusesIterator
typedef pair< string, biosample_util::EStatusTStatus
typedef vector< CRef< CBiosampleFieldDiff > > TBiosampleFieldDiffList


enum  EStatus {
  eStatus_Unknown = 0 , eStatus_Live , eStatus_Hup , eStatus_Withdrawn ,
  eStatus_Suppressed , eStatus_ToBeCurated , eStatus_Replaced


CRef< CSeq_descrGetBiosampleData (const string &accession, bool use_dev_server=false, TBioSamples *cache=NULL)
EStatus GetBiosampleStatus (const string &accession, bool use_dev_server=false, TStatuses *cache=NULL)
void GetBiosampleStatus (TStatuses &status, bool use_dev_server=false)
string GetBiosampleStatusName (EStatus status)
vector< stringGetBiosampleIDs (CBioseq_Handle bh)
vector< stringGetBioProjectIDs (CBioseq_Handle bh)
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)
TBiosampleFieldDiffList GetFieldDiffs (const string &sequence_id, const string &biosample_id, const CBioSource &src, const CBioSource &sample)
TBiosampleFieldDiffList GetFieldDiffs (const string &sequence_id, const string &biosample_id, CConstRef< CUser_object > src, CConstRef< CUser_object > sample)
bool ResolveSuppliedBioSampleAccession (const string &biosample_accession, vector< string > &biosample_ids)
bool DoDiffsContainConflicts (const TBiosampleFieldDiffList &diffs, CNcbiOstream *log)
void AddBioseqToTable (CBioseq_Handle bh, CSeq_table &table, bool with_id, bool include_comments=false, const string &expected_prefix="")
string GetBestBioseqLabel (CBioseq_Handle bsh)
bool AttributeNamesAreEquivalent (string name1, string name2)
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)
string OwnerFromAffil (const CAffil &affil)
void GenerateDiffListFromBioSource (const CSeq_descr &bioSample, const CBioSource &bioSource, TBiosampleFieldDiffList &diffs)
bool GenerateDiffListFromBioSource (const string &bioSampleAcc, const CBioSource &bioSource, CBioSource &bioSampleSource, TBiosampleFieldDiffList &diffs)
bool UpdateBiosourceFromBiosample (const CBioSource &existingBioSource, CBioSource &newBioource)
bool UpdateBiosourceFromBiosample (const TBiosampleFieldDiffList &diffs, const CBioSource &existingBioSource, CBioSource &newBioource)
void PrettyPrint (const TBiosampleFieldDiffList &diffList, CNcbiOstream &ostr, size_t keyWidth=20, size_t valueWidth=40)

Typedef Documentation

◆ TBiosampleFieldDiffList

Definition at line 119 of file biosample_util.hpp.

◆ TBioSamples

Definition at line 52 of file biosample_util.hpp.

◆ TBioSamplesIterator

typedef map< string, CRef< CSeq_descr > >::iterator TBioSamplesIterator

Definition at line 53 of file biosample_util.hpp.

◆ TStatus

Definition at line 69 of file biosample_util.hpp.

◆ TStatuses

Definition at line 67 of file biosample_util.hpp.

◆ TStatusesIterator

typedef map<string, EStatus>::iterator TStatusesIterator

Definition at line 68 of file biosample_util.hpp.

Enumeration Type Documentation

◆ EStatus

enum EStatus

Definition at line 57 of file biosample_util.hpp.

Function Documentation

◆ AddBioseqToTable()

void AddBioseqToTable ( CBioseq_Handle  bh,
CSeq_table table,
bool  with_id,
bool  include_comments = false,
const string expected_prefix = "" 

◆ AttributeNamesAreEquivalent()

bool AttributeNamesAreEquivalent ( string  name1,
string  name2 

Definition at line 842 of file biosample_util.cpp.

References NStr::EqualNocase(), and HarmonizeAttributeName().

Referenced by AddStructuredCommentToAttributes().

◆ DoDiffsContainConflicts()

bool DoDiffsContainConflicts ( const TBiosampleFieldDiffList diffs,
CNcbiOstream log 

Definition at line 601 of file biosample_util.cpp.

References NStr::IsBlank(), ITERATE, and log.

Referenced by CBiosampleChkApp::ProcessBioseqHandle().

◆ GenerateDiffListFromBioSource() [1/2]

void GenerateDiffListFromBioSource ( const CSeq_descr bioSample,
const CBioSource bioSource,
TBiosampleFieldDiffList diffs 

◆ GenerateDiffListFromBioSource() [2/2]

bool GenerateDiffListFromBioSource ( const string bioSampleAcc,
const CBioSource bioSource,
CBioSource bioSampleSource,
TBiosampleFieldDiffList diffs 

◆ GetBestBioseqLabel()

string GetBestBioseqLabel ( CBioseq_Handle  bsh)

◆ GetBioProjectIDs()

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().

◆ GetBiosampleData()

CRef< CSeq_descr > GetBiosampleData ( const string accession,
bool  use_dev_server = false,
TBioSamples cache = NULL 

◆ GetBiosampleIDs()

vector<string> GetBiosampleIDs ( CBioseq_Handle  bh)

◆ GetBiosampleStatus() [1/2]

EStatus GetBiosampleStatus ( const string accession,
bool  use_dev_server = false,
TStatuses cache = NULL 

◆ GetBiosampleStatus() [2/2]

void GetBiosampleStatus ( TStatuses status,
bool  use_dev_server = false 

◆ GetBiosampleStatusName()

string GetBiosampleStatusName ( EStatus  status)

◆ GetBioseqDiffs()

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 

◆ GetFieldDiffs() [1/2]

TBiosampleFieldDiffList GetFieldDiffs ( const string sequence_id,
const string biosample_id,
CConstRef< CUser_object src,
CConstRef< CUser_object sample 

◆ GetFieldDiffs() [2/2]

TBiosampleFieldDiffList GetFieldDiffs ( const string sequence_id,
const string biosample_id,
const CBioSource src,
const CBioSource sample 

Definition at line 510 of file biosample_util.cpp.

References CBioSource::GetBiosampleDiffs(), and ITERATE.

Referenced by GenerateDiffListFromBioSource(), and GetBioseqDiffs().

◆ OwnerFromAffil()

string OwnerFromAffil ( const CAffil affil)

◆ PrettyPrint()

void PrettyPrint ( const TBiosampleFieldDiffList diffList,
CNcbiOstream ostr,
size_t  keyWidth = 20,
size_t  valueWidth = 40 

Definition at line 1599 of file biosample_util.cpp.

References sPrintField(), and string.

Referenced by PrintDiffList().

◆ PrintBioseqXML()

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 

◆ ResolveSuppliedBioSampleAccession()

bool ResolveSuppliedBioSampleAccession ( const string biosample_accession,
vector< string > &  biosample_ids 

◆ UpdateBiosourceFromBiosample() [1/2]

bool UpdateBiosourceFromBiosample ( const CBioSource existingBioSource,
CBioSource newBioource 

◆ UpdateBiosourceFromBiosample() [2/2]

bool UpdateBiosourceFromBiosample ( const TBiosampleFieldDiffList diffs,
const CBioSource existingBioSource,
CBioSource newBioource 
Modified on Fri Jan 05 07:24:52 2024 by rev. 669887