84 #define HGVS_THROW(err_code, message) NCBI_THROW(CHgvsParser::CHgvsParserException, err_code, message)
86 #define HGVS_ASSERT_RULE(i, rule_id) \
87 if((i->value.id()) != (SGrammar::rule_id)) \
88 {HGVS_THROW(eGrammatic, "Unexpected rule " + CHgvsParser::SGrammar::s_GetRuleName(i->value.id()) ); }
170 static const char* iupac_bases =
".TGKCYSBAWRDMHVN";
171 for(
size_t i = 0;
i <
query.size();
i++) {
189 HGVS_THROW(eSemantic,
"Invalid range: start position is bigger than stop position");
191 const TSeqPos ext_interval = 10000;
205 if (str1.size() >= seq.size()) {
206 for (
size_t i = 0u;
i < str1.size() - seq.size(); ++
i) {
209 repeat_unit_loc->
Assign(*loc1);
212 repeat_unit_loc->
SetInt().SetTo() -=
i;
213 repeat_unit_loc->
SetInt().SetFrom(repeat_unit_loc->
GetInt().
GetTo() - (seq.size() - 1));
215 repeat_unit_loc->
SetInt().SetFrom() +=
i;
218 container->
SetMix().Set().push_back(repeat_unit_loc);
228 for(CSeq_loc_CI ci(*merged_repeats); ci; ++ci) {
229 const CSeq_loc& loc2 = ci.GetEmbeddingSeq_loc();
307 orig->ResetPlacements();
310 container->SetData().SetSet().SetVariations().push_back(
orig);
318 asserted_vr->SetData().SetInstance().SetDelta().push_back(
delta);
321 container->SetData().SetSet().SetVariations().push_back(asserted_vr);
359 : m_hgvs(other.m_hgvs)
382 HGVS_THROW(eContext,
"No CDS feature in context");
397 SetPlacement().SetMol(mol);
398 SetPlacement().SetLoc().SetWhole().Assign(
id);
403 HGVS_THROW(eContext,
"Cannnot get bioseq for seq-id " +
id.AsFastaString());
410 for(
CFeat_CI ci(m_bsh, sel); ci; ++ci) {
417 HGVS_THROW(eContext,
"Multiple CDS features on the sequence");
422 HGVS_THROW(eContext,
"Could not find CDS feat");
431 HGVS_THROW(eLogic,
"Rule name not hardcoded");
433 return s_rule_names[
id.to_long()];
446 if(
i->children.size() == 1) {
447 string s(it->value.begin(), it->value.end());
454 }
else if(
i->children.size() == 3) {
456 string s(it->value.begin(), it->value.end());
463 }
else if(
i->children.size() == 5) {
465 string s1(it->value.begin(), it->value.end());
468 string s2(it->value.begin(), it->value.end());
470 if(s1 ==
"?" && s2 ==
"?") {
472 }
else if(s1 !=
"?" && s2 !=
"?") {
476 }
else if(s2 ==
"?") {
479 }
else if(s1 ==
"?") {
519 if(
i->children.size() == 2) {
521 string s(it->value.begin(), it->value.end());
523 HGVS_THROW(eGrammatic,
"Expected literal '*'");
526 HGVS_THROW(eContext,
"Expected 'c.' context for stop-codon-relative coordinate");
590 if(
i->children.size() == 1) {
602 string s_sign(it->value.begin(), it->value.end());
603 int sign1 = s_sign ==
"-" ? -1 : 1;
623 string s_ivs(it->value.begin(), it->value.end());
625 string s_ivs_num(it->value.begin(), it->value.end());
630 size_t target_exon_num = sign1 < 0 ? ivs_num + 1 : ivs_num;
637 for(
CFeat_CI ci(bsh, sel); ci; ++ci) {
639 if(exon_num == target_exon_num) {
668 TSeqPos anchor_pos = transcribed_len - 1;
689 HGVS_THROW(eSemantic,
"Points in a fuzzy pos are on different sequences");
692 HGVS_THROW(eSemantic,
"Range-loc start/stop are on different strands.");
706 HGVS_THROW(eSemantic,
"Base-points in an intronic fuzzy position must be equal");
726 pnt.
pnt.Assign(*pnt1.
pnt);
731 if(!pnt1->IsSetFuzz() && !pnt2->IsSetFuzz()) {
734 pnt->SetFuzz().SetRange().SetMin(min_pos);
735 pnt->SetFuzz().SetRange().SetMax(max_pos);
737 }
else if(pnt1->IsSetFuzz() && pnt2->IsSetFuzz()) {
745 pnt->SetFuzz().SetRange().SetMin(min_pos);
746 pnt->SetFuzz().SetRange().SetMax(max_pos);
781 pnt->
Assign(pnt1->IsSetFuzz() ? *pnt2 : *pnt1);
782 pnt->SetFuzz().
Assign(pnt1->IsSetFuzz() ? pnt1->GetFuzz()
801 for(
CFeat_CI ci(bsh, sel); ci; ++ci) {
804 annotated_transcript_feats.
insert(
812 annotated_transcript_aligns.
insert(
817 vector<CSeq_id_Handle> v;
818 set_intersection(annotated_transcript_feats.
begin(),
819 annotated_transcript_feats.
end(),
820 annotated_transcript_aligns.
begin(),
821 annotated_transcript_aligns.
end(),
833 const CSeq_id&
id = *it->GetSeqId();
835 &&
id.GetGeneral().GetDb() ==
"LRG")
850 TIterator it =
i->children.rbegin()->children.begin();
851 string mol(it->value.begin(), it->value.end());
862 it = (
i->children.rbegin() + 1)->children.begin();
863 string id_str(it->value.begin(), it->value.end());
868 HGVS_THROW(eSemantic,
"Could not resolve seq-id-str='" + id_str +
"'; idh=" + idh.
AsString());
886 bool already_found =
false;
887 for(
CFeat_CI ci(bsh, sel); ci; ++ci) {
897 already_found =
true;
910 HGVS_THROW(eSemantic,
"Specifying c. expression in NG coordinates is only supported for LRG subset where NM/NG associations are stable");
915 HGVS_THROW(eSemantic,
"Can't resolve to a unique transcript on NG: " + idh.
AsString());
923 if(
i->children.size() == 3) {
924 it = (
i->children.rbegin() + 2)->children.begin();
925 string tag_str(it->value.begin(), it->value.end());
944 bool flip_strand =
false;
945 if(
i->children.size() == 3) {
972 HGVS_THROW(eSemantic,
"Expected protein context");
976 HGVS_THROW(eSemantic,
"Expected single aa literal in prot-pos");
1006 HGVS_THROW(eSemantic,
"Range-loc start/stop are on different seq-ids.");
1009 HGVS_THROW(eSemantic,
"Range-loc start/stop are on different strands.");
1031 ? p->
SetSeq().SetSeq_data().SetNcbieaa().Set()
1032 : p->
SetSeq().SetSeq_data().SetIupacna().Set();
1057 ? placement->
SetSeq().SetSeq_data().SetNcbieaa().Set()
1058 : placement->
SetSeq().SetSeq_data().SetIupacna().Set();
1078 exception->SetMessage(
"HGVS exon-boundary position not represented in the transcript annotation");
1081 util.CheckPlacement(*placement);
1092 bool flip_strand =
false;
1093 if(
i->children.size() == 3) {
1104 p->
SetLoc().FlipStrand();
1108 HGVS_THROW(eSemantic,
"Intronic seq-locs are not supported in this context");
1123 if(it ==
i->children.end()) {
1124 HGVS_THROW(eLogic,
"Unexpected parse-tree state when parsing " +
context.GetHgvs());
1155 delta->SetSeq().SetLoc(*loc);
1159 HGVS_THROW(eSemantic,
"Intronic loc is not supported in this context");
1207 for(
size_t i_ncbistdaa = 0; i_ncbistdaa < 28; i_ncbistdaa++) {
1239 string seq_str(it->value.begin(), it->value.end());
1244 literal->SetSeq_data().SetNcbieaa().Set(seq_str);
1248 literal->SetSeq_data().SetIupacna().Set(seq_str);
1251 literal->SetLength(seq_str.size());
1253 vector<TSeqPos> bad;
1256 if(bad.size() > 0) {
1267 :
delta.GetSeq().IsLiteral() ?
delta.GetSeq().GetLiteral().GetLength()
1269 :
delta.GetSeq().IsThis() ? loc_len
1271 if(
delta.IsSetMultiplier()) {
1300 int del_len =
GetDeltaLength(*del_vr->GetData().GetInstance().GetDelta().front(), placement_len);
1301 int ins_len =
GetDeltaLength(*ins_vr->GetData().GetInstance().GetDelta().front(), placement_len);
1302 del_vr->SetData().SetInstance().SetType(
GetDelInsSubtype(del_len, ins_len));
1304 del_vr->SetData().SetInstance().SetDelta() = ins_vr->SetData().SetInstance().SetDelta();
1305 del_vr->SetData().SetInstance().SetDelta().front()->ResetAction();
1307 if(ins_len == 1 && del_len == 1) {
1310 ex->SetMessage(
"delins used for single-nt substitution");
1330 di->SetSeq().SetThis();
1343 ex->SetMessage(
"Sequence length is inconsistent with location length");
1366 HGVS_THROW(eSemantic,
"Location must be a dinucleotide");
1375 var_inst.
SetDelta().push_back(delta_ins);
1392 delta->SetSeq().SetThis();
1393 delta->SetMultiplier(2);
1401 if(dup_seq->GetSeq().IsLiteral()) {
1405 HGVS_THROW(eSemantic,
"Location length and asserted sequence length differ");
1451 delta->SetSeq().SetThis();
1478 delta->SetSeq().SetLiteral(*seq_to);
1503 delta->SetSeq().SetLoc().Assign(*loc);
1504 delta->SetSeq().SetLoc().FlipStrand();
1516 if(dup_seq->GetSeq().IsLiteral()) {
1548 &&
literal->GetSeq_data().IsIupacna()
1554 literal->GetSeq_data().GetIupacna(),
1556 p.
SetLoc().Assign(*ssr_loc);
1573 for(; it !=
i->children.end(); ++it) {
1574 string s1(it->value.begin(), it->value.end());
1582 delta->SetSeq().SetThis();
1586 vr2->SetData().SetInstance().SetDelta().push_back(
delta);
1587 vr->SetData().SetSet().SetVariations().push_back(vr2);
1595 delta->SetSeq().SetThis();
1603 delta->SetMultiplier_fuzz(*int_fuzz.
fuzz);
1605 vr->SetData().SetInstance().SetDelta().push_back(
delta);
1625 it =
i->children.begin();
1626 string iscn_expr(it->value.begin(), it->value.end());
1627 vr->SetSynonyms().push_back(
"ISCN:" + iscn_expr);
1648 delta->SetSeq().SetLoc().Assign(*loc_other);
1662 HGVS_THROW(eContext,
"Frameshift can only be specified in protein context");
1665 vr->SetData().SetNote(
"Frameshift");
1666 vr->SetFrameshift();
1671 if(it !=
i->children.end()) {
1674 if(it !=
i->children.end()) {
1675 string s(it->value.begin(), it->value.end());
1677 vr->SetFrameshift().SetX_length(x_length);
1691 HGVS_THROW(eContext,
"Expected protein context");
1697 string ext_type_str(it->value.begin(), it->value.end());
1699 string ext_len_str(it->value.begin(), it->value.end());
1707 delta->SetSeq().SetLiteral().SetLength(
abs(ext_len) + 1);
1710 if(ext_type_str ==
"extMet") {
1712 HGVS_THROW(eSemantic,
"extMet must be followed by a negative integer");
1717 }
else if(ext_type_str ==
"extX"
1718 || ext_type_str ==
"ext*"
1719 || ext_type_str ==
"extTer")
1722 HGVS_THROW(eSemantic,
"exX must be followed by a non-negative integer");
1729 HGVS_THROW(eGrammatic,
"Unexpected ext_type: " + ext_type_str);
1744 HGVS_THROW(eContext,
"Expected protein context");
1756 delta->SetSeq().SetLiteral(*prot_literal);
1766 string s(
i->value.begin(),
i->value.end());
1769 vr->SetData().SetNote(s);
1782 string s(it->value.begin(), it->value.end());
1784 vr->SetData().SetUnknown();
1820 string s(it->value.begin(), it->value.end());
1821 if(it->value.id() ==
i->value.id() && s ==
"(") {
1846 string s(it->value.begin(), it->value.end());
1847 if(it->value.id() ==
i->value.id() && s ==
"(") {
1858 vr =
x_expr3(it, local_context);
1863 }
else if(it->value.id() ==
i->value.id()) {
1868 vr->SetData().SetUnknown();
1870 }
else if(s ==
"0?" || s ==
"0") {
1877 di->SetSeq().SetThis();
1884 HGVS_THROW(eGrammatic,
"Unexpected expr terminal: " + s);
1900 string s(it->value.begin(), it->value.end());
1901 if(it->value.id() ==
i->value.id() && s ==
"(") {
1910 for(; it !=
i->children.end(); ++it) {
1913 if(inst_ref->GetData().IsNote()
1914 && inst_ref->GetData().GetNote() ==
"Frameshift")
1916 if(vr->SetData().SetSet().SetVariations().size() > 0) {
1921 vr->SetData().SetSet().SetVariations().back()->SetFrameshift().Assign(inst_ref->GetFrameshift());
1929 delta->SetSeq().SetLiteral().SetLength(1);
1930 delta->SetSeq().SetLiteral().SetSeq_data().SetNcbieaa().Set(
"X");
1932 vr->SetData().SetSet().SetVariations().push_back(inst_ref);
1935 vr->SetData().SetSet().SetVariations().push_back(inst_ref);
1951 string s(it->value.begin(), it->value.end());
1974 for(
TIterator it =
i->children.begin(); it !=
i->children.end(); ++it) {
1977 if(it !=
i->children.begin()) {
1991 }
else if(set_type != varset.
GetType()) {
1992 HGVS_THROW(eSemantic,
"Non-unique delimiters within a list");
2063 ex->SetMessage(
"Inconsistent mol-type. asserted:'" + asserted_header +
"'; expected:'" + expected_header +
"'");
2072 tree_parse_info<>
info = pt_parse(hgvs2.c_str(), *
s_grammar, +space_p);
2077 tree_to_xml(ostr,
info.trees, hgvs2.c_str() , CHgvsParser::SGrammar::s_GetRuleNames());
2089 util.CheckAmbiguitiesInLiterals(*vr);
2103 if(!
v2.IsSetPlacements()) {
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.
@ eExtreme_Positional
numerical value
@ eExtreme_Biological
5' and 3'
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.
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.
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
const CSeq_id & GetSeq_id(TDim row) const
Get seq-id (the first one if segments have different ids).
namespace ncbi::objects::
static TIndex GetMapToIndex(CSeq_data::E_Choice from_type, CSeq_data::E_Choice to_type, TIndex from_idx)
static const string & GetCode(CSeq_data::E_Choice code_type, TIndex idx)
static void Validate(const CSeq_data &in_seq, vector< TSeqPos > *badIdx, TSeqPos uBeginIdx=0, TSeqPos uLength=0)
static const string & GetIupacaa3(TIndex ncbistdaa)
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
Template class for iteration on objects of class C.
Set of related Variations.
iterator_bool insert(const value_type &val)
const_iterator begin() const
const_iterator end() const
CContext(CRef< CScope > scope, CSeq_id_Resolver::TResolvers &id_resolvers, const string &hgvs)
const CSeq_id & GetId() const
void SetId(const CSeq_id &id, CVariantPlacement::TMol mol)
CVariantPlacement & SetPlacement()
const CSeq_feat & GetCDS() const
CSeq_id_Resolver::TResolvers m_seq_id_resolvers
CRef< CVariantPlacement > m_placement
static CRef< CVariation > x_string_content(TIterator const &i, const CContext &context)
static CRef< CVariation > x_root(TIterator const &i, const CContext &context)
static CVariation::TData::TSet::EData_set_type x_list_delimiter(TIterator const &i, const CContext &context)
static SOffsetPoint x_general_pos(TIterator const &i, const CContext &context)
static void sx_AppendMoltypeExceptions(CVariation &v, CScope &scope)
static CRef< CVariation > x_nuc_subst(TIterator const &i, const CContext &context)
static string s_SeqIdToHgvsStr(const CVariantPlacement &vp, CScope *scope=NULL)
Construct an hgvs "header" consisting of seq-id and mol-type, e.g. "NG_016831.1:g....
static CRef< CVariation > x_expr3(TIterator const &i, const CContext &context)
static CRef< CVariation > x_expr1(TIterator const &i, const CContext &context)
static CRef< CVariation > x_delins(TIterator const &i, const CContext &context)
static CRef< CVariation > x_unwrap_iff_singleton(CVariation &v)
static SFuzzyInt x_int_fuzz(TIterator const &i, const CContext &context)
static CRef< CSeq_loc > x_seq_loc(TIterator const &i, const CContext &context)
static CRef< CVariation > x_no_change(TIterator const &i, const CContext &context)
TParseTreeMatch::const_tree_iterator TIterator
static CRef< CVariation > x_insertion(TIterator const &i, const CContext &context, bool check_loc)
static void s_SetStopOffset(CVariantPlacement &p, const CHgvsParser::SFuzzyInt &fint)
static CContext x_header(TIterator const &i, const CContext &context)
static void s_SetStartOffset(CVariantPlacement &p, const CHgvsParser::SFuzzyInt &fint)
CSeq_id_Resolver::TResolvers m_seq_id_resolvers
string AsHgvsExpression(const CVariation &variation, CConstRef< CSeq_id > seq_id=CConstRef< CSeq_id >(NULL))
static CRef< CSeq_literal > x_raw_seq(TIterator const &i, const CContext &context)
CVariation_inst::TDelta::value_type TDelta
static CRef< CVariation > x_translocation(TIterator const &i, const CContext &context)
static CRef< CVariation > x_prot_ext(TIterator const &i, const CContext &context)
static CSafeStatic< SGrammar > s_grammar
void AttachHgvs(CVariation &v)
static CRef< CVariation > x_list(TIterator const &i, const CContext &context)
static SOffsetPoint x_prot_pos(TIterator const &i, const CContext &context)
static bool s_hgvs_iupacaa2ncbieaa(const string &hgvsaa, string &out)
static SOffsetPoint x_pos_spec(TIterator const &i, const CContext &context)
static CRef< CVariation > x_duplication(TIterator const &i, const CContext &context)
static CRef< CVariation > x_mut_inst(TIterator const &i, const CContext &context)
static CRef< CVariation > x_nuc_inv(TIterator const &i, const CContext &context)
static CRef< CSeq_literal > x_raw_seq_or_len(TIterator const &i, const CContext &context)
static CRef< CVariation > x_prot_missense(TIterator const &i, const CContext &context)
static TDelta x_seq_ref(TIterator const &i, const CContext &context)
static CRef< CVariation > x_deletion(TIterator const &i, const CContext &context)
static CRef< CVariantPlacement > x_range(TIterator const &i, const CContext &context)
static CRef< CVariation > x_prot_fs(TIterator const &i, const CContext &context)
static CRef< CSeq_point > x_abs_pos(TIterator const &i, const CContext &context)
static SOffsetPoint x_fuzzy_pos(TIterator const &i, const CContext &context)
static CRef< CVariantPlacement > x_location(TIterator const &i, const CContext &context)
static bool s_hgvsaa2ncbieaa(const string &hgvsaa, string &out)
Convert HGVS amino-acid code to ncbi code.
static CRef< CVariation > x_expr2(TIterator const &i, const CContext &context)
CRef< CVariation > AsVariation(const string &hgvs_expression, TOpFlags=fOpFlags_Default)
static CRef< CVariation > x_ssr(TIterator const &i, const CContext &context)
static CRef< CVariation > x_conversion(TIterator const &i, const CContext &context)
static void s_FactorOutPlacements(CVariation &v)
If at any level in variation-set all variations have all same placements, move them to the parent lev...
static TSeqPos s_GetLength(const CVariantPlacement &p, CScope *scope)
TSeqPos GetEffectiveTranscriptLength(const CBioseq_Handle &bsh)
Length up to last position of the last exon (i.e.
std::ofstream out("events_result.xml")
main entry point for tests
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
int TSignedSeqPos
Type for signed sequence position.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
const TSeqPos kInvalidSeqPos
Define special value for invalid sequence position.
#define NCBI_REPORT_EXCEPTION(title, ex)
Generate a report on the exception.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
#define MSerial_AsnText
I/O stream manipulators –.
virtual bool Equals(const CSerialObject &object, ESerialRecursionMode how=eRecursive) const
Check if both objects contain the same values.
CConstRef< CSeq_id > GetSeqId(void) const
CSeq_id::EAccessionInfo IdentifyAccession(void) const
static CSeq_id_Handle GetHandle(const CSeq_id &id)
Normal way of getting a handle, works for any seq-id.
string AsString(void) const
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Override Assign() to incorporate cache invalidation.
const CSeq_id * GetId(void) const
Get the id of the location return NULL if has multiple ids or no id at all.
CBeginInfo Begin(C &obj)
Get starting point of object hierarchy.
const CSeq_id & GetId(const CSeq_loc &loc, CScope *scope)
If all CSeq_ids embedded in CSeq_loc refer to the same CBioseq, returns the first CSeq_id found,...
TSeqPos GetLength(const CSeq_id &id, CScope *scope)
Get sequence length if scope not null, else return max possible TSeqPos.
ENa_strand GetStrand(const CSeq_loc &loc, CScope *scope=0)
Returns eNa_strand_unknown if multiple Bioseqs in loc Returns eNa_strand_other if multiple strands in...
sequence::ECompare Compare(const CSeq_loc &loc1, const CSeq_loc &loc2, CScope *scope)
Returns the sequence::ECompare containment relationship between CSeq_locs.
CRef< CSeq_loc > Seq_loc_Merge(const CSeq_loc &loc, CSeq_loc::TOpFlags flags, CScope *scope)
Merge ranges in the seq-loc.
@ fCompareOverlapping
Check if seq-locs are overlapping.
@ eNoOverlap
CSeq_locs do not overlap or abut.
@ eGetId_ForceAcc
return only an accession based seq-id
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
vector< CSeq_id_Handle > TId
bool IsNucleotide(void) const
const CSeqFeatData & GetData(void) const
bool IsSetProduct(void) const
TInst_Length GetInst_Length(void) const
CScope & GetScope(void) const
Get scope this handle belongs to.
const TId & GetId(void) const
@ eCoding_Iupac
Set coding to printable coding (Iupacna or Iupacaa)
SAnnotSelector & IncludeFeatSubtype(TFeatSubtype subtype)
Include feature subtype in the search.
SAnnotSelector & SetResolveTSE(void)
SetResolveTSE() is equivalent to SetResolveMethod(eResolve_TSE).
const CSeq_loc & GetLocation(void) const
const CSeq_feat & GetMappedFeature(void) const
Feature mapped to the master sequence.
SAnnotSelector & IncludeFeatType(TFeatType type)
Include feature type in the search.
const CSeq_loc & GetProduct(void) const
void GetSeqData(TSeqPos start, TSeqPos stop, string &buffer) const
Fill the buffer string with the sequence data for the interval [start, stop).
const_iterator begin(void) const
const_iterator end(void) const
void Reset(void)
Reset reference object.
bool IsNull(void) const THROWS_NONE
Check if pointer is null – same effect as Empty().
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static string SizetToString(size_t value, TNumToStringFlags flags=0, int base=10)
Convert size_t to string.
CTempString literal(const char(&str)[Size])
Templatized initialization from a string literal.
static int StringToInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to int.
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
static SIZE_TYPE Find(const CTempString str, const CTempString pattern, ECase use_case=eCase, EDirection direction=eForwardSearch, SIZE_TYPE occurrence=0)
Find the pattern in the string.
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
size_type find(const CTempString match, size_type pos=0) const
Find the first instance of the entire matching string within the current string, beginning at an opti...
static string & ReplaceInPlace(string &src, const string &search, const string &replace, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
static string & ToUpper(string &str)
Convert string to upper case – string& version.
static string TruncateSpaces(const string &str, ETrunc where=eTrunc_Both)
Truncate whitespace in a string.
void SetMin(TMin value)
Assign a value to Min data member.
bool IsLim(void) const
Check if variant Lim is selected.
TRange & SetRange(void)
Select the variant.
TLim GetLim(void) const
Get the variant data.
void SetMax(TMax value)
Assign a value to Max data member.
TLim & SetLim(void)
Select the variant.
bool IsRange(void) const
Check if variant Range is selected.
@ eLim_other
something else
@ eLim_tl
space to left of position
@ eLim_tr
space to right of position
bool IsSpliced(void) const
Check if variant Spliced is selected.
const TSegs & GetSegs(void) const
Get the Segs member data.
bool IsCdregion(void) const
Check if variant Cdregion is selected.
void SetPoint(TPoint value)
Assign a value to Point data member.
void SetId(TId &value)
Assign a value to Id data member.
const TPnt & GetPnt(void) const
Get the variant data.
TPoint GetPoint(void) const
Get the Point member data.
void SetStrand(TStrand value)
Assign a value to Strand data member.
TFrom GetFrom(void) const
Get the From member data.
void SetFuzz(TFuzz &value)
Assign a value to Fuzz data member.
bool IsSetFuzz(void) const
Check if a value has been assigned to Fuzz data member.
const TFuzz & GetFuzz(void) const
Get the Fuzz member data.
const TId & GetId(void) const
Get the Id member data.
TStrand GetStrand(void) const
Get the Strand member data.
TTo GetTo(void) const
Get the To member data.
bool IsWhole(void) const
Check if variant Whole is selected.
const TInt & GetInt(void) const
Get the variant data.
bool IsPnt(void) const
Check if variant Pnt is selected.
TLength GetLength(void) const
Get the Length member data.
const TNcbieaa & GetNcbieaa(void) const
Get the variant data.
const TSeq_data & GetSeq_data(void) const
Get the Seq_data member data.
@ e_Ncbieaa
extended ASCII 1 letter aa codes
@ e_Ncbistdaa
consecutive codes for std aas
void SetStop_offset_fuzz(TStop_offset_fuzz &value)
Assign a value to Stop_offset_fuzz data member.
TMol GetMol(void) const
Get the Mol member data.
TMethod & SetMethod(void)
Assign a value to Method data member.
list< CRef< CVariantPlacement > > TPlacements
void SetStop_offset(TStop_offset value)
Assign a value to Stop_offset data member.
bool IsSetMol(void) const
Check if a value has been assigned to Mol data member.
list< CRef< CVariation > > TVariations
bool IsSetPlacements(void) const
where this beast is seen note that this is a set of locations, and there are no restrictions to the c...
void SetHgvs_name(const THgvs_name &value)
Assign a value to Hgvs_name data member.
void ResetExceptions(void)
Reset Exceptions data member.
void SetData(TData &value)
Assign a value to Data data member.
void ResetStop_offset(void)
Reset Stop_offset data member.
void ResetStart_offset_fuzz(void)
Reset Start_offset_fuzz data member.
const TSet & GetSet(void) const
Get the variant data.
bool IsSetSeq(void) const
for situations in which a raw location isn't sufficient Check if a value has been assigned to Seq dat...
TExceptions & SetExceptions(void)
Assign a value to Exceptions data member.
const TVariations & GetVariations(void) const
Get the Variations member data.
void SetSeq(TSeq &value)
Assign a value to Seq data member.
void ResetStop_offset_fuzz(void)
Reset Stop_offset_fuzz data member.
void ResetStart_offset(void)
Reset Start_offset data member.
void SetType(TType value)
Assign a value to Type data member.
const TSeq & GetSeq(void) const
Get the Seq member data.
TPlacements & SetPlacements(void)
Assign a value to Placements data member.
void SetStart_offset(TStart_offset value)
Assign a value to Start_offset data member.
void ResetSeq(void)
Reset Seq data member.
const TData & GetData(void) const
Get the Data member data.
void SetMol(TMol value)
Assign a value to Mol data member.
bool IsSetStop_offset(void) const
Check if a value has been assigned to Stop_offset data member.
TVariations & SetVariations(void)
Assign a value to Variations data member.
const TMethod & GetMethod(void) const
Get the Method member data.
bool IsSetStart_offset(void) const
location refinements, describing offsets into introns from product coordinates.
const TLoc & GetLoc(void) const
Get the Loc member data.
bool IsSet(void) const
Check if variant Set is selected.
void SetLoc(TLoc &value)
Assign a value to Loc data member.
TSynonyms & SetSynonyms(void)
Assign a value to Synonyms data member.
TType GetType(void) const
Get the Type member data.
void SetStart_offset_fuzz(TStart_offset_fuzz &value)
Assign a value to Start_offset_fuzz data member.
TStart_offset GetStart_offset(void) const
Get the Start_offset member data.
@ eData_set_type_genotype
changes on different alleles in the same genotype, e.g. g.[476C>T]+[476C>T]
@ eData_set_type_chimeric
e.g. c.[1C>T//2G>T]
@ eData_set_type_package
set represents a package of observations at a given location, generally containing asserted + referen...
@ eData_set_type_compound
complex change at the same location on the same molecule
@ eData_set_type_individual
same organism; allele relationship unknown, e.g. g.[476C>T(+)183G>C]
@ eData_set_type_products
different products arising from the same variation in a precursor, e.g. r.[13g>a, 13_88del]
@ eData_set_type_haplotype
changes on the same allele, e.g r.[13g>a;15u>c]
@ eData_set_type_mosaic
different genotypes in the same individual
@ eMol_cdna
"c." coordinates in HGVS
@ eMol_mitochondrion
"mt." coordinates in HGVS
@ eMol_rna
"n." coordinates in HGVS
@ eMol_protein
"p." coordinates in HGVS
@ eMol_genomic
"g." coordinates in HGVS
@ eCode_hgvs_exon_boundary
anchor position in an intronic HGVS expression is not at an exon boundary
@ eCode_hgvs_parsing
invalid hgvs expression
@ eCode_inconsistent_asserted_moltype
asserted mol-type is inconsistent with seq-id (e.g. NM_12345.6:g.)
@ eMethod_E_computational
void SetType(TType value)
Assign a value to Type data member.
TDelta & SetDelta(void)
Assign a value to Delta data member.
@ eType_snv
delta=[morph of length 1] NOTE: this is snV not snP; the latter requires frequency-based validation t...
@ eType_inv
delta=[del, ins.seq= RevComp(variation-location)]
@ eType_mnp
delta=[morph of length >1]
@ eType_microsatellite
delta=[del, ins.seq= repeat-unit with fuzzy multiplier] variation-location is the microsat expansion ...
@ eType_delins
delta=[del, ins]
@ eType_transposon
delta=[del, ins.seq= known donor or 'this'] variation-location is equiv of transposon locs.
@ eType_prot_other
delta=any
@ eType_prot_silent
delta=[morph of length 1, same AA as at variation-location]
@ eType_prot_missense
delta=[morph of length 1]
@ eType_translocation
delta=like delins
@ eAction_del_at
excise sequence at location if multiplier is specified, delete len(location)*multiplier positions dow...
@ eAction_ins_before
insert seq before the location.start
@ eObservation_asserted
inst represents the asserted base at a position
#define HGVS_ASSERT_RULE(i, rule_id)
#define HGVS_THROW(err_code, message)
where boath are integers</td > n< td ></td > n</tr > n< tr > n< td > tse</td > n< td > optional</td > n< td > String</td > n< td class=\"description\"> TSE option controls what blob is orig
static void text(MDB_val *v)
CVariation_inst::EType GetDelInsSubtype(int del_len, int ins_len)
void SetComputational(CVariation &variation)
bool IsPureFuzzPoint(const CSeq_point &p)
void RepackageAssertedSequence(CVariation &vr)
bool IsLRG(CBioseq_Handle &bsh)
T AdjustHgvsCoord(T val, TSeqPos offset, bool adjust)
CSeq_id_Handle GetUniquePrimaryTranscriptId(CBioseq_Handle &bsh)
bool SeqsMatch(const string &query, const char *text)
CVariantPlacement & SetFirstPlacement(CVariation &v)
CRef< CSeq_loc > FindSSRLoc(const CSeq_loc &loc, const string &seq, CScope &scope)
int GetDeltaLength(const CDelta_item &delta, int loc_len)
void AdjustMoltype(CVariation &vr, CScope &scope)
std::istream & in(std::istream &in_, double &x_)
Int4 delta(size_t dimension_, const Int4 *score_)
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
int GetLoc(const string &acc, const string &pat, CSeq_loc &loc, CScope &scope)
static bool s_is_list(parser_id id)
static bool s_is_list_a(parser_id id)
static const char * s_rule_names[SGrammar::eNodeIds_SIZE]
static const string s_GetRuleName(parser_id id)
void Assign(const SOffsetPoint &other)
static CS_CONTEXT * context