Systems Biology (Methods in Molecular Biology)

(Tina Sui) #1
In the above R command, the "t" function returns the
transpose of its argument, and the "cmdscale" function returns
a list object whose "points" element contains the PCoA
coordinates.


  1. Merge the PCoA results with the sample metadata and visualize
    PCoA results as a scatter plot. Each of these steps can be
    performed in a single R command as shown below (with exam-
    ple output):


merged_pcoa_data <- data.frame(sample_data_merged, pcoa_results, )



head(merged_pcoa_data, n=15)



condition species X1 X2
TCC.1 cancer dog -5.20 -1.01
TCC.2 cancer dog -3.97 -1.38
TCC.3 cancer dog -2.31 5.53
TCC.4 cancer dog 3.65 3.43
TCC.5 cancer dog -2.70 2.01
TCC.6 cancer dog 0.27 4.89
TCC.7 cancer dog 3.66 1.68
normal.1 normal dog -1.11 -4.41
normal.2 normal dog 1.73 -5.33
normal.3 normal dog 3.94 -5.44
UCCB_1 cancer human 2.23 2.44
UCCB_2 cancer human -5.97 5.65
UCCB_3 cancer human -7.65 5.80
UCCB_4 cancer human -2.98 6.34
UCCB_5 cancer human -9.29 -5.45



dim(merged_pcoa_data)



[1] 443 4


library(ggplot2)


ggplot_res <- ggplot(data=merged_pcoa_data) +
geom_point(aes(x=X1, y=X2, colour=condition, shape=species, alpha=species), size=4) +
guides(alpha=FALSE, size=FALSE) + theme(text=element_text(size=30)) +
scale_alpha_manual(values = c(1.0, 0.3))



print(ggplot_res)



The PCoA co-visualization of the human and dog bladder
datasets is shown in Fig.2 (seeNote 3). In the above R
command, the function "ggplot" sets the data source for the
plot, the function "geom_point" creates a scatter plot; the
"theme" function is used to set the point size for the text labels
in the plot; and the function "scale_alpha_manual" defines the
two alpha transparency levels to be assigned to the two values
for the "species" column in the data frame.


  1. For each species, and for each gene that is expressed above
    background, compute an intraspecies log 2 expression ratio
    andp-value (for the test of equal means of the log 2 expression
    levels of the two sample groups) based on a negative binomial
    distribution-based count model:


Cross-Species RNA-Seq Analysis 301
Free download pdf