75 #define NCBI_USE_ERRCODE_X Objects_Bioseq
102 switch ( loc.
Which() ) {
108 dseq->SetLoc().SetInt().Assign(**ii);
109 ext.
Set().push_back(dseq);
122 pnt_loc->
SetPnt().SetStrand(
126 dseq->SetLoc(*pnt_loc);
143 SerialAssign<CSeq_loc>(*cp_loc, loc);
158 if ( str_id.empty() ) {
162 id->SetLocal().SetStr(str_id);
198 return taxid_from_source !=
ZERO_TAX_ID ? taxid_from_source : taxid_from_org;
212 id =
GetId().begin()->GetPointer();
215 switch (sid.
Which()) {
246 id->WriteAsFasta(os);
256 if (!
label->empty()) {
261 tv = CSeq_inst::GetTypeInfo_enum_ERepr();
263 tv = CSeq_inst::GetTypeInfo_enum_EMol();
278 return *
GetId().begin();
288 return id->BestRankScore();
308 if ((*it)->CheckNumRows() != 2) {
315 const CSeq_id& id1 = (*it)->GetSeq_id(0);
316 const CSeq_id& id2 = (*it)->GetSeq_id(1);
333 return id->BestRankScore();
339 if (
id.NotEmpty() && id->
IsLocal()) {
373 switch (data.
Which()) {
376 #define CODING_CASE(x) \
377 case CSeq_data::e_##x: \
378 src.assign(&data.Get##x().Get()[0], data.Get##x().Get().size()); \
396 if (ext.
Get().size() > 1) {
409 #undef NCBI_USE_ERRCODE_X
static int s_BestLocalRank(const CRef< CSeq_id > &id)
static int s_BestNonLocalRank(const CRef< CSeq_id > &id)
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.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
const CSeq_id * GetNonLocalId() const
Find a non-local ID if present, consulting assembly details if all IDs for the overall sequence are l...
virtual bool UserOp_Equals(const CSerialUserOp &object) const
Will be called after comparing the datatool-generated members.
const CSeq_id * GetFirstId() const
static void x_SeqLoc_To_DeltaExt(const CSeq_loc &loc, CDelta_ext &ext)
TSeqPos GetLength(void) const
void GetLabel(string *label, ELabelType type, bool worst=false) const
bool IsSetLength(void) const
const CSeq_id * GetLocalId() const
Find a local ID if present.
TTaxId GetTaxId() const
Determine the tax-id for this bioseq.
virtual void UserOp_Assign(const CSerialUserOp &source)
Will be called after copying the datatool-generated members.
void PackAsDeltaSeq(bool gaps_ok=false)
Convert a raw nucleotide sequence with occasional ambiguities or gaps into a tighter (but somewhat mo...
static int sm_ConstructedId
void AddAndSplit(const CTempString &src, CSeq_data::E_Choice format, TSeqPos length, bool gaps_ok=false, bool allow_packing=true)
add a chunk of sequence, splitting it as necessary for the sake of compactness (isolating ambiguous p...
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
static bool IsAa(EMol mol)
static bool IsNa(EMol mol)
Base class for user-defined serializable classes to allow for objects assignment and comparison.
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
bool Empty(const CNcbiOstrstream &src)
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
SStrictId_Tax::TId TTaxId
Taxon id type.
#define ERR_POST_X(err_subcode, message)
Error posting with default error code and given error subcode.
void Warning(CExceptionArgs_Base &args)
const string & FindName(TEnumValueType value, bool allowBadValue) const
Find name of the enum by its numeric value.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Optimized implementation of CSerialObject::Assign, which is not so efficient.
bool Match(const CSeq_id &sid2) const
Match() - TRUE if SeqIds are equivalent.
static int WorstRank(const CRef< CSeq_id > &id)
const CTextseq_id * GetTextseq_Id(void) const
Return embedded CTextseq_id, if any.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
C::value_type FindBestChoice(const C &container, F score_func)
Find the best choice (lowest score) for values in a container.
static const char label[]
bool IsSetOrg(void) const
Check if a value has been assigned to Org data member.
const TOrg & GetOrg(void) const
Get the Org member data.
TStr & SetStr(void)
Select the variant.
bool IsSetAccession(void) const
Check if a value has been assigned to Accession data member.
list< CRef< CSeq_interval > > Tdata
const Tdata & Get(void) const
Get the member data.
TStrand GetStrand(void) const
Get the Strand member data.
bool IsSetStrand(void) const
Check if a value has been assigned to Strand data member.
list< CRef< CSeq_loc > > Tdata
E_Choice Which(void) const
Which variant is currently selected.
const TId & GetId(void) const
Get the Id member data.
E_Choice Which(void) const
Which variant is currently selected.
const Tdata & Get(void) const
Get the member data.
const TPacked_pnt & GetPacked_pnt(void) const
Get the variant data.
vector< TSeqPos > TPoints
TLocal & SetLocal(void)
Select the variant.
void ResetName(void)
Reset Name data member.
bool IsLocal(void) const
Check if variant Local is selected.
const TPoints & GetPoints(void) const
Get the Points member data.
const TMix & GetMix(void) const
Get the variant data.
const TPacked_int & GetPacked_int(void) const
Get the variant data.
@ e_Other
for historical reasons, 'other' = 'refseq'
list< CRef< CSeqdesc > > Tdata
TId & SetId(void)
Assign a value to Id data member.
list< CRef< CSeq_align > > TAssembly
bool IsSetSeq_data(void) const
the sequence Check if a value has been assigned to Seq_data data member.
const TInst & GetInst(void) const
Get the Inst member data.
TLoc & SetLoc(void)
Select the variant.
bool IsOrg(void) const
Check if variant Org is selected.
void SetExt(TExt &value)
Assign a value to Ext data member.
const TSource & GetSource(void) const
Get the variant data.
bool IsSource(void) const
Check if variant Source is selected.
const TId & GetId(void) const
Get the Id member data.
bool IsSetExt(void) const
extensions for special types Check if a value has been assigned to Ext data member.
Tdata & Set(void)
Assign a value to data member.
TLength GetLength(void) const
Get the Length member data.
const TOrg & GetOrg(void) const
Get the variant data.
const TAssembly & GetAssembly(void) const
Get the Assembly member data.
list< CRef< CSeq_id > > TId
static string SelectionName(E_Choice index)
Retrieve selection name (for diagnostic purposes).
TInst & SetInst(void)
Assign a value to Inst data member.
bool IsSetLength(void) const
length of sequence in residues Check if a value has been assigned to Length data member.
bool CanGetHist(void) const
Check if it is safe to call GetHist method.
const THist & GetHist(void) const
Get the Hist member data.
bool IsSetDescr(void) const
descriptors Check if a value has been assigned to Descr data member.
void SetRepr(TRepr value)
Assign a value to Repr data member.
const Tdata & Get(void) const
Get the member data.
void ResetExt(void)
Reset Ext data member.
const TSeq_data & GetSeq_data(void) const
Get the Seq_data member data.
const TDescr & GetDescr(void) const
Get the Descr member data.
void SetMol(TMol value)
Assign a value to Mol data member.
void ResetSeq_data(void)
Reset Seq_data data member.
E_Choice Which(void) const
Which variant is currently selected.
bool CanGetAssembly(void) const
Check if it is safe to call GetAssembly method.
@ eRepr_const
constructed sequence
@ eRepr_delta
sequence made by changes (delta) to others
@ e_Ncbi2na
2 bit nucleic acid code
Definition of all error codes used in objects libraries.
const TYPE & Get(const CNamedParameterList *param)
constexpr bool empty(list< Ts... >) noexcept
Useful/utility classes and methods.