In this video, we go over how to use ruRead() to take our multiple gene CSVs output from FijiFISH and amalgamate them into a single data frame.
See the code below to follow along with the analyses.
Reading files with ruRead()
We will use ruRead() to read all of the gene expression FIJI Quantification files into a single data frame.
The primary argument is the path to the folder holding all of the gene CSVs from FijiFISH. You must also fill out at least three metadata variables for image identification during plotting and analysis down the line.
####### STEP 1a: READING FILES FROM FIJI QUANTIFICATION ##########here we are using an example dataset from our 2021 eLife paper - https://elifesciences.org/articles/68967#the data is deposited both within this repository as well as on FigShare, but it is preferable to use your own files generated from FijiFISH!mydata <-ruRead("data", region ="cla", anum ="123456", section ="1")
[1] "The following files will be quantified:"
[1] "R1_488_Nnat.tif_registered.tif_NL.tif_quantification.csv"
[2] "R1_550_Synpr.tif_registered.tif_NL.tif_quantification.csv"
[3] "R1_647_Pcp4.tif_registered.tif_NL.tif_quantification.csv"
[4] "R1_750_Slc17a7.tif_registered.tif_NL.tif_quantification.csv"
[5] "R2_488_Cdh9.tif_registered.tif_NL.tif_quantification.csv"
[6] "R2_550_Ctgf.tif_registered.tif_NL.tif_quantification.csv"
[7] "R2_647_Slc17a6.tif_registered.tif_NL.tif_quantification.csv"
[8] "R2_750_Lxn.tif_registered.tif_NL.tif_quantification.csv"
[9] "R3_488_Slc30a3.tif_registered.tif_NL.tif_quantification.csv"
[10] "R3_550_Gfra1.tif_registered.tif_NL.tif_quantification.csv"
[11] "R3_647_Spon1.tif_registered.tif_NL.tif_quantification.csv"
[12] "R3_750_Gnb4.tif_registered.tif_NL.tif_quantification.csv"
[13] "R4_488_RSC.tif_registered.tif_NL.tif_quantification.csv"
[14] "R4_545_LEC.tif_registered.tif_NL.tif_quantification.csv"
#make sure all your genes are names correctly before continuing#you should have columns named X,Y,id,region,section,anum and all of your geneshead(mydata)
#feel free to add extra metadata for your section at this point with dplyr::mutate()
In the plausible case where we have multiple images that we want to analyze together, we will use ruCombine() to concatenate multiple data frames from separate experiments.
Ensure that the analyzed tables from each experiment are in their own separate folders. Then generate a data frame for each using ruRead(). Finally, concatenate them together using ruCombine().
IMPORTANT: Ensure you have unique section ids for each image in the metadata so you can properly separate each image from another in the downstream analysis
####### STEP 1b: COMBINING MULTIPLE SECTIONS ########if you have multiple sections you can save multiple experiments as a data.frame using ruRead()#to combine them use: combo <-ruCombine(c(data1, data2, data3))