In R, one can write a bioconductor ExpressionSet
into a csv file using csv.write
. For example, using the standard bladderbatch data available as a bioconductor package the following code writes a csv file to the current working drectory:
library("bladderbatch")
data("bladderdata")
write.csv(bladderEset, "bladderEset.csv")
Is there a tool which can read the produced csv file back into R as an ExpressionSet
?
If not, is there an ExpressionSet ↔ csv
serialiser/deserialiser, which can both output ExpressionSets as csv files and read csv files as ExpressionSets?
The reason I'm asking is because I need to interact with ExpressionsSets with python and java code, and I can easily work with "csv" files, but not with ".rda", ".CEL" or other binary files.
If you just wanted to interact with the data using R and python, consider saving the ExpressionSet as a feather object.
https://github.com/wesm/feather
The comment from @Nathan Werth is what I think you are looking for. By calling readExpressionSet
you can easily read in a CSV file as an ExpressionSet
.
First, write out the CSV file as your initial code:
library("bladderbatch")
data("bladderdata")
write.csv(bladderEset, "bladderEset.csv")
Then read it back in:
temp <- Biobase::readExpressionSet("bladderEset.csv")
> class(temp)
[1] "ExpressionSet"
attr(,"package")
[1] "Biobase"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With