Closed PedroMilanezAlmeida closed 4 years ago
I may have found a way by first parsing the the wsp file using XML::xmlParse(wspName)
instead of applying xpathApply
directly on the ws@doc
:
sampleFCS_paths <- XML::xmlParse(wspName) %>%
XML::xpathApply(.,
file.path("/Workspace/SampleList/Sample","DataSet"),
function(x)
XML::xmlGetAttr(x,"uri") %>%
gsub(pattern = "%20", replacement = " ", x = .) %>%
gsub(pattern = "file:", replacement = "", x = .)) %>%
unlist
Did you solve your problem? CytoMl and flowWorkspace will search for FCS files automatically in the provided directory. Is there a reason you need to get the path from the XML? I'm asking because it's not directly supported by the API but we could add support if there's a use case.
Hey Greg, thanks for your quick reply!
I think my issue is solved by the code I posted (re-parsing the wsp/xml file).
In terms of the need for sample paths, I am building a FlowJo plugin which needs the path to the fcs file on which the plugin was called within FlowJo. It would be great if the API would natively support that, but I already have a code for this, which of course I could share if needed.
Just as heads up, later today I will post another issue with the new version not being able to apply the gates when transform = FALSE
in open_flowjo_xml
. I also need this functionality for the plugin, in particular for cases when the data has been transformed outside FlowJo and imported into FJ via a csv file, for example. For us, this is particularly important for CITEseq data.
EDIT: I meant flowjo_to_gatingset
not open_flowjo_xml
above.
Today I updated my R and Bioc installations from 3.6.2 and 3.10 and started getting the following error:
Apparently
ws@doc
is now an an object of class "externalptr" (a pointer), on whichxpathApply
does not work anymore.Did the last update change the class of
ws@doc
?In case, I would really appreciate if someone could point out a work around for me to find the paths to the .fcs files.