10 #ifndef PS_FILEBUFFER_HXX
29 printf(
"%+i_%u_%u", p->quality, p->length, p->GC_content);
34 if (
abs(p1->quality) ==
abs(p2->quality)) {
35 if (p1->length == p2->length) {
36 return p1->GC_content < p2->GC_content;
39 return p1->length < p2->length;
43 return p1->quality < p2->quality;
79 if (it == children.end()) {
80 children[_child->
getNum()] = _child;
84 printf(
"child[#%u] already exists\n", _child->
getNum());
91 if (it == children.end()) {
93 children[_id] = new_child;
103 return pair<bool, PS_NodePtr>(it!=children.end(), it->second);
108 return pair<bool, const PS_NodePtr>(it!=children.end(), it->second);
129 probes->insert(probe);
133 pair<PS_ProbeSetCIter, bool> p = probes->insert(probe);
139 if (_begin == _end)
return;
142 probes->insert(*
probe);
147 if (_begin == _end)
return;
151 new_probe->length = (*probe)->length;
152 new_probe->quality = -((*probe)->quality);
153 new_probe->GC_content = (*probe)->GC_content;
154 probes->insert(new_probe);
158 size_t countProbes()
const {
return probes ? probes->size() : 0; }
161 if (!probes)
return false;
163 if ((*i)->quality >= 0)
return true;
169 if (!probes)
return false;
171 if ((*i)->quality < 0)
return true;
178 return probes->begin();
182 return probes->end();
200 printf(
"\nN[%d] P[ ", num);
215 printf(
"N[%d] P[ ", num);
222 printf(
"] C[ %zu ]", children.size());
243 if (probes)
delete probes;
249 #error ps_node.hxx included twice
PS_NodeMapIterator getChildrenBegin()
PS_NodeMapConstIterator getChildrenEnd() const
void setNum(SpeciesID id)
SmartPtr< PS_Node > PS_NodePtr
void removeProbe(PS_ProbeSetCIter it)
PS_NodePtr assertChild(SpeciesID _id)
size_t countChildren() const
void addProbes(PS_ProbeSetCIter _begin, PS_ProbeSetCIter _end)
PS_ProbeSet::const_iterator PS_ProbeSetCIter
size_t countProbes() const
PS_ProbeSetCIter getProbesBegin() const
PS_NodeMap::const_iterator PS_NodeMapConstIterator
char buffer[MESSAGE_BUFFERSIZE]
void addProbesInverted(PS_ProbeSetCIter _begin, PS_ProbeSetCIter _end)
PS_ProbeSetCIter getProbesEnd() const
PS_NodeMap::reverse_iterator PS_NodeMapRIterator
PS_NodeMapIterator getChildrenEnd()
PS_ProbeSet * PS_ProbeSetPtr
PS_NodeMapConstRIterator getChildrenREnd() const
map< SpeciesID, PS_NodePtr > PS_NodeMap
bool hasInverseProbes() const
unsigned short int GC_content
SmartPtr< PS_Probe > PS_ProbePtr
PS_NodeMapConstRIterator getChildrenRBegin() const
bool addProbe(const PS_ProbePtr &probe)
PS_NodeMap::const_reverse_iterator PS_NodeMapConstRIterator
pair< bool, const PS_NodePtr > getChild(SpeciesID id) const
bool addChild(PS_NodePtr &_child)
PS_ProbeSet::iterator PS_ProbeSetIter
bool operator()(const PS_ProbePtr &p1, const PS_ProbePtr &p2) const
void PS_printProbe(const PS_Probe *p)
PS_NodeMapRIterator getChildrenREnd()
unsigned short int length
pair< bool, PS_NodePtr > getChild(SpeciesID id)
PS_NodeMapConstIterator getChildrenBegin() const
bool hasPositiveProbes() const
set< PS_ProbePtr, lt_probe > PS_ProbeSet
PS_NodeMap::iterator PS_NodeMapIterator
PS_NodeMapRIterator getChildrenRBegin()