27 #include <boost/assign.hpp> 35 using boost::logic::tribool;
43 os <<
"size: " << pl.
size() << endl;
45 for (
size_t i=0, end=pl.
size(); i<end; i++)
48 os << protein->index <<
" " 59 for (
size_t i=0; i<10; ++i)
61 ProteinPtr protein(
new Protein(
"Pro" + lexical_cast<string>(i+1), i,
"",
string(16,
'A'+i)));
62 pl->proteins.push_back(protein);
67 *
os_ <<
"original protein list:\n";
84 if (protein.
index>5) pastMaxIndex =
true;
86 return (protein.
index==1 ||
100 if (
os_) *
os_ <<
"testSelectedIndices:\n";
119 if (
os_) *
os_ <<
"testIndexSet:\n";
145 if (
os_) *
os_ <<
"testIdSet:\n";
148 idSet +=
"Pro2",
"Pro3",
"Pro4",
"Pro7";
175 int main(
int argc,
char* argv[])
181 if (argc>1 && !strcmp(argv[1],
"-v"))
os_ = &cout;
ProteinListPtr createProteinList()
void testIdSet(ProteinListPtr pl)
int main(int argc, char *argv[])
a virtual container of integers, accessible via an iterator interface, stored as union of intervals ...
client-implemented filter predicate – called during construction of ProteinList_Filter to create th...
ProteinList filter, for creating Protein sub-lists.
void testSelectedIndices(ProteinListPtr pl)
virtual proteome::ProteinPtr protein(size_t index, bool getSequence=true) const
#define unit_assert_operator_equal(expected, actual)
virtual size_t size() const =0
virtual tribool accept(const Protein &protein) const
return true iff Protein is accepted
virtual bool done() const
return true iff done accepting proteins; this allows early termination of the iteration through the o...
virtual size_t size() const
#define TEST_PROLOG(argc, argv)
boost::shared_ptr< ProteinList > ProteinListPtr
boost::shared_ptr< Protein > ProteinPtr
void printProteinList(const ProteinList &pl, ostream &os)
void insert(Interval interval)
insert an interval of integers into the virtual container
virtual ProteinPtr protein(size_t index, bool getSequence=true) const =0
void testIndexSet(ProteinListPtr pl)
void filter(const TContainer &data, const TContainer &filter, TContainer &result, bool circular=false, uint32_t sides=2)
Applies linear convolution (filtering) to a univariate time series.