本文整理汇总了C++中CSeq_feat类的典型用法代码示例。如果您正苦于以下问题:C++ CSeq_feat类的具体用法?C++ CSeq_feat怎么用?C++ CSeq_feat使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CSeq_feat类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: xFeatureMakeRegulatory
// ----------------------------------------------------------------------------
bool CSoMap::xFeatureMakeRegulatory(
const string& so_type,
CSeq_feat& feature)
// ----------------------------------------------------------------------------
{
static const map<string, string, CompareNoCase> mapTypeToQual = {
{"DNAsel_hypersensitive_site", "DNase_I_hypersensitive_site"},
{"GC_rich_promoter_region", "GC_signal"},
{"boundary_element", "insulator"},
{"regulatory_region", "other"},
{"ribosome_entry_site", "ribosome_binding_site"},
};
feature.SetData().SetImp().SetKey("regulatory");
CRef<CGb_qual> regulatory_class(new CGb_qual);
regulatory_class->SetQual("regulatory_class");
auto cit = mapTypeToQual.find(so_type);
if (cit == mapTypeToQual.end()) {
regulatory_class->SetVal(so_type);
}
else {
regulatory_class->SetVal(cit->second);
}
feature.SetQual().push_back(regulatory_class);
return true;
}
示例2: AssignPhase
// ----------------------------------------------------------------------------
bool CGffRecord::AssignPhase(
const CSeq_feat& feature )
// ----------------------------------------------------------------------------
{
m_strPhase = ".";
if ( ! feature.CanGetData() ) {
return true;
}
const CSeq_feat::TData& data = feature.GetData();
if ( data.GetSubtype() != CSeq_feat::TData::eSubtype_cdregion ) {
return true;
}
const CCdregion& cdr = data.GetCdregion();
CCdregion::TFrame frame = cdr.GetFrame();
switch ( frame ) {
default:
break;
case CCdregion::eFrame_one:
m_strPhase = "0";
break;
case CCdregion::eFrame_two:
m_strPhase = "1";
break;
case CCdregion::eFrame_three:
m_strPhase = "2";
break;
}
return true;
}
示例3: xFeatureMakeRegion
// ----------------------------------------------------------------------------
bool CSoMap::xFeatureMakeRegion(
const string& so_type,
CSeq_feat& feature)
// ----------------------------------------------------------------------------
{
feature.SetData().SetRegion();
CRef<CGb_qual> qual(new CGb_qual("SO_type", so_type));
feature.SetQual().push_back(qual);
return true;
}
示例4: xFeatureMakeGene
// ----------------------------------------------------------------------------
bool CSoMap::xFeatureMakeGene(
const string& so_type,
CSeq_feat& feature)
// ----------------------------------------------------------------------------
{
feature.SetData().SetGene();
if (so_type == "pseudogene") {
feature.SetPseudo(true);
}
return true;
}
示例5: xFeatureMakeMiscRna
// ----------------------------------------------------------------------------
bool CSoMap::xFeatureMakeMiscRna(
const string& so_type,
CSeq_feat& feature)
// ----------------------------------------------------------------------------
{
feature.SetData().SetImp().SetKey("misc_RNA");
if (so_type=="pseudogenic_transcript") {
feature.SetPseudo(true);
}
return true;
}
示例6: AssignStop
// ----------------------------------------------------------------------------
bool CGffRecord::AssignStop(
const CSeq_feat& feature )
// ----------------------------------------------------------------------------
{
if ( feature.CanGetLocation() ) {
const CSeq_loc& location = feature.GetLocation();
unsigned int uEnd = location.GetStop( eExtreme_Positional ) + 1;
m_strEnd = NStr::UIntToString( uEnd );
}
return true;
}
示例7: xFeatureMakeCds
// ----------------------------------------------------------------------------
bool CSoMap::xFeatureMakeCds(
const string& so_type,
CSeq_feat& feature)
// ----------------------------------------------------------------------------
{
feature.SetData().SetCdregion();
if (so_type=="pseudogenic_CDS") {
feature.SetPseudo(true);
}
return true;
}
示例8: CompareFeats
CAnnotCompare::TCompareFlags
CAnnotCompare::CompareFeats(const CSeq_feat& feat1,
CScope& scope1,
const CSeq_feat& feat2,
CScope& scope2,
vector<ECompareFlags>* complex_flags,
list<string>* comments)
{
return CompareFeats(feat1, feat1.GetLocation(), scope1,
feat2, feat2.GetLocation(), scope2,
complex_flags, comments);
}
示例9: while
// ----------------------------------------------------------------------------
bool CGffRecord::AssignType(
const CSeq_feat& feature )
// ----------------------------------------------------------------------------
{
m_strType = "region";
if ( feature.CanGetQual() ) {
const vector< CRef< CGb_qual > >& quals = feature.GetQual();
vector< CRef< CGb_qual > >::const_iterator it = quals.begin();
while ( it != quals.end() ) {
if ( (*it)->CanGetQual() && (*it)->CanGetVal() ) {
if ( (*it)->GetQual() == "standard_name" ) {
m_strType = (*it)->GetVal();
return true;
}
}
++it;
}
}
if ( ! feature.CanGetData() ) {
return true;
}
switch ( feature.GetData().GetSubtype() ) {
default:
m_strType = feature.GetData().GetKey();
break;
case CSeq_feat::TData::eSubtype_gene:
m_strType = "gene";
break;
case CSeq_feat::TData::eSubtype_cdregion:
m_strType = "CDS";
break;
case CSeq_feat::TData::eSubtype_mRNA:
m_strType = "mRNA";
break;
case CSeq_feat::TData::eSubtype_scRNA:
m_strType = "scRNA";
break;
case CSeq_feat::TData::eSubtype_exon:
m_strType = "exon";
break;
}
return true;
}
示例10: 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;
}
示例11: 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;
}
示例12: bestLength
// ----------------------------------------------------------------------------
CConstRef<CSeq_feat> CFeatTableEdit::xGetMrnaParent(
const CSeq_feat& feat)
// ----------------------------------------------------------------------------
{
CConstRef<CSeq_feat> pMrna;
CSeq_feat_Handle sfh = mpScope->GetSeq_featHandle(feat);
CSeq_annot_Handle sah = sfh.GetAnnot();
if (!sah) {
return pMrna;
}
size_t bestLength(0);
CFeat_CI findGene(sah, CSeqFeatData::eSubtype_mRNA);
for ( ; findGene; ++findGene) {
Int8 compare = sequence::TestForOverlap64(
findGene->GetLocation(), feat.GetLocation(),
sequence::eOverlap_Contained);
if (compare == -1) {
continue;
}
size_t currentLength = sequence::GetLength(findGene->GetLocation(), mpScope);
if (!bestLength || currentLength > bestLength) {
pMrna.Reset(&(findGene->GetOriginalFeature()));
bestLength = currentLength;
}
}
return pMrna;
}
示例13: 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;
}
示例14: 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;
}
示例15: 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;
}