changeset 23:0fa1b346ab52 draft

Uploaded
author davidvanzessen
date Wed, 11 Nov 2015 08:36:42 -0500
parents 04d8e7add1ba
children 14afe3c8a3d5
files phenotype_gene_relations_plot.r phenotype_gene_relations_plot.sh
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/phenotype_gene_relations_plot.r	Tue Nov 10 10:04:46 2015 -0500
+++ b/phenotype_gene_relations_plot.r	Wed Nov 11 08:36:42 2015 -0500
@@ -85,6 +85,7 @@
 png("plot1.png", width=length(unique(dat.sub2$disease.gene)) * 30 + 300)
 print(p)
 dev.off()
+write.table(dat.sub2, "plot1.txt", quote=F, sep="\t", row.names=F, col.names=T)
 
 dat.sub3 = dat[OMTs & disease.in.omt & inheritance.filter, c("diseaseId", "HPO.term.name")]
 dat.sub3$value = 1
@@ -95,6 +96,7 @@
 png("plot2.png", width=length(unique(dat.sub3$diseaseId)) * 20 + 300)
 print(p)
 dev.off()
+write.table(dat.sub3, "plot2.txt", quote=F, sep="\t", row.names=F, col.names=T)
 
 dat.sub4 = dat[disease.in.omt & dat$diseaseId %in% dat.sub3$diseaseId, c("diseaseId", "OMT.5.name")]
 dat.sub4 = dat.sub4[!duplicated(dat.sub4),]
@@ -109,11 +111,12 @@
 png("plot3.png", width=length(unique(dat.sub3$diseaseId)) * 20 + 300)
 print(p)
 dev.off()
+write.table(dat.sub4, "plot3.txt", quote=F, sep="\t", row.names=F, col.names=T)
 
 #order the table the same as the first plot x axis
 disease.gene.url = dat[OMTs & disease.in.omt & inheritance.filter ,c("disease.gene", "diseaseId", "gene.symbol", "url")]
 disease.gene.url = disease.gene.url[!duplicated(disease.gene.url),]
-disease.gene.url = merge(disease.gene.url, dat.sub2[,c("disease.gene", "disease.gene.order")], by="disease.gene")
+disease.gene.url = merge(disease.gene.url, dat.sub2[!duplicated(dat.sub2$disease.gene),c("disease.gene", "disease.gene.order")], by="disease.gene", all.x=T)
 disease.gene.url = disease.gene.url[order(-disease.gene.url$disease.gene.order),]
 disease.gene.url = disease.gene.url[,c("diseaseId", "gene.symbol", "url")]
 
--- a/phenotype_gene_relations_plot.sh	Tue Nov 10 10:04:46 2015 -0500
+++ b/phenotype_gene_relations_plot.sh	Wed Nov 11 08:36:42 2015 -0500
@@ -35,9 +35,12 @@
 echo "<div style='width: 10000px;'>" >> "$html"
 echo "<img src='plot1_avg.png' /><br />" >> "$html"
 echo "<img src='plot1.png' /><br />" >> "$html"
+echo "<a href='plot1.txt'>Download</a><br />" >> "$html"
 echo "</div>" >> "$html"
 echo "<img src='plot2.png' /><br />" >> "$html"
+echo "<a href='plot2.txt'>Download</a><br />" >> "$html"
 echo "<img src='plot3.png' /><br />" >> "$html"
+echo "<a href='plot3.txt'>Download</a><br />" >> "$html"
 
 echo "<table border='1'>" >> $html
 first="true"