-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Hi, thank you for the amazing package!
I encountered some behaviour in getOscillationDrews() that may not be intended.
This is related to the loop in lines 25-33:
for(j in 3:length(currseg)) {
if(currseg[j] == prevval & currseg[j] != currseg[j-1]) {
count = count+1
} else {
oscCounts = c(oscCounts,count)
count = 0
}
prevval = currseg[j-1]
}
As it is at the moment, if the last segment of a chromosome is part of an oscillation, then count gets updated but oscCounts does not, leading to this oscillation not being counted in the final output. Is this behaviour intended?
Otherwise, I would suggest updating this part of the code:
for(j in 3:length(currseg)) {
if(currseg[j] == prevval & currseg[j] != currseg[j-1]) {
count = count+1
if (j == length(currseg)) {
oscCounts = c(oscCounts, count)
count = 0
}
} else {
oscCounts = c(oscCounts,count)
count = 0
}
prevval = currseg[j-1]
}
Metadata
Metadata
Assignees
Labels
No labels