count_by_complexity[] = {0, 0};
91 if(sub_node->GetType() ==
type) {
95 for( ; sub_iter != sub_node.
SubNodeEnd(); ) {
106 while(hoisted != 0);
116hard_nodes.push_back(node.
DetachNode(*iter++));
145: m_RemoveDuplicates(
false)
146, m_IsDryRun(
false)
152: m_RemoveDuplicates(
false)
153, m_IsDryRun(
false)
161 static const char*sc_Functions[] = {
177vector<string> func_vec;
178 for(
const char** func = sc_Functions; func && *func; ++func) {
179func_vec.push_back(*func);
250 constobjects::CSeq_id_Handle& subj,
289 if(
Match(**iter)) {
290aligns_out.push_back(*iter);
383 boolcompart_match =
true;
402compart_match =
false;
419 if(cit != qit->second.end()) {
432 returncompart_match;
466ostr <<
"Parse Tree:"<< endl;
486 md5.GetChecksum().GetMD5Digest(md5_str);
491 constobjects::CSeq_align& align,
492 boolthrow_if_not_found)
498(*m_DryRunOutput) << score_name <<
": " 506 if( throw_if_not_found)
510 _TRACE(
Trace<<
"score "<< score_name <<
" not found");
513 returnnumeric_limits<double>::quiet_NaN();
519 doublethis_val = numeric_limits<double>::quiet_NaN();
520 string function= node.
GetValue().GetStrValue();
530 "invalid number of nodes: expected 2, got 1");
536 "invalid number of nodes: " 537 "expected 2, got more than 2");
543this_val = val1 * val2;
555 "invalid number of nodes: expected 2, got 1");
561 "invalid number of nodes: " 562 "expected 2, got more than 2");
571 if(val1 !=
round(val1)) {
573 "MOD() function requires an integral operand: " 579 if(val2 !=
round(val2)) {
581 "MOD() function requires an integral base: " 590 "MOD() requires a positive base");
605 "invalid number of nodes: expected 2, got 1");
611 "invalid number of nodes: " 612 "expected 2, got more than 2");
618this_val = val1 / val2;
629 "invalid number of nodes: expected 2, got 1");
635 "invalid number of nodes: " 636 "expected 2, got more than 2");
642this_val = val1 + val2;
653 "invalid number of nodes: expected 2, got 1");
659 "invalid number of nodes: " 660 "expected 2, got more than 2");
666this_val = val1 - val2;
676 for( ; iter != end; ++iter) {
700 "invalid number of nodes: expected 1, got more than 1");
706 "invalid seg type - expected string");
708 const string& s = node1.
GetValue().GetStrValue();
746 "invalid seg type: "+ s);
755 const string& which = node1.
GetValue().GetStrValue();
756 if(which !=
"query"&& which !=
"subject") {
758 "Invalid first argument to HAS_DESC_KEYWORD; must be " 759 "either 'query' or 'subject'");
765 "invalid number of nodes: expected 2, got 1");
768 const string& keyword = node2.
GetValue().GetStrValue();
772 "invalid number of nodes: " 773 "expected 2, got more than 2");
776 boolfound_keyword =
false;
785desc_ci && !found_keyword; ++desc_ci)
788 switch(desc_ci->Which()) {
790 if(desc_ci->GetGenbank().IsSetKeywords()) {
791keywords = &desc_ci->GetGenbank().GetKeywords();
796 if(desc_ci->GetPir().IsSetKeywords()) {
797keywords = &desc_ci->GetPir().GetKeywords();
802 if(desc_ci->GetSp().IsSetKeywords()) {
803keywords = &desc_ci->GetSp().GetKeywords();
808 if(desc_ci->GetEmbl().IsSetKeywords()) {
809keywords = &desc_ci->GetEmbl().GetKeywords();
814 if(desc_ci->GetPrf().IsSetKeywords()) {
815keywords = &desc_ci->GetPrf().GetKeywords();
826found_keyword =
true;
834 returnfound_keyword ? 1 : 0;
842 const string& which = node1.
GetValue().GetStrValue();
843 if(which !=
"query"&& which !=
"subject") {
845 "Invalid first argument to OVERLAPS_ANNOTS; must be " 846 "either 'query' or 'subject'");
854 "invalid number of nodes: expected 2, got 1");
857 const string& regions_file = node2.
GetValue().GetStrValue();
861 "invalid number of nodes: " 862 "expected 2, got more than 2");
865 if(!regions.count(idh)) {
871 returnoverlap.
Empty() ? 0 : 1;
875 "function not understood: "+
function);
885 if(region_map.
empty()) {
899 while(!is->EndOfData()) {
904regions_file +
" does not contain feature tables");
908*feat->GetLocation().GetId());
909region_map[idh] += feat->GetLocation().GetTotalRange();
933 boolthrow_if_not_found)
938 returnterm_node.
GetValue().GetInt();
940 returnterm_node.
GetValue().GetDouble();
961 "unexpected expression");
976 strings = l_node.
GetValue().GetStrValue();
987constant_seqid =
false;
992constant_seqid =
false;
995constant_seqid =
true;
999 if(constant_seqid) {
1000(*m_DryRunOutput) <<
val<<
": SeqId, ";
1003(*m_DryRunOutput) <<
"No synonyms";
1005(*m_DryRunOutput) <<
"synonyms ";
1007 if(syn_it != syns->begin()) {
1008(*m_DryRunOutput) <<
",";
1013(*m_DryRunOutput) << endl;
1026 if(other_idh == idh) {
1053 "Should reach this point only with equality");
1056 if( !syns || syns->empty() ) {
1059 return(syns->ContainsSynonym(other_idh) == !is_not);
1073}
else if(
val.size() != 1) {
1075 "Valid strand values are '+', '-', 'b' and '?'");
1097 "Valid strand values are '+', '-, 'b'' and '?'");
1112 returnother_strand == strand ? !is_not : is_not;
1115 "unhandled parse node in expression");
1134 stringstatus_string =
"MODEL";
1152 "unhandled parse node in expression");
1169 return((l_val == r_val) == !is_not);
1172 return((l_val < r_val) == !is_not);
1175 return((l_val <= r_val) == !is_not);
1178 return((l_val > r_val) == !is_not);
1181 return((l_val >= r_val) == !is_not);
1206 boolbetween = (val1 <= this_val) && (this_val <= val2);
1207 return(between == !is_not);
1241 switch(node.
GetValue().GetType()) {
1256 "invalid number of nodes: expected 2, got 1");
1262 "invalid number of nodes: " 1263 "expected 2, got more than 2");
1283 "invalid number of nodes: expected 3, got 1");
1289 "invalid number of nodes: " 1290 "expected 3, got 2");
1297 "invalid number of nodes: " 1298 "expected 3, got more than 3");
1303 "unexpected expression");
1307node2, node3, align);
1317res =
x_Match(**iter, align);
1326res &=
x_Match(**iter, align);
1338res = !
x_Match(**iter, align);
1350res =
x_Match(**iter, align);
1359res |=
x_Match(**iter, align);
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.
static bool s_IsDouble(const string &str)
Checksum and hash calculation classes.
CAlignFilter exposes a query language for inspecting properties and scores placed on Seq-align object...
bool x_Query_Op(const CQueryParseTree::TNode &key_node, CQueryParseNode::EType type, bool is_not, const CQueryParseTree::TNode &val_node, const objects::CSeq_align &align)
set< objects::CSeq_id_Handle > m_QueryWhitelist
objects::CScoreLookup m_ScoreLookup
void AddWhitelistSubjectId(const objects::CSeq_id_Handle &idh)
set< objects::CSeq_id_Handle > m_QueryExcludeNotIn
objects::CScope & SetScope()
bool x_Match(const CQueryParseTree::TNode &node, const objects::CSeq_align &align)
void AddBlacklistQueryId(const objects::CSeq_id_Handle &idh)
Add a sequence to a blacklist.
double x_GetAlignmentScore(const string &score_name, const objects::CSeq_align &align, bool throw_if_not_found=false)
void SetFilter(const string &filter_string)
Set the query to be used.
void PrintDictionary(CNcbiOstream &)
Print out the dictionary of score generators.
set< objects::CSeq_id_Handle > m_SubjectWhitelist
CNcbiOstream * m_DryRunOutput
CAlignFilter & SetRemoveDuplicates(bool b=true)
Remove duplicate alignments when filtering NOTE: this may be expensive for a large number of alignmen...
set< objects::CSeq_id_Handle > m_SubjectBlacklist
bool m_IsDryRun
Flag indicating whether this is a dry run of the filter.
set< objects::CSeq_id_Handle > m_QueryBlacklist
void x_ParseTree_Flatten(CQueryParseTree &tree, CQueryParseTree::TNode &node)
TQuerySubjCompartments m_QSComparts
TRegionMapCache m_RegionMapCache
void AddWhitelistQueryId(const objects::CSeq_id_Handle &idh)
Add a sequence to the white list.
CRef< objects::CScope > m_Scope
bool Match(const objects::CSeq_align &align)
Match a single alignment.
set< objects::CSeq_id_Handle > m_SubjectExcludeNotIn
double x_TermValue(const CQueryParseTree::TNode &term_node, const objects::CSeq_align &align, bool throw_if_not_found=false)
TUniqueAligns m_UniqueAligns
void AddBlacklistSubjectId(const objects::CSeq_id_Handle &idh)
double x_FuncCall(const CQueryParseTree::TNode &func_node, const objects::CSeq_align &align)
objects::CScoreLookup::IScore::EComplexity x_Complexity(const CQueryParseTree::TNode &node)
void AddQSRangeRestriction(const objects::CSeq_id_Handle &qid, const objects::CSeq_id_Handle &sid, TSeqRange subj_range)
Add a specific query/subject range restriction.
void DryRun(CNcbiOstream &)
Do a dry run of the filter, printing out the parse tree and looking up all strings.
bool x_Query_Range(const CQueryParseTree::TNode &key_node, bool is_not, const CQueryParseTree::TNode &val1_node, const CQueryParseTree::TNode &val2_node, const objects::CSeq_align &align)
const TRegionMap & x_GetRegionMap(const string ®ions_file)
void Filter(const list< CRef< objects::CSeq_align > > &aligns_in, list< CRef< objects::CSeq_align > > &aligns_out)
Filter a set of alignments, iteratively applying Match() to each alignment and emitting all matched a...
bool x_IsUnique(const objects::CSeq_align &align)
void AddExcludeNotInSubjectId(const objects::CSeq_id_Handle &idh)
unique_ptr< CQueryParseTree > m_ParseTree
void AddExcludeNotInQueryId(const objects::CSeq_id_Handle &idh)
Add a sequence to the exclude-not-in list If an alignment does not match one of the IDs,...
CChecksumStreamWriter â.
Class implements different ad-hoc unreliable file format identifications.
EFormat
The formats are checked in the same order as declared here.
@ eBinaryASN
Binary ASN.1.
EFormat GuessFormat(EMode)
Query tree and associated utility methods.
TThisType & IntersectWith(const TRange &r)
CRangeCollection< TSeqPos > GetAlignedBases(TDim row) const
Retrieves the locations of aligned bases in the given row, excluding gaps and incontinuities.
CRange< TSeqPos > GetSeqRange(TDim row) const
GetSeqRange NB: On a Spliced-seg, in case the product-type is protein, these only return the amin par...
TDim CheckNumRows(void) const
Validatiors.
const CSeq_id & GetSeq_id(TDim row) const
Get seq-id (the first one if segments have different ids).
ENa_strand GetSeqStrand(TDim row) const
Get strand (the first one if segments have different strands).
bool IsFtable(void) const
static CSeq_id_Handle GetSeq_id_Handle(const const_iterator &iter)
vector< value_type > TIdSet
definition of a Culling tree
const CUser_field & GetField(const string &str, const string &delim=".", NStr::ECase use_case=NStr::eCase) const
Access a named field in this user object.
Writer-based output stream.
container_type::const_iterator const_iterator
const_iterator end() const
const_iterator find(const key_type &key) const
iterator_bool insert(const value_type &val)
const_iterator find(const key_type &key) const
const_iterator end() const
static const char * str(char *buf, int n)
static void md5(const char *src, const char *out)
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
void swap(NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair1, NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair2)
#define NCBI_ASSERT(expr, mess)
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
void Trace(CExceptionArgs_Base &args)
void Warning(CExceptionArgs_Base &args)
#define MSerial_AsnBinary
@ eSerial_AsnText
ASN.1 text.
@ eSerial_AsnBinary
ASN.1 binary.
CConstRef< CSeq_id > GetSeqId(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
static CObjectIStream * Open(ESerialDataFormat format, CNcbiIstream &inStream, bool deleteInStream)
Create serial object reader and attach it to an input stream.
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,...
@ eGetId_Best
return the "best" gi (uses FindBestScore(), with CSeq_id::CalculateScore() as the score function
static CRef< CObjectManager > GetInstance(void)
Return the existing object manager or create one.
void Reset(void)
Reset reference object.
int64_t Int8
8-byte (64-bit) signed integer
@ eCaseInsensitive
Case insensitive parsing (AnD)
@ eFloatConst
Floating point const.
@ eIntConst
Integer const.
@ eString
String ("free text")
@ eSyntaxCheck
Best possible check for errors.
bool IntersectingWith(const TThisType &r) const
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::ofstream CNcbiOfstream
Portable alias for ofstream.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
static double StringToDouble(const CTempStringEx str, TStringToNumFlags flags=0)
Convert string to double.
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.
TNodeList::iterator TNodeList_I
TTreeType * DetachNode(TTreeType *subnode)
Remove the subtree from the tree without destroying it.
void RemoveNode(TTreeType *subnode)
Remove subnode of the current node.
TNodeList_CI SubNodeBegin(void) const
Return first const iterator on subnode list.
TNodeList::const_iterator TNodeList_CI
void AddNode(TTreeType *subnode)
Add new subnode.
TNodeList_CI SubNodeEnd(void) const
Return last const iterator on subnode list.
list< TTreeType * > TNodeList
const TValue & GetValue(void) const
Return node's value.
const TStr & GetStr(void) const
Get the variant data.
bool IsStr(void) const
Check if variant Str is selected.
const TData & GetData(void) const
Get the Data member data.
const TStr & GetStr(void) const
Get the variant data.
const TType & GetType(void) const
Get the Type member data.
Tdata & Set(void)
Assign a value to data member.
bool IsPacked(void) const
Check if variant Packed is selected.
bool IsSparse(void) const
Check if variant Sparse is selected.
bool IsDendiag(void) const
Check if variant Dendiag is selected.
bool IsStd(void) const
Check if variant Std is selected.
bool IsDisc(void) const
Check if variant Disc is selected.
bool IsSpliced(void) const
Check if variant Spliced is selected.
const Tdata & Get(void) const
Get the member data.
const TSegs & GetSegs(void) const
Get the Segs member data.
bool IsDenseg(void) const
Check if variant Denseg is selected.
ENa_strand
strand of nucleic acid
bool IsOther(void) const
Check if variant Other is selected.
@ eNa_strand_both
in forward orientation
void SetData(TData &value)
Assign a value to Data data member.
const TAlign & GetAlign(void) const
Get the variant data.
const TFtable & GetFtable(void) const
Get the variant data.
const TData & GetData(void) const
Get the Data member data.
@ e_Embl
EMBL specific information.
@ e_User
user defined object
@ e_Pir
PIR specific info.
@ e_Genbank
GenBank specific info.
@ e_Prf
PRF specific information.
@ e_Sp
SWISSPROT specific info.
The blob sat and sat key Both must be positive integers</td > n< td > Non empty string The interpretation of the blob id depends on a processor Cassandra n processor expects the following format
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
static int match(PCRE2_SPTR start_eptr, PCRE2_SPTR start_ecode, uint16_t top_bracket, PCRE2_SIZE frame_size, pcre2_match_data *match_data, match_block *mb)
Reader-writer based streams.
#define row(bind, expected)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4