Hello,
I used ardea to generate a table using the following :
Barcode Row Col Cycle Sample
100220 1 1 30 sample1
100220 1 1 36 sample1
100220 1 2 30 sample1
100220 1 2 36 sample1
100220 2 1 30 sample1
100220 2 1 36 sample1
100220 2 2 30 sample1
100220 2 2 36 sample1
100220 3 3 38 sample2
100220 4 4 38 sample2
ardea -d tmp -m
"Barcode:float,Row:float,Col:float,Cycle:float,Sample:category" -t Array.txt
then using ibis,
ibis -d tmp -q "select Barcode,Row,Col,Cycle,Sample where Row > 0"
result gives ....
Barcode, Row, Col, Cycle, Sample (with counts)
100220, 1, 1, 30, sample1, 1
100220, 1, 1, 36, sample1, 1
100220, 1, 2, 30, sample1, 1
100220, 1, 2, 36, sample1, 1
100220, 2, 1, 30, sample1, 1
100220, 2, 1, 36, sample1, 1
100220, 2, 2, 30, sample1, 1
100220, 2, 2, 36, sample1, 1
100220, 3, 3, 38, sample2, 2
which is wrong the last row is missing ....
Here how I solved this bug
array_t<uint32_t>*
ibis::colFloats::segment(const array_t<uint32_t>* old) const {
array_t<uint32_t>* res = new array_t<uint32_t>;
// res->push_back(0); // the first number is always 0
uint32_t j = 0;
float target = *(array->begin());
const uint32_t nelm = array->size();
if (old != 0 && old->size()>2) {
// find segments with in the previously defined segments
for (uint32_t i=0; i<old->size()-1; ++i) {
if (j < nelm) {
res->push_back(j);
target = (*array)[j];
++ j;
if (j < nelm) {
do {
while (j < (*old)[i+1] && (*array)[j] == target) ++
j;
if (j < (*old)[i+1]) {
res->push_back(j);
if (j < nelm) {
target = (*array)[j];
++ j;
}
}
} while (j < (*old)[i+1]);
}
};
}
}
else { // start with all elements in one segment
res->push_back(0); // the first number is always 0
uint32_t j = 1;
while (j < nelm) {
while (j < nelm && (*array)[j] == target)
++ j;
res->push_back(j);
if (j < nelm) {
target = (*array)[j];
++ j;
}
}
}
if (res->back() < nelm)
res->push_back(nelm);
return res;
} // ibis::colFloats::segment
Hope this help.
Alexandre Maurel
_______________________________________________
FastBit-users mailing list
[email protected]
https://hpcrdm.lbl.gov/cgi-bin/mailman/listinfo/fastbit-users