58 return "Structural variant";
64 string num_str = feat.GetNamedQual(
"Child Count");
65 if ( !num_str.empty() ) {
78 if(isGeneratedBySvc) {
79 *isGeneratedBySvc =
false;
91 string validation = is_vcf ?
"" :
"Not Tested";
102 tooltip.
AddRow(
"Variation ID:", id_text);
106 list<string> alt_alleles;
109 bool all_alt_alleles_same_len(
true);
111 for (
auto iVariation = var_list.begin(); iVariation != var_list.end(); ++iVariation) {
112 if ((*iVariation)->IsSetData() && (*iVariation)->GetData().IsInstance()) {
117 bool isReference(
false);
123 if ((*iDelta)->CanGetSeq()) {
125 switch (DeltaSeq.
Which()) {
137 if (!sAllele.empty()) {
139 ref_allele = sAllele;
141 alt_alleles.push_back(sAllele);
143 if(allele_len != -1 && new_allele_len != allele_len) {
144 all_alt_alleles_same_len =
false;
146 allele_len = new_allele_len;
156 alt_alleles.push_back(
"-");
167 tooltip.
AddRow(
"Alleles" +
string(alt_alleles.size() > 1 ?
"s" :
"") +
":",
string(ref_allele.empty() ?
"-" : ref_allele) +
"/" +
NStr::Join(alt_alleles,
"/"));
168 if (allele_len > 0) {
185 }
else if (
m_Feat->IsSetExts()) {
188 if ( (*iter)->GetType().IsStr() &&
190 (*iter)->GetFieldRef(
"Status") &&
191 (*iter)->GetFieldRef(
"Status")->GetData().IsStr()) {
192 validation = (*iter)->GetFieldRef(
"Status")->GetData().GetStr();
203 string phenotype =
"";
204 string clinical_sig =
"";
207 if (clinical_sig.empty() && (*pnt_iter)->CanGetClinical_significance()) {
211 if (phenotype.empty() && (*pnt_iter)->CanGetTerm()) {
212 phenotype = (*pnt_iter)->GetTerm();
217 string sample_sex =
"";
220 if ((*so_iter)->CanGetSource() &&
222 sample_sex = (*so_iter)->GetSource().GetName();
229 string variant_type(
"Unknown");
233 variant_type =
"Complex";
235 variant_type =
"Insertion";
237 variant_type =
"Inversion";
239 variant_type =
"Tandem duplication";
241 variant_type =
"Translocation";
243 variant_type =
"Deletion";
245 variant_type =
"Indel";
246 }
else if (var.
IsSNV()) {
247 variant_type =
"Single nucleotide variant";
248 }
else if (var.
IsCNV()) {
252 if ((*iter)->IsSetMultiplier()) {
253 multiplier = (*iter)->GetMultiplier();
259 variant_type =
"Copy number variation";
262 variant_type =
"Copy number gain";
263 }
else if (var.
IsLoss()) {
264 variant_type =
"Copy number loss";
266 variant_type =
"Copy number variation";
273 variant_type =
"SNV";
276 variant_type =
"MNP";
279 variant_type =
"Insertion";
282 variant_type =
"Deletion";
285 variant_type =
"Delins";
291 if (child_num == 0) {
298 tooltip.
AddRow(
"Variant Region Type:", variant_type);
299 if (multiplier > -1) {
302 if ( !phenotype.empty() ) {
303 tooltip.
AddRow(
"Phenotype:", phenotype);
305 if ( !clinical_sig.empty() ) {
306 tooltip.
AddRow(
"Clinical Interpretation:", clinical_sig);
308 if ( !sample_sex.empty() ) {
309 tooltip.
AddRow(
"Gender:", sample_sex);
311 tooltip.
AddRow(
"Validation Status:", validation);
312 if ( !additional_info.empty() ) {
313 tooltip.
AddRow(
"Additional Info:", additional_info);
315 if (
m_Feat->IsSetComment()) {
333 tooltip.
AddRow(
"Parent Variant Region:", parent);
336 tooltip.
AddRow(
"Variant Call Type:", variant_type);
337 if (multiplier > -1) {
340 if ( !phenotype.empty() ) {
341 tooltip.
AddRow(
"Phenotype:", phenotype);
343 if ( !clinical_sig.empty() ) {
344 tooltip.
AddRow(
"Clinical Interpretation:", clinical_sig);
346 if ( !sample_sex.empty() ) {
347 tooltip.
AddRow(
"Gender:", sample_sex);
376 inh +=
"biparental ";
379 inh +=
"uniparental ";
382 inh +=
"not-tested ";
385 inh +=
"tested-inconclusive ";
395 tooltip.
AddRow(
"Inheritance:", inh);
400 if(!validation.empty()) {
401 tooltip.
AddRow(
"Validation Status:", validation);
403 if ( !additional_info.empty() ) {
404 tooltip.
AddRow(
"Additional Info:", additional_info);
407 if (
m_Feat->CanGetComment()) {
416 if ((*iter)->IsSetSeq() && (*iter)->GetSeq().IsLiteral()) {
417 allele_len = (*iter)->GetSeq().GetLiteral().GetLength();
422 if (allele_len > -1) {
433 if ( !sample_id.empty() ) {
434 tooltip.
AddRow(
"Sample id:", sample_id);
439 static const string kBaseUrl =
"http://ncbi.nlm.nih.gov/dbvar/";
450 string label, name, url;
462 if ( !
label.empty() ) {
465 tmp_links->AddLinkRow(
"dbVar",
label, url);
468 if (
m_Feat->IsSetExts()) {
470 if ((*iter)->GetType().IsStr() &&
471 !(*iter)->GetData().empty()) {
472 name =
"Other Variant Calls from this Sample";
473 if ((*iter)->GetType().GetStr() ==
"related calls") {
475 if (fields.size() < 5) {
477 label = (*f_iter)->GetLabel().GetStr();
478 url =
kBaseUrl +
"variants/" + (*f_iter)->GetData().GetStr();
480 link_map[name].push_back(std::pair<string, string>(
label, url));
497 link_map[name].push_back(std::pair<string, string>(
label, url));
500 }
else if ((*iter)->GetType().GetStr() ==
"related call count") {
503 if ((*f_iter)->GetLabel().IsStr() && (*f_iter)->GetData().IsStr()) {
504 label = (*f_iter)->GetLabel().GetStr();
505 term = (*f_iter)->GetData().GetStr();
510 if ( !term.empty() ) {
517 link_map[name].push_back(std::pair<string, string>(
label, url));
527 for (iter=link_map.
begin(); iter != link_map.
end(); ++iter) {
530 for (
size_t i=0;
i<(*iter).second.size(); ++
i) {
533 if (
i>0) table_rows +=
", ";
534 table_rows += tmp_links->CreateLink((*iter).second[
i].first, (*iter).second[
i].second);
536 tmp_links->AddLinkRow((*iter).first, table_rows, 250);
539 if ( !tmp_links->IsEmpty()) {
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.
void GetLabel(string *label) const
virtual void GetLinks(ITooltipFormatter &links, bool no_ncbi_base) const
Get a set of links.
virtual string GetSubtype() const
virtual void GetToolTip(ITooltipFormatter &tooltip, string &t_title, TSeqPos at_p=(TSeqPos) -1, bool *isGeneratedBySvc=NULL) const
Get tooltip.
CConstRef< CUser_field > GetFieldRef(const string &str, const string &delim=".", NStr::ECase use_case=NStr::eCase) const
Return a field reference representing the tokenized key, or a NULL reference if the key doesn't exist...
TValidated GetValidated(void) const
bool IsSetAllele_origin(void) const
TAllele_origin GetAllele_origin(void) const
bool IsDeletionInsertion() const
bool IsSetValidated(void) const
bool IsTranslocation() const
static string ClinSigAsString(const CVariation_ref &var, ELetterCase LetterCase=eLetterCase_Mixed)
get a human-readable text for various clinical significance types
const_iterator begin() const
const_iterator end() const
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
static void GetLabel(const CObject &obj, string *label, ELabelType type=eDefault)
virtual void AddRow(const string &sContents="", unsigned colspan=2)=0
add a row with a cell, spanning across all columns
virtual CIRef< ITooltipFormatter > CreateInstance()=0
creates another instance of the same tooltip formatter
virtual void AddLinksTitle(const string &sTitle)=0
add a row with the links title
CRef< objects::CScope > m_Scope
static bool isFromVcf(const CSeq_feat &variation_ref)
CConstRef< objects::CSeq_feat > m_Feat
static CVariation_inst::EType GetVcfType(const CSeq_feat &variation_ref)
virtual void Append(const ITooltipFormatter &tooltip)=0
appends another formatter to this one
CConstRef< objects::CSeq_loc > m_Location
Mapped location in top sequence coordinate (can be set externally).
const TPrim & Get(void) const
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
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 string Join(const TContainer &arr, const CTempString &delim)
Join strings using the specified delimiter.
static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another string.
static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)
Convert numeric value to string.
@ fWithCommas
Use commas as thousands separator.
static const char label[]
const TStr & GetStr(void) const
Get the variant data.
bool IsStr(void) const
Check if variant Str is selected.
const TTag & GetTag(void) const
Get the Tag member data.
bool IsId(void) const
Check if variant Id is selected.
const TData & GetData(void) const
Get the Data member data.
const TDb & GetDb(void) const
Get the Db member data.
const TStr & GetStr(void) const
Get the variant data.
vector< CRef< CUser_field > > TData
TId GetId(void) const
Get the variant data.
list< CRef< CUser_object > > TExts
const TIupacaa & GetIupacaa(void) const
Get the variant data.
bool IsIupacaa(void) const
Check if variant Iupacaa is selected.
const TIupacna & GetIupacna(void) const
Get the variant data.
TLength GetLength(void) const
Get the Length member data.
bool CanGetSeq_data(void) const
Check if it is safe to call GetSeq_data method.
bool IsIupacna(void) const
Check if variant Iupacna is selected.
const TSeq_data & GetSeq_data(void) const
Get the Seq_data member data.
TType GetType(void) const
Get the Type member data.
const TInstance & GetInstance(void) const
Get the variant data.
const TVariant_prop & GetVariant_prop(void) const
Get the Variant_prop member data.
E_Choice Which(void) const
Which variant is currently selected.
TObservation GetObservation(void) const
Get the Observation member data.
const TSet & GetSet(void) const
Get the variant data.
bool IsSetDelta(void) const
Sequence that replaces the location, in biological order.
bool IsSetVariant_prop(void) const
variant properties bit fields Check if a value has been assigned to Variant_prop data member.
const TSample_id & GetSample_id(void) const
Get the Sample_id member data.
list< CRef< CPhenotype > > TPhenotype
bool IsSetAllele_origin(void) const
Check if a value has been assigned to Allele_origin data member.
const TId & GetId(void) const
Get the Id member data.
const TDelta & GetDelta(void) const
Get the Delta member data.
list< CRef< C_E_Somatic_origin > > TSomatic_origin
const TData & GetData(void) const
Get the Data member data.
const TPhenotype & GetPhenotype(void) const
Get the Phenotype member data.
bool CanGetSomatic_origin(void) const
Check if it is safe to call GetSomatic_origin method.
bool CanGetDelta(void) const
Check if it is safe to call GetDelta method.
bool IsInstance(void) const
Check if variant Instance is selected.
TOther_validation GetOther_validation(void) const
Get the Other_validation member data.
const TLiteral & GetLiteral(void) const
Get the variant data.
const TSomatic_origin & GetSomatic_origin(void) const
Get the Somatic_origin member data.
bool CanGetObservation(void) const
Check if it is safe to call GetObservation method.
bool IsSet(void) const
Check if variant Set is selected.
const TParent_id & GetParent_id(void) const
Get the Parent_id member data.
list< CRef< CDelta_item > > TDelta
bool IsSetOther_validation(void) const
has this variant been validated? While a boolean flag offers no subtle distinctions of validation met...
bool CanGetParent_id(void) const
Check if it is safe to call GetParent_id method.
bool IsSetVariations(void) const
Check if a value has been assigned to Variations data member.
bool IsSetId(void) const
ids (i.e., SNP rsid / ssid, dbVar nsv/nssv) expected values include 'dbSNP|rs12334',...
bool CanGetSample_id(void) const
Check if it is safe to call GetSample_id method.
bool CanGetPhenotype(void) const
Check if it is safe to call GetPhenotype method.
bool CanGetId(void) const
Check if it is safe to call GetId method.
const TVariations & GetVariations(void) const
Get the Variations member data.
TAllele_origin GetAllele_origin(void) const
Get the Allele_origin member data.
bool IsSetData(void) const
Check if a value has been assigned to Data data member.
@ eType_snv
delta=[morph of length 1] NOTE: this is snV not snP; the latter requires frequency-based validation t...
@ eType_mnp
delta=[morph of length >1]
@ eType_delins
delta=[del, ins]
@ eAllele_origin_not_tested
@ eAllele_origin_paternal
@ eAllele_origin_tested_inconclusive
@ eAllele_origin_biparental
@ eAllele_origin_uniparental
@ eAllele_origin_maternal
@ eAllele_origin_inherited
@ eAllele_origin_other
stopper - 2^31
@ e_This
same location as variation-ref itself
@ eObservation_reference
inst represents the reference base at the position
static const string kBaseUrl
static int s_GetChildNum(const objects::CSeq_feat &feat)
Int4 delta(size_t dimension_, const Int4 *score_)