Closed mikejiang closed 4 years ago
Turned out the $P7N
does exist in the cytoframe
, bypassing R API keyword
, directly fetch data from c data structure
> cf_getKeyword(x@pointer, "$P7N")
[1] "dd"
It is keyword()
method for cytoframe
that calls flowCore::filter_keywords
that only returns $PnX
keywords that matches the existing parametes/channels.
For flowFrame
, this filtering was done at [
(subsetting) stage, which essentially deletes the PnX
keywords along with data columns (channels
).
But cytoframe
is simply a view in c++
, so we don't actually delete columns and keywords during subsetting. So we put this keyword filtering inline at keyword
getter API, which is creating incompatible behavior with flowFrame
.
We are yet to decide what should be the right way to go about this. Maybe deleting the keywords at [
operation and disable filtering in keyword()
is the easiest way to keep the current workflow of flowFrame
work for cytoframe
. However this will break assumption of CytoFrameView
, which is supposed to keep the original data and ready for be restored once index is reset (maybe this is not a concern? Given we haven't got any use case that needs to return to the original state of data after the view is created)
We've decided to change the [
behavior of flowFrame
to match cytoframe
, i.e. do not remove PnX
keyword during the cols subsetting. So that [
simply remove the data columns for both objects.
This will simplify the logic and avoid the unexpected tampering the original cytoframe
object, which is a reference that shares the same data with subsetted cytoframe.
PnX
keywords are typically not relevant to any type of data analysis until it is written to FCS
files. So we will have dedicate logic to take care of it in write.FCS
function.
remove 7th channel by subsetting
try to set
P7N
keyword,but it does nothingsetting/adding other keyword seems to be fine
Not sure if this behavior is appopriate, but it is causing the current
write.FCS
to fail since it needs to reset keywords before writing the subset to FCS