Skip to content

Commit

Permalink
revisions
Browse files Browse the repository at this point in the history
working directory set automatically
  • Loading branch information
LliliansCalvo committed Jan 18, 2021
1 parent 463bc44 commit 0c1806c
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 25 deletions.
Binary file modified .DS_Store
Binary file not shown.
10 changes: 4 additions & 6 deletions Heatmaps_embryo_code/Make_embryo_heatmap_even-skipped.R
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@ library(scales)
# Code to generate whole embryo heatmap variability
# Only eve is used for this example but the code will be the same for all the other genes

# First you need to make sure your working directory is the same as where the raw data is.
# For that you will go to the the folder where your computer downloaded the git and
# Use the comand bellow to establish that folder as your working directory in R

setwd("~/Downloads/smiFISH_Arthropods-main/Neighbours_finding/Raw_data") #Example of where the folder was downloaded in a mac
# Use the comand bellow to establish the main folder of neighbour finding as your working directory
setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) #Automatically set working directory
setwd('..') # Automatically go one level up current working directory
print(getwd())

# Load the variability data for even-skipped
eve <- read.csv("Figure5_Variability_Calculations_eve.csv")
eve <- read.csv("./Neighbours_finding/Raw_data/Figure5_Variability_Calculations_eve.csv")

x = eve[,2]
y = eve[,3]
Expand Down
Binary file modified Neighbours_finding/.DS_Store
Binary file not shown.
10 changes: 5 additions & 5 deletions Neighbours_finding/Neigbour_finding_eucledian_distance.R
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ library(tidyr)
library(data.table)


# First you need to make sure your working directory is the same as where the raw data is.
# For that you will go to the the folder where your computer downloaded the git and
# Use the comand bellow to establish that folder as your working directory in R
# Use the comand bellow to establish the main folder of neighbour finding as your working directory

setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) # Automatically set working directory

setwd("~/Downloads/smiFISH_Arthropods-main/Neighbours_finding/Raw_data") #Example of where the folder was downloaded in a mac
print(getwd())


# Using spectrin cells were segmented in Imaris and each cell is given
# a position in X,Y,Z that is their center point
# Import the cell middle position onto R

df <- read.csv("Figure5_Cells_XYZ_Positions.csv")
df <- read.csv("./Raw_data/Figure5_Cells_XYZ_Positions.csv")
rownames(df) <- df[,1]
df=df[,-1]

Expand Down
13 changes: 6 additions & 7 deletions Neighbours_finding/Neigbour_finding_polygons.R
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,20 @@ library(data.table)
library(sf)


# Use the comand bellow to establish the main folder of neighbour finding as your working directory

# First you need to make sure your working directory is the same as where the raw data is.
# For that you will go to the the folder where your computer downloaded the git and
# Use the comand bellow to establish that folder as your working directory in R
setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) #Automatically set working directory

setwd("~/Downloads/smiFISH_Arthropods-main/Neighbours_finding/Raw_data") #Example of where the folder was downloaded in a mac
print(getwd())

# this will print your working directory, the output should look like this:
# "~/SOMEWHERE_IN_YOUR_COMPUTER/smiFISH_Arthropods-main/Supplemental_files"
# "~/SOMEWHERE_IN_YOUR_COMPUTER/smiFISH_Arthropods-main/Neighbours_finding"


# Import measurements from Imaris onto R.
# Import measurements from Imaris onto R, located in Raw_data
# The starting data frame of (x,y,z) positions of Spectrin spots was obtained from Imaris
# by segmenting Spectrin antibody staining. Each cell is composed of several spots of spectrin signal around the membrane
df_80k <- read.csv('Figure4_80K_Spectrin_Spots_XYZ_Positions.csv')
df_80k <- read.csv('./Raw_data/Figure4_80K_Spectrin_Spots_XYZ_Positions.csv')

#Change column names
colnames(df_80k) <- c("Cell_ID", "Spot_ID", "X", "Y", "Z")
Expand Down Expand Up @@ -78,6 +76,7 @@ results_80k_0.6 = a2_80k_0.6%>%
mutate(rn = rowid(Cell_ID)) %>%
pivot_wider(names_from = rn, values_from = Cell_ID.1)

head(results_80k_0.6)

#Save results as a table that you could use in excel and visualize outside R
write.csv(results_80k_0.6, "2020.11.16_results_polygons_80k_exp_0.6.csv", na="", row.names=FALSE)
11 changes: 4 additions & 7 deletions Neighbours_finding/Process_neighbours_finding.R
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Once neighbours have been identified by following any of the previously used tutorial
# (neighbours finding polygons or neighbours finding eucledian distance)
# this tutorial could be followed to replace the neighbours' cells
# this tutorial could be followed to replace the neighbours cells
# by their mRNA content for statistic purpose.


Expand All @@ -10,12 +10,9 @@ library(dplyr)
library(tidyr)
library(data.table)

# Use the comand bellow to establish the main folder of neighbour finding as your working directory
setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) #Automatically set working directory

# First you need to make sure your working directory is the same as where the raw data is.
# For that you will go to the the folder where your computer downloaded the git and
# Use the comand bellow to establish that folder as your working directory in R

setwd("~/Downloads/smiFISH_Arthropods-main/Neighbours_finding/Raw_data") #Example of where the folder was downloaded in a mac
print(getwd())

#Load the results table on R and change the values of the neighbours
Expand All @@ -29,7 +26,7 @@ print(getwd())

#Load both datasets
df <- read.csv("2020.11.16_results_polygons_80k_exp_0.6.csv")
gt <- read.csv("Figure4_gt_Spots.csv")
gt <- read.csv("./Raw_data/Figure4_gt_Spots.csv")

# Get first few lines of each dataframe
head(df)
Expand Down

0 comments on commit 0c1806c

Please sign in to comment.