81 static const vector<string> info_fields{
"SVTYPE",
"POS",
"END",
"CIPOS",
"CIEND",
"SVLEN",
"CLNSIG",
"CLNREVSTAT",
"CLNVC",
"CLNVCSO",
"MC",
"RS",
"DBVARID" };
83 auto &info_map =
result->SetInfoColumns();
84 for (
const auto &field : info_fields) {
89 result->ParseInfoColumns();
97 vector<unsigned> blob_pos;
102 for(
auto pos: blob_pos) {
109 if (vcf_object && vcf_object->GetID() == sSearchTerm) {
110 results.push_back(vcf_object);
148 for (
const auto& annotdesc : prj_item.
GetDescr()) {
149 if (!annotdesc->IsSrc())
151 const auto& prj_seq_id = annotdesc->GetSrc();
183 static string sid(
"vcf_nonasn_track_data_factory_type");
189 static string label(
"VCF Non-ASN1 Track Data Factory Type");
233 TJobToken token,
int max_feat,
288 const CSeq_id&
id =
dynamic_cast<const CSeq_id&
>(
object.object.GetObject());
297 static string sid(
"vcf_feature_ds_type");
304 static string slabel(
"Graphical View VCF Feature Data Source Type");
321 bool show_only_pathogenic)
324 , m_FeatLimit(max_feat)
325 , m_VcfBlob(vcf_blob)
326 , m_ShowOnlyPathogenic(show_only_pathogenic)
376 auto opt_start = chrono::steady_clock::now();
378 auto diff_opt = chrono::steady_clock::now() - opt_start;
379 auto exec_time_ms = chrono::duration_cast<chrono::milliseconds>(diff_opt).count();
383 const auto &annot_name =
m_Sel.GetIncludedAnnotsNames()[0].GetName();
387 data->GetHistogram(
m_Range, dmap);
391 auto hist_calc_time = CalculateHistogram(VCFHistogram);
394 if (hist_calc_time > 50) {
397 data->SetData(VCFHistogram);
405 result->m_ObjectList.push_back(glyph);
416 if(var->GetPos() ==
size_t(-1)) {
417 LOG_POST(
Error <<
"CVcfVariant with pos == -1: " << var->GetID());
421 const auto &info_fields = var->GetInfoColumns();
422 auto clnsig_it = info_fields.find(
"CLNSIG");
423 if (clnsig_it == info_fields.end()) {
427 static set<string> pathogens = {
"pathogenic/likely_pathogenic",
"likely_pathogenic",
"pathogenic" };
428 string clinsig = clnsig_it->second;
430 if (0 == pathogens.count(clinsig)) {
439 result->m_ObjectList.push_back(glyph);
450 }
catch (std::exception& ex) {
User-defined methods of the data storage class.
User-defined methods of the data storage class.
CAppJobError Default implementation for IAppJobError - encapsulates a text error message.
void SaveData(CRef< TData > data)
Clones TData, puts it into Save Queue for asynchroneous storage operation.
CRef< TData > GetData(const string &data_key)
Retrieves TData from in-memory cache or if not found calls TData::Init to initialize new TData instan...
static CGraphCache & GetInstance()
CRef< TData > GetCachedData(const string &data_key)
Retrieves TData from in-memory cache.
static int GetNearestLevel(const set< int > &levels, double zoom)
objects::SAnnotSelector m_Sel
our annotation selector
TSeqRange m_Range
target range
objects::CBioseq_Handle m_Handle
target sequence
TJobID x_LaunchJob(IAppJob &job, int report_period=1, const string &pool="ObjManagerEngine")
Launch either a background or foreground job.
objects::CBioseq_Handle & GetBioseqHandle(void)
Get the underlying bioseq handle.
TGraphLevels m_GraphLevels
Existing coverage graph levels.
objects::CBioseq_Handle m_Handle
CSGJobResult – the data structure holding the seqgraphic job results.
virtual void SetTaskTotal(int total)
virtual void SetTaskName(const string &name)
virtual void SetTaskCompleted(int completed)
set total finished task number.
void SetToken(TJobToken token)
CSeqGraphicJob inline methods.
TJobToken m_Token
Job token recognizable by job listener.
CRef< CAppJobError > m_Error
virtual bool GetPositionsForVariant(const string &variant_id, vector< unsigned > &positions)
string GetVariantID() const
string GetInfoField(const string &field_name) const
bool IsSetInfoField(const string &field_name) const
unsigned GetPosition() const
static const string sm_ALT
static const string sm_ID
static const string sm_INFO
static const string sm_REF
void GetHistogram(svector &hist, const svector::size_type &bin_width) const
virtual ISGDataSource * CreateDS(SConstScopedObject &object) const
create an instance of the layout track type using default settings.
virtual string GetExtensionLabel() const
returns a displayable label for this extension ( please capitalize the key words - "My Extension" )
virtual bool IsSharable() const
check if the data source can be shared.
virtual string GetExtensionIdentifier() const
returns the unique human-readable identifier for the extension the id should use lowercase letters se...
CConstIRef< INonAsnDataRegistry > m_DataRegistry
virtual void LoadFeatures(objects::SAnnotSelector &sel, const TSeqRange &range, TModelUnit window, TJobToken token=-1, int max_feat=-1, ELinkedFeatDisplay LinkedFeatDisplay=ELinkedFeatDisplay::eLFD_Default, const string &="")
void SetNonAsnDataRegistry(const INonAsnDataRegistry *registry)
bool HasNonAsnData(const string &annot_name) const
INonAsnTrackData::TDataBlob TDataBlob
CVcfFeatureDS(objects::CScope &scope, const objects::CSeq_id &id)
CVcfFeatureDS.
bool m_ShowOnlyPathogenic
virtual void DoSearch(const string &annot_name, const string &sSearchTerm, list< CRef< CObject >> &results) const
const TDataBlob & GetNonAsnDataBlob(const string &annot_name) const
size_t GetFeaturesCountInRange(const string &annot_name, const TSeqRange &range)
CVcfFeatureJob: a job class for loading annotated features from a given sequence and visible range.
int m_FeatLimit
the maximum number of features allowed.
CVcfFeatureJob(const string &desc, CBioseq_Handle handle, const SAnnotSelector &sel, const TSeqRange &range, TModelUnit window, int max_feat, TJobToken token, const TDataBlob &vcf_blob, bool show_only_pathogenic)
INonAsnTrackData::TDataBlob TDataBlob
virtual EJobState x_Execute()
method truly doing the job.
TModelUnit m_Window
current window for smear bars
const TDataBlob & m_VcfBlob
bool m_ShowOnlyPathogenic
static string GetCacheKey(const string &annot_name, const size_t bin_width)
static void InitHistogramGlyph(size_t bin_width, const TSeqRange &range, const THistogramVector &histogram, CHistogramGlyph::TMap &dmap)
INonAsnTrackData * CreateTrackData(const objects::CSeq_id &seq_id, const objects::CProjectItem &prj_item) const
string GetExtensionLabel() const
returns a displayable label for this extension ( please capitalize the key words - "My Extension" )
string GetExtensionIdentifier() const
returns the unique human-readable identifier for the extension the id should use lowercase letters se...
virtual void DoSearch(const objects::CSeq_id *seq_id, const string &sSearchTerm, list< CRef< CObject >> &results) const
const string GetDataSourceTypeName() const
const TDataBlob & GetBlob() const
succinct sparse vector with runtime compression using bit-slicing / transposition method
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
void Error(CExceptionArgs_Base &args)
const string & GetMsg(void) const
Get message string.
virtual const char * what(void) const noexcept
Standard report (includes full backlog).
void Info(CExceptionArgs_Base &args)
INonAsnTrackData::TDataBlob TDataBlob
EJobState
Job states (describe FSM)
const string AsFastaString(void) const
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Optimized implementation of CSerialObject::Assign, which is not so efficient.
const TAnnotsNames & GetIncludedAnnotsNames(void) const
void Reset(void)
Reset reference object.
void Reset(void)
Reset reference object.
position_type GetLength(void) const
CRange< TSeqPos > TSeqRange
typedefs for sequence ranges
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
static string & ToLower(string &str)
Convert string to lower case – string& version.
@ eNocase
Case insensitive compare.
static const char label[]
TTo GetTo(void) const
Get the To member data.
TFrom GetFrom(void) const
Get the From member data.
const TType & GetType(void) const
Get the Type member data.
const TData & GetData(void) const
Get the Data member data.
const TItem & GetItem(void) const
Get the Item member data.
bool IsSetDescr(void) const
user-defined descriptors Check if a value has been assigned to Descr data member.
const TDescr & GetDescr(void) const
Get the Descr member data.
const TOther & GetOther(void) const
Get the variant data.
bool IsOther(void) const
Check if variant Other is selected.
unsigned int
A callback function used to compare two keys in a database.
bm::id_t bvector_size_type
range(_Ty, _Ty) -> range< _Ty >
const struct ncbi::grid::netcache::search::fields::SIZE size
static bool GetSeqId(const T &d, set< string > &labels, const string name="", bool detect=false, bool found=false)
static CRef< CVcfVariant > s_CreateVcfGlyph(const objects::CSeq_id &seq_id, const CVCFVariant_CI &variant_CI)
static const float kMinScaleForMapping
static const size_t kMaxChildNum
static const int kMaxObjNum
static const int kMaxFeatures
static void s_DoSearch(const CSeq_id *seq_id, const INonAsnTrackData::TDataBlob &vcf_blob, const string &sSearchTerm, list< CRef< CObject >> &results)
static const float kSeqZoomLevel