Entering edit mode
Yvan
▴
60
@yvan-4034
Last seen 10.2 years ago
Hello List,
I am confused about how to loop over a rangedData object.
I have this rangedData
RangedData with 61 rows and 1 value column across 3 spaces
space ranges | score
<character> <iranges> | <numeric>
1 SCAFFOLD_1 [ 8, 8] | -0.09405
and the spaces are
"SCAFFOLD_1" "SCAFFOLD_10" "SCAFFOLD_100"
using aggregate it is possible to apply a function to one of the space
aggregate(rd["SCAFFOLD_1"]$score, start =
1:(length(rd["SCAFFOLD_1"]$score)-w+1), width = w, FUN = sum)
but how can I apply the aggregate to all space without a for loop ?
And it is possible to add a column sum "on the fly" or should I create
a
vector "sum" containing values for all spaces and the recreate a
rangedData object with this extra column?
Thanks for your help and patience
yvan