本文整理汇总了C++中CSeq_feat::GetNamedQual方法的典型用法代码示例。如果您正苦于以下问题:C++ CSeq_feat::GetNamedQual方法的具体用法?C++ CSeq_feat::GetNamedQual怎么用?C++ CSeq_feat::GetNamedQual使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSeq_feat
的用法示例。
在下文中一共展示了CSeq_feat::GetNamedQual方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: xMapMiscRecomb
// ----------------------------------------------------------------------------
bool CSoMap::xMapMiscRecomb(
const CSeq_feat& feature,
string& so_type)
// ----------------------------------------------------------------------------
{
map<string, string> mapRecombClassToSoType = {
{"meiotic", "meiotic_recombination_region"},
{"mitotic", "mitotic_recombination_region"},
{"non_allelic_homologous", "non_allelic_homologous_recombination_region"},
{"meiotic_recombination", "meiotic_recombination_region"},
{"mitotic_recombination", "mitotic_recombination_region"},
{"non_allelic_homologous_recombination", "non_allelic_homologous_recombination_region"},
{"other", "recombination_region"},
};
string recomb_class = feature.GetNamedQual("recombination_class");
if (recomb_class.empty()) {
return false;
}
auto cit = mapRecombClassToSoType.find(recomb_class);
if (cit == mapRecombClassToSoType.end()) {
so_type = recomb_class;
return true;
}
so_type = cit->second;
return true;
}
示例2: xMapNcRna
// ----------------------------------------------------------------------------
bool CSoMap::xMapNcRna(
const CSeq_feat& feature,
string& so_type)
// ----------------------------------------------------------------------------
{
map<string, string> mapNcRnaClassToSoType = {
{"lncRNA", "lnc_RNA"},
{"other", "ncRNA"},
};
string ncrna_class = feature.GetNamedQual("ncRNA_class");
if (ncrna_class.empty()) {
if (feature.IsSetData() &&
feature.GetData().IsRna() &&
feature.GetData().GetRna().IsSetExt() &&
feature.GetData().GetRna().GetExt().IsGen() &&
feature.GetData().GetRna().GetExt().GetGen().IsSetClass()) {
ncrna_class = feature.GetData().GetRna().GetExt().GetGen().GetClass();
if (ncrna_class == "classRNA") {
ncrna_class = "ncRNA";
}
}
}
if (ncrna_class.empty()) {
return false;
}
auto cit = mapNcRnaClassToSoType.find(ncrna_class);
if (cit == mapNcRnaClassToSoType.end()) {
so_type = ncrna_class;
return true;
}
so_type = cit->second;
return true;
}
示例3: xMapRegulatory
// ----------------------------------------------------------------------------
bool CSoMap::xMapRegulatory(
const CSeq_feat& feature,
string& so_type)
// ----------------------------------------------------------------------------
{
map<string, string> mapRegulatoryClassToSoType = {
{"DNase_I_hypersensitive_site", "DNaseI_hypersensitive_site"},
{"GC_signal", "GC_rich_promoter_region"},
{"enhancer_blocking_element", "regulatory_region"},
{"imprinting_control_region", "regulatory_region"},
{"matrix_attachment_region", "matrix_attachment_site"},
{"other", "regulatory_region"},
{"response_element", "regulatory_region"},
{"ribosome_binding_site", "ribosome_entry_site"},
};
string regulatory_class = feature.GetNamedQual("regulatory_class");
if (regulatory_class.empty()) {
return false;
}
auto cit = mapRegulatoryClassToSoType.find(regulatory_class);
if (cit == mapRegulatoryClassToSoType.end()) {
so_type = regulatory_class;
return true;
}
so_type = cit->second;
return true;
}
示例4: xMapRepeatRegion
// ----------------------------------------------------------------------------
bool CSoMap::xMapRepeatRegion(
const CSeq_feat& feature,
string& so_type)
// ----------------------------------------------------------------------------
{
map<string, string> mapSatelliteToSoType = {
{"satellite", "satellite_DNA"},
{"microsatellite", "microsatellite"},
{"minisatellite", "minisatellite"},
};
string satellite = feature.GetNamedQual("satellite");
if (!satellite.empty()) {
auto cit = mapSatelliteToSoType.find(satellite);
if (cit == mapSatelliteToSoType.end()) {
return false;
}
so_type = cit->second;
return true;
}
map<string, string> mapRptTypeToSoType = {
{"tandem", "tandem_repeat"},
{"inverted", "inverted_repeat"},
{"flanking", "repeat_region"},
{"terminal", "repeat_region"},
{"direct", "direct_repeat"},
{"dispersed", "dispersed_repeat"},
{"nested", "nested_repeat"},
{"non_ltr_retrotransposon_polymeric_tract", "non_LTR_retrotransposon_polymeric_tract"},
{"x_element_combinatorical_repeat", "X_element_combinatorical_repeat"},
{"y_prime_element", "Y_prime_element"},
{"other", "repeat_region"},
};
string rpt_type = feature.GetNamedQual("rpt_type");
if (rpt_type.empty()) {
so_type = "repeat_region";
}
auto cit = mapRptTypeToSoType.find(rpt_type);
if (cit == mapRptTypeToSoType.end()) {
so_type = rpt_type;
return true;
}
so_type = cit->second;
return true;
}
示例5: xWriteSingleFeature
// ----------------------------------------------------------------------------
bool CBedGraphWriter::xWriteSingleFeature(
const CBedTrackRecord& trackdata,
const CSeq_feat& feature)
// ----------------------------------------------------------------------------
{
CBedGraphRecord bedRecord;
const CSeq_loc& location = feature.GetLocation();
if (!location.IsInt()) {
NCBI_THROW(
CObjWriterException,
eInterrupted,
"BedGraph writer does not support feature locations that are not intervals.");
}
const CSeq_interval& interval = location.GetInt();
const string& scoreStr = feature.GetNamedQual("score");
if (scoreStr.empty()) {
NCBI_THROW(
CObjWriterException,
eInterrupted,
"BedGraph writer only supports features with a \"score\" qualifier.");
}
double score = 0;
try {
score = NStr::StringToDouble(scoreStr);
}
catch(CException&) {
NCBI_THROW(
CObjWriterException,
eInterrupted,
"BedGraph writer encountered feature with bad \"score\" qualifier.");
}
const CSeq_id& id = interval.GetId();
string recordId;
id.GetLabel(&recordId);
bedRecord.SetChromId(recordId);
bedRecord.SetChromStart(interval.GetFrom());
bedRecord.SetChromEnd(interval.GetTo()-1);
bedRecord.SetChromValue(score);
bedRecord.Write(m_Os);
return true;
}
示例6: xMapBond
// ----------------------------------------------------------------------------
bool CSoMap::xMapBond(
const CSeq_feat& feature,
string& so_type)
// ----------------------------------------------------------------------------
{
map<string, string> mapBondTypeToSoType = {
{"disulfide", "disulfide_bond"},
{"xlink", "cross_link"},
};
string bond_type = feature.GetNamedQual("bond_type");
if (bond_type.empty()) {
return false;
}
auto cit = mapBondTypeToSoType.find(bond_type);
if (cit == mapBondTypeToSoType.end()) {
so_type = bond_type;
return true;
}
so_type = cit->second;
return true;
}
示例7: xMapMiscFeature
// ----------------------------------------------------------------------------
bool CSoMap::xMapMiscFeature(
const CSeq_feat& feature,
string& so_type)
// ----------------------------------------------------------------------------
{
map<string, string> mapFeatClassToSoType = {
{"transcription_start_site", "TSS"},
{"other", "sequence_feature"},
};
string feat_class = feature.GetNamedQual("feat_class");
if (feat_class.empty()) {
so_type = "sequence_feature";
return true;
}
auto cit = mapFeatClassToSoType.find(feat_class);
if (cit == mapFeatClassToSoType.end()) {
so_type = feat_class;
return true;
}
so_type = cit->second;
return true;
}