64 switch (
data.Which()) {
65 #define CODING_CASE(x) \
66 case CSeq_data::e_##x: \
67 src.assign(&data.Get##x().Get()[0], data.Get##x().Get().size()); \
68 src_coding = CSeqUtil::e_##x; \
69 CSeqConvert::Convert(src, src_coding, 0, len, decoded, dst_coding); \
92 if (!Make_Iupacna(
data, decoded,
len))
116 if (
delta.GetLiteral().IsSetSeq_data())
124 if (
delta.IsLiteral() &&
delta.GetLiteral().IsSetSeq_data())
130 CloneLiteral(
delta, ext, gap_start);
153 if (
delta->IsLiteral())
156 if (!
delta->GetLiteral().IsSetLength())
161 if (gap_start < lit_len)
172 it = ext.
Set().erase(it);
173 ext.
Set().insert(it, new_ext.
Set().begin(), new_ext.
Set().end());
179 if (lit_len > gap_start)
181 gap_start -= lit_len;
201 if (ext.
Get().size() > 1) {
218 m_gap_type(gap_type),
219 m_DefaultEvidence(evidences),
221 m_gap_Unknown_length(gap_Unknown_length)
232 m_gap_type(gap_type),
233 m_DefaultEvidence(defaultEvidence),
234 m_GapsizeToEvidenceMap(countToEvidenceMap),
236 m_gap_Unknown_length(gap_Unknown_length)
267 if (!Make_Iupacna(
data, decoded,
len))
307 if (ext.
Get().size() > 1) {
335 dst_data.
Set().clear();
339 if (!(**it).IsLiteral())
341 dst_data.
Set().push_back(*it);
355 dst_data.
Set().push_back(*it);
372 if (length_unknown) {
384 const auto& evidenceSet =
389 if (evidenceSet.empty()) {
393 for (
const auto& evidence : evidenceSet) {
395 pEvidence->SetType(evidence);
396 gap.
SetSeq_data().SetGap().SetLinkage_evidence().emplace_back(std::move(pEvidence));
408 switch(entry.
Which())
431 delta_seq->SetLiteral().SetSeq_data(bioseq.
SetInst().SetSeq_data());
432 delta_seq->SetLiteral().SetLength(
len);
433 delta_ext.
Set().push_back(delta_seq);
434 bioseq.
SetInst().ResetSeq_data();
446 bioseq.
SetInst().SetExt().SetDelta().Set().push_back(delta_seq);
452 auto& delta_set = parent.
SetInst().SetExt().SetDelta().Set();
453 if (!delta_set.empty() && delta_set.back()->GetLiteral().IsSetSeq_data())
459 delta_set.splice(delta_set.end(), bioseq.
SetInst().SetExt().SetDelta().Set());
463 delta_seq->SetLiteral().SetSeq_data(bioseq.
SetInst().SetSeq_data());
465 delta_set.push_back(delta_seq);
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.
TSeqPos GetLength(void) const
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...
CDelta_seq & AddLiteral(TSeqPos len)
add a literal segment at the end this variant adds a gap literal
CRef< CDelta_seq > CreateGap(CBioseq &bioseq, TSeqPos gap_start, TSeqPos gap_length)
void AppendGap(CBioseq &bioseq)
void ConvertBioseqToDelta(CBioseq &bioseq)
TSeqPos m_gap_Unknown_length
void AddBioseqAsLiteral(CBioseq &parent, CBioseq &seqset)
TEvidenceSet m_DefaultEvidence
void ConvertNs2Gaps(CSeq_entry &entry)
void x_SetGapParameters(CDelta_seq &gap)
CGapsEditor(CSeq_gap::EType gap_type, const TEvidenceSet &evidences, TSeqPos gapNmin, TSeqPos gap_Unknown_length)
TCountToEvidenceMap m_GapsizeToEvidenceMap
CSeq_gap::EType m_gap_type
static bool IsAa(EMol mol)
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
const_iterator end() const
const_iterator find(const key_type &key) const
unsigned int TSeqPos
Type for sequence locations and lengths.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
CRef< C > Ref(C *object)
Helper functions to get CRef<> and CConstRef<> objects.
bool NotEmpty(void) const THROWS_NONE
Check if CRef is not empty – pointing to an object and has a non-null value.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define BEGIN_SCOPE(ns)
Define a new scope.
CTempString & assign(const char *src_str, size_type len)
Assign new values to the content of the a string.
const char * data(void) const
Return a pointer to the array represented.
size_type length(void) const
Return the length of the represented array.
size_type find_first_not_of(const CTempString match, size_type pos=0) const
Find the first occurrence of any character not in the matching string within the current string,...
size_type find_first_of(const CTempString match, size_type pos=0) const
Find the first occurrence of any character in the matching string within the current string,...
static const size_type npos
TSet & SetSet(void)
Select the variant.
E_Choice Which(void) const
Which variant is currently selected.
list< CRef< CSeq_entry > > TSeq_set
TSeq & SetSeq(void)
Select the variant.
TSeq_set & SetSeq_set(void)
Assign a value to Seq_set data member.
TLiteral & SetLiteral(void)
Select the variant.
void SetLength(TLength value)
Assign a value to Length data member.
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.
void SetSeq_data(TSeq_data &value)
Assign a value to Seq_data data member.
const TGap & GetGap(void) const
Get the variant data.
void SetExt(TExt &value)
Assign a value to Ext data member.
const TLiteral & GetLiteral(void) const
Get the variant data.
bool IsSetExt(void) const
extensions for special types Check if a value has been assigned to Ext data member.
bool IsSetInst(void) const
the sequence data Check if a value has been assigned to Inst data member.
Tdata & Set(void)
Assign a value to data member.
TLength GetLength(void) const
Get the Length member data.
TLength GetLength(void) const
Get the Length member data.
const TLinkage_evidence & GetLinkage_evidence(void) const
Get the Linkage_evidence member data.
bool IsDelta(void) const
Check if variant Delta is selected.
void SetFuzz(TFuzz &value)
Assign a value to Fuzz data member.
void SetInst(TInst &value)
Assign a value to Inst data member.
const TExt & GetExt(void) const
Get the Ext member data.
bool IsSetLength(void) const
must give a length in residues Check if a value has been assigned to Length data member.
const TDelta & GetDelta(void) const
Get the variant data.
void SetRepr(TRepr value)
Assign a value to Repr data member.
const Tdata & Get(void) const
Get the member data.
bool IsSetSeq_data(void) const
may have the data Check if a value has been assigned to Seq_data data member.
list< CRef< CDelta_seq > > Tdata
bool IsGap(void) const
Check if variant Gap is selected.
void ResetExt(void)
Reset Ext data member.
const TSeq_data & GetSeq_data(void) const
Get the Seq_data member data.
const TSeq_data & GetSeq_data(void) const
Get the Seq_data member data.
void ResetSeq_data(void)
Reset Seq_data data member.
@ eRepr_delta
sequence made by changes (delta) to others
@ e_Iupacna
IUPAC 1 letter nuc acid code.
bm::gap_word_t gap_length(const bm::gap_word_t *buf) noexcept
Returs GAP block length.
if(yy_accept[yy_current_state])
Useful/utility classes and methods.
Int4 delta(size_t dimension_, const Int4 *score_)