Comparaison des versions

Légende

  • Ces lignes ont été ajoutées. Ce mot a été ajouté.
  • Ces lignes ont été supprimées. Ce mot a été supprimé.
  • La mise en forme a été modifiée.

...

Bloc de code
languageruby
titleR Plot ImageJ Global Measurements
collapsetrue
# Prompt for the input CSV file from ImageJ measurements
Input<-file.choose()

# You must cange this path to match your computer
Output<-"/Users/nicolas/Desktop/Output/"
#Output <- "C:\\Users\\stifanin\\OneDrive - Universite de Montreal\\Bureau\\Output\\"


data<-read.csv(Input)

require("ggpubr")

List<-strsplit(as.character(data$Label), ':')

#Add Filename and Group to the data
data$Filename<-as.factor(sapply(List, "[[", 1))
Group<-strsplit(as.character(data$Filename), '_')
data$Group<-as.factor(sapply(Group, "[[", 1))
# MAke Ch as a factor
data$Ch<-as.factor(data$Ch)

#Create a list of plots
ListofPlots<-list()
i=1;

for(ColI in 3:(ncol(data)-2)){
  if(!is.factor(data[[ColI]])){
    for (ChI in 1:nlevels(data$Ch)){
   Graph<-   ggboxplot(
        data[data$Ch==ChI,], x = "Group", y = colnames(data[ColI]),
        color = "Group", palette = c("#4194fa", "#db51d4"),
        add = "jitter", title=paste0(colnames(data[ColI])," of Channel ", ChI)
      )+stat_compare_means(method = "t.test")
   ListofPlots[[i]]<-Graph
i=i+1
  }
  }
}

#Export the graphs
ggexport(
  plotlist = ListofPlots, filename = paste0(Output,"Graphs.pdf"), 
  ncol = 2, nrow = 2, verbose=TRUE, res=600
)

)

This should give you a pdf file with one plot per page. You can scroll it and look at the data. p-values from t-test are indicated on the graphs. As you can see below the mean intensity in both Ch1 and Ch2 are higher in the test than the control. What does it mean?


View file
nameMeanCh1.pdf
height250
View file
nameMean Ch2.pdf
height250


It means than the average pixel intensity is higher in the test conditions than the control condition.

Other values that are significantly different:

  • Mean Intensity Ch1 and Ch2 (Control<Test)
  • Maximum Intensity of Ch1 (Control>Test) Brightest value in the image
  • Integrated Intensity of Ch1 and Ch2(Control<Test) It is equal to the Mean x Area
  • Median Ch1 and Ch2 (Control<Test)
  • Skew of Ch1 (Control>Test): The third order moment about the mean. Relate to the distribution of intensities. If=0 then intensities are symmetrically distributed around the mean. if<0 then distribution is asymmetric to the Left of the mean (lower intensities), if>0 then it is to the right (higher intensities).
  • Raw Integrated Intensities of Ch1 and Ch2 (Control<Test) Sum of all pixel intensities


Now we start to have some results and statistically relevant information about the data. The test condition have a higher mean intensity (integrated intensity, median and raw integrated intensities are all showing the same result) for both Ch1 and Ch2. This is surprising because I had the opposite impression while looking at the image with normalized intensities and LUT fire applied (see above). Another surprising result is the fact that Control images have a higher maximum intensity than Test images but only for Ch1. This is clearly seen in the picture above.

One thing that can explain these results is that the number of cells can be different in the control vs the test images. If there are more cells in one condition then there are more pixels stained (and less background) and the mean intensity would be higher not because the signal itself is higher in each cell but because there are more cell...

To solve this we need to count the number of cells per image. This can be done manually or using segmentation based of intensity.

Looking at the image it seems that Ch1 is a good candidate to segment each cell.