83 size_t blank1 = line.find(
' '),
84 blank2 = line.rfind(
' ');
85 size_t dots1 = line.find(
".."),
86 dots2 = line.rfind(
"..");
89 line.substr(blank1+1, dots1-blank1-1))-1);
91 line.substr(dots1+2, blank2-dots1-2)));
93 line.substr(blank2+1, dots2-blank2-1))-1);
110 arg_desc->AddKey(
"expected-results",
"ResultsFile",
111 "File containing FindCompartments() results",
113 arg_desc->AddKey(
"input-dir",
"InputDirectory",
114 "Directory containint input alignment sets",
122 CNcbiIstream& istr = args[
"expected-results"].AsInputFile();
125 string input_name, intersections;
128 if (intersections ==
"none") {
130 }
else if (intersections ==
"either") {
132 }
else if (intersections ==
"both") {
134 }
else if (intersections ==
"query") {
136 }
else if (intersections ==
"subject") {
140 "Intersection option not recognized: " +
145 cerr <<
"input=" << input_name
146 <<
" intersections=" << intersections
151 expected_compartments.
insert(line);
153 list< CRef<CSeq_align> > alignments;
156 input_name,
"asn").c_str());
161 alignments.push_back(alignment);
168 list< CRef<CSeq_align_set> > comparts;
172 actual_compartments.
insert(**it);
179 BOOST_CHECK_EQUAL(expected_compartments.
size(),
180 actual_compartments.
size());
182 expected_compartments.
begin(),
183 actual_it = actual_compartments.
begin();
184 expected_it != expected_compartments.
end();
185 ++expected_it, ++actual_it)
187 BOOST_CHECK_EQUAL(*expected_it, *actual_it);
static CNcbiApplication * Instance(void)
Singleton method.
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...
iterator_bool insert(const value_type &val)
const_iterator begin() const
const_iterator end() const
parent_type::const_iterator const_iterator
void FindCompartments(const list< CRef< CSeq_align > > &aligns, list< CRef< CSeq_align_set > > &align_sets, TCompartOptions options=fCompart_Defaults, float diff_len_filter=3.0f)
@ fCompart_AllowIntersectionsSubject
@ fCompart_AllowIntersectionsBoth
@ fCompart_AllowIntersections
@ fCompart_AllowIntersectionsQuery
@ fCompart_AllowInconsistentIntersection
CNcbiOstream & operator<<(CNcbiOstream &ostr, const SCompartmentData &d)
NCBITEST_INIT_CMDLINE(arg_desc)
BOOST_AUTO_TEST_CASE(Test_Align_Filter)
virtual const CArgs & GetArgs(void) const
Get parsed command line arguments.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
@ eInputFile
Name of file (must exist and be readable)
@ eString
An arbitrary string.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
static string MakePath(const string &dir=kEmptyStr, const string &base=kEmptyStr, const string &ext=kEmptyStr)
Assemble a path from basic components.
#define MSerial_AsnText
I/O stream manipulators –.
TThisType & SetToOpen(position_type toOpen)
CNcbiIstream & NcbiGetlineEOL(CNcbiIstream &is, string &str, string::size_type *count=NULL)
Read from "is" to "str" the next line (taking into account platform specifics of End-of-Line)
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
static bool SplitInTwo(const CTempString str, const CTempString delim, string &str1, string &str2, TSplitFlags flags=0)
Split a string into two pieces using the specified delimiters.
static unsigned int StringToUInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to unsigned int.
void SetFrom(TFrom value)
Assign a value to From data member.
TTo GetTo(void) const
Get the To member data.
TFrom GetFrom(void) const
Get the From member data.
void SetSegs(TSegs &value)
Assign a value to Segs data member.
const TYPE & Get(const CNamedParameterList *param)
const struct ncbi::grid::netcache::search::fields::SIZE size
Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...
bool operator<(const SCompartmentData &o) const
SCompartmentData(const CSeq_align_set &compartment)
bool operator==(const SCompartmentData &o) const
Utility stuff for more convenient using of Boost.Test library.