Last active
July 30, 2024 22:36
-
-
Save yannabraham/c1f9de9b23fb94105ca5 to your computer and use it in GitHub Desktop.
Revisions
-
yannabraham revised this gist
Sep 23, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ head(dta) # you need to prepare some metadata meta <- data.frame(name=dimnames(dta)[[2]], desc=paste('this is column',dimnames(dta)[[2]],'from your CSV') ) meta$range <- apply(apply(dta,2,range),2,diff) meta$minRange <- apply(dta,2,min) -
yannabraham created this gist
Sep 23, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ library(Biobase) library(flowCore) library(flowViz) # simply replace the dummy dta below with your CSV data dta <- matrix(rnorm(10000),ncol=10) dimnames(dta)[[2]] <- LETTERS[1:10] head(dta) # you need to prepare some metadata meta <- data.frame(name=dimnames(dta)[[2]], desc=paste('this is column',dimnames(dta)[[2]],'from your CSV') ) meta$range <- apply(apply(dta,2,range),2,diff) meta$minRange <- apply(dta,2,min) meta$maxRange <- apply(dta,2,max) head(meta) # all these are required for the following steps to work # a flowFrame is the internal representation of a FCS file ff <- new("flowFrame", exprs=dta, parameters=AnnotatedDataFrame(meta) ) # a simple plot to check that it worked xyplot(A~B,ff) # now you can save it back to the filesystem write.FCS(ff,paste(tempfile(),'FCS',sep='.'))