30 #ifndef _MISC_DISCREPANCY_DISCREPANCY_H_
31 #define _MISC_DISCREPANCY_DISCREPANCY_H_
37 #define NEW_DISCREPANCY_API
54 #include "testnames.inc"
71 template<eTestTypes _type>
72 using TTypeTag = std::integral_constant<eTestTypes, _type>;
109 unsigned int GetN()
const {
return N; }
114 vector<CRef<CAutofixReport>>
V;
123 eSeverity_warning = 1,
203 template<
typename Container>
204 bool AddTests(
const Container& cont)
207 for_each(cont.begin(), cont.end(), [
this, &success](
const string&
test_name) { success &= this->AddTest(test_name); });
211 virtual void Parse(
const CSerialObject& root,
const string& fname =
kEmptyStr) { Push(root, fname); Parse(); }
212 virtual void TestString(
const string&
str) = 0;
218 eOutput_Summary = 1 << 0,
219 eOutput_Fatal = 1 << 1,
220 eOutput_Ext = 1 << 2,
221 eOutput_Files = 1 << 3
228 static bool IsGui() {
return m_Gui; }
245 void* m_UserData =
nullptr;
CAutofixReport(const string &s, unsigned int n)
vector< CRef< CAutofixReport > > V
const vector< CRef< CAutofixReport > > & GetSubitems()
void AddSubitems(const vector< CRef< CAutofixReport >> &v)
unsigned int GetN() const
virtual string_view GetDescription() const =0
virtual eTestTypes GetType() const =0
virtual string_view GetSName() const =0
virtual const TReportItemList & GetReport() const =0
virtual ~CDiscrepancyCase()
virtual TReportObjectList GetObjects() const =0
virtual eTestNames GetName() const =0
const CDiscrepancyGroup & operator[](size_t n) const
vector< CRef< CDiscrepancyGroup > > m_List
void Add(CRef< CDiscrepancyGroup > child)
virtual void OutputXML(CNcbiOstream &out, unsigned short flags)=0
virtual void Merge(CDiscrepancyProduct &other)=0
virtual void Summarize()=0
virtual void OutputText(CNcbiOstream &out, unsigned short flags, char group=0)=0
virtual CRef< CDiscrepancyProduct > RunTests(const TTestNamesSet &testnames, const CSerialObject &object, const string &filename)=0
virtual void AddTest(eTestNames name)=0
virtual void Autofix(TReportObjectList &tofix, map< string, size_t > &rep, const string &default_header=kEmptyStr)=0
virtual unsigned Summarize()=0
void * GetUserData() const
virtual void ParseStream(CObjectIStream &stream, const string &fname, bool skip, const string &default_header=kEmptyStr)=0
void SetLineage(const string &s)
void SetUserData(void *p)
virtual void AddTest(string_view name)=0
virtual void Push(const CSerialObject &root, const string &fname=kEmptyStr)=0
virtual map< string, size_t > Autofix()=0
static std::atomic< bool > m_Gui
virtual void SetSuspectRules(const string &name, bool read=true)=0
const string & GetLineage() const
static void SetGui(bool b)
virtual void ParseStrings(const string &fname)=0
virtual ~CDiscrepancySet()
virtual CRef< CDiscrepancyProduct > GetProduct()=0
virtual const CSerialObject * FindObject(CReportObj &obj, bool alt=false)=0
virtual TDiscrepancyCaseMap GetTests() const =0
virtual string_view GetTitle() const =0
virtual vector< CRef< CReportItem > > GetSubitems() const =0
virtual bool IsExtended() const =0
virtual bool IsSummary() const =0
virtual string GetStr() const =0
virtual string GetXml() const =0
virtual string GetUnit() const =0
virtual ESeverity GetSeverity() const =0
virtual TReportObjectList GetDetails() const =0
virtual bool CanAutofix() const =0
virtual string GetMsg() const =0
virtual bool IsInfo() const =0
virtual bool IsFatal() const =0
virtual bool IsReal() const =0
virtual size_t GetCount() const =0
virtual string GetFeatureType() const =0
virtual string GetBioseqLabel() const =0
virtual string GetLocation() const =0
virtual string GetPath() const =0
virtual string GetProductName() const =0
virtual bool IsFixed() const =0
virtual bool CanAutofix() const =0
virtual string GetLocusTag() const =0
virtual EType GetType() const =0
virtual void SetMoreInfo(CObject *data)=0
virtual string GetShort() const =0
virtual string GetText() const =0
namespace ncbi::objects::
Base class for all serializable objects.
Include a standard set of the NCBI C++ Toolkit most basic headers.
bool IsShortrRNA(const objects::CSeq_feat &f, objects::CScope *scope)
vector< CRef< CReportItem > > TReportItemList
vector< CRef< CReportObj > > TReportObjectList
TGroup GetDiscrepancyGroup(eTestNames name)
CConstRef< objects::CSuspect_rule_set > GetProductRules(const string &name="")
eTestNames GetDiscrepancyCaseName(string_view)
vector< string_view > GetDiscrepancyAliases(eTestNames name)
TTestNamesSet GetDiscrepancyTests(TGroup group)
CConstRef< objects::CSuspect_rule_set > GetOrganelleProductRules(const string &name="")
std::ostream & operator<<(std::ostream &str, NDiscrepancy::eTestNames name)
std::integral_constant< eTestTypes, _type > TTypeTag
NCBI_DISCREPANCY_EXPORT vector< string > GetDiscrepancyNames(TGroup group=EGroup::eAll)
string FixProductName(const objects::CSuspect_rule *rule, objects::CScope &scope, string &prot_name, GetFeatureFunc get_mrna, GetFeatureFunc get_cds)
map< eTestNames, CRef< CDiscrepancyCase > > TDiscrepancyCaseMap
string_view GetDiscrepancyDescr(eTestNames name)
std::function< CRef< objects::CSeq_feat >) > GetFeatureFunc
std::ofstream out("events_result.xml")
main entry point for tests
#define test(a, b, c, d, e)
static const char * str(char *buf, int n)
static DbTestEntry * tests
static char test_name[128]
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define BEGIN_SCOPE(ns)
Define a new scope.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
#define NCBI_DISCREPANCY_EXPORT
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)