# \dontshow{
data(thaliana)
D <- thaliana[1:5, 1:10]
res <- netphenogeno(data= D, n.rho=2, em.iter = 1, ncores=1)
# }
# \donttest{
data(thaliana)
head(thaliana, n=3)
#Construct a path for genotype-phenotype interactions network in thaliana data
res <- netphenogeno(data = thaliana); res
plot(res)
#Select an optimal network
sel <- selectnet(res)
#Plot selected network and the conditional correlation (CI) relationships
plot(sel, vis="CI")
plot(sel, vis="CI", n.mem = c(8, 56, 31, 33, 31, 30), w.btw =50, w.within= 1)
#Visualize interactive plot for the selected network
#Color "red" for 8 phenotypes, and different colors for each chromosome.
cl <- c(rep("red", 8), rep("white",56), rep("tan1",31),
rep("gray",33), rep("lightblue2",31), rep("salmon2",30))
#The IDs of phenotypes and SNPs to be shown in the network
id <- c("DTF_LD","CLN_LD","RLN_LD","TLN_LD","DTF_SD","CLN_SD","RLN_SD",
"TLN_SD","snp15","snp16","snp17","snp49","snp50","snp60","snp75",
"snp76","snp81","snp83","snp84","snp86","snp82", "snp113","snp150",
"snp155","snp159","snp156","snp161","snp158","snp160","snp162","snp181")
plot(sel, vis="interactive", n.mem = c(8, 56, 31, 33, 31, 30), vertex.color= cl,
label.vertex= "some", sel.nod.label= id, edge.color= "gray", w.btw= 50,
w.within= 1)
#Partial correlations between genotypes and phenotypes in the thaliana dataset.
library(Matrix)
image(sel$par.cor, xlab="geno-pheno", ylab="geno-pheno", sub="")
# }
Run the code above in your browser using DataLab