Mercurial > repos > davidvanzessen > argalaxy_tools
changeset 32:7c33029fd63d draft
Uploaded
author | davidvanzessen |
---|---|
date | Tue, 28 Mar 2017 05:40:04 -0400 |
parents | 3a76faa53c59 |
children | 6603110e5be3 |
files | report_clonality/RScript.r report_clonality/circos/fonts.conf~ report_clonality/circos/housekeeping.conf~ report_clonality/r_wrapper.sh |
diffstat | 3 files changed, 54 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/report_clonality/RScript.r Tue Mar 14 06:51:38 2017 -0400 +++ b/report_clonality/RScript.r Tue Mar 28 05:40:04 2017 -0400 @@ -302,7 +302,9 @@ png("VPlot.png",width = 1280, height = 720) pV -dev.off(); +dev.off() + +ggsave("VPlot.pdf", pV, width=13, height=7) if(useD){ pD = ggplot(PRODFD) @@ -313,7 +315,9 @@ png("DPlot.png",width = 800, height = 600) print(pD) - dev.off(); + dev.off() + + ggsave("DPlot.pdf", pD, width=10, height=7) } pJ = ggplot(PRODFJ) @@ -324,7 +328,9 @@ png("JPlot.png",width = 800, height = 600) pJ -dev.off(); +dev.off() + +ggsave("JPlot.pdf", pJ) # ---------------------- Now the frequency plots of the V, D and J families ---------------------- @@ -344,7 +350,9 @@ theme(panel.background = element_rect(fill = "white", colour="black"),text = element_text(size=15, colour="black"), axis.text.x = element_text(angle = 45, hjust = 1), panel.grid.major.y = element_line(colour = "black"), panel.grid.major.x = element_blank()) png("VFPlot.png") VPlot -dev.off(); +dev.off() +ggsave("VFPlot.pdf", VPlot) + write.table(x=VGenes, file="VFFrequency.txt", sep="\t",quote=F,row.names=F,col.names=T) if(useD){ @@ -362,7 +370,9 @@ theme(panel.background = element_rect(fill = "white", colour="black"),text = element_text(size=15, colour="black"), axis.text.x = element_text(angle = 45, hjust = 1), panel.grid.major.y = element_line(colour = "black"), panel.grid.major.x = element_blank()) png("DFPlot.png") print(DPlot) - dev.off(); + dev.off() + + ggsave("DFPlot.pdf", DPlot) write.table(x=DGenes, file="DFFrequency.txt", sep="\t",quote=F,row.names=F,col.names=T) } @@ -384,6 +394,9 @@ png("CDR3LengthPlot.png",width = 1280, height = 720) CDR3LengthPlot dev.off() + +ggsave("CDR3LengthPlot.pdf", CDR3LengthPlot, width=12, height=7) + write.table(x=CDR3Length, file="CDR3LengthPlot.txt", sep="\t",quote=F,row.names=F,col.names=T) # ---------------------- Plot the heatmaps ---------------------- @@ -413,6 +426,9 @@ png(paste("HeatmapVD_", unique(dat[3])[1,1] , ".png", sep=""), width=150+(15*length(Dchain$v.name)), height=100+(15*length(Vchain$v.name))) print(img) dev.off() + + ggsave(paste("HeatmapVD_", unique(dat[3])[1,1] , ".pdf", sep=""), img, height=13, width=8) + write.table(x=acast(dat, Top.V.Gene~Top.D.Gene, value.var="Length"), file=paste("HeatmapVD_", unique(dat[3])[1,1], ".txt", sep=""), sep="\t",quote=F,row.names=T,col.names=NA) } @@ -463,6 +479,9 @@ png(paste("HeatmapVJ_", unique(dat[3])[1,1] , ".png", sep=""), width=150+(15*length(Jchain$v.name)), height=100+(15*length(Vchain$v.name))) print(img) dev.off() + + ggsave(paste("HeatmapVJ_", unique(dat[3])[1,1] , ".pdf", sep=""), img, height=11, width=4) + write.table(x=acast(dat, Top.V.Gene~Top.J.Gene, value.var="Length"), file=paste("HeatmapVJ_", unique(dat[3])[1,1], ".txt", sep=""), sep="\t",quote=F,row.names=T,col.names=NA) } @@ -512,6 +531,9 @@ png(paste("HeatmapDJ_", unique(dat[3])[1,1] , ".png", sep=""), width=150+(15*length(Jchain$v.name)), height=100+(15*length(Dchain$v.name))) print(img) dev.off() + + ggsave(paste("HeatmapDJ_", unique(dat[3])[1,1] , ".pdf", sep=""), img, width=4, height=7) + write.table(x=acast(dat, Top.D.Gene~Top.J.Gene, value.var="Length"), file=paste("HeatmapDJ_", unique(dat[3])[1,1], ".txt", sep=""), sep="\t",quote=F,row.names=T,col.names=NA) } @@ -903,7 +925,7 @@ D.REGION.reading.frame dev.off() - +ggsave("DReadingFrame.pdf", D.REGION.reading.frame) # ---------------------- AA composition in CDR3 ---------------------- @@ -937,11 +959,14 @@ AAfreqplot = AAfreqplot + annotate("rect", xmin = 5.5, xmax = 6.5, ymin = 0, ymax = Inf, fill = "blue", alpha = 0.2) AAfreqplot = AAfreqplot + annotate("rect", xmin = 6.5, xmax = 7.5, ymin = 0, ymax = Inf, fill = "red", alpha = 0.2) AAfreqplot = AAfreqplot + ggtitle("Amino Acid Composition in the CDR3") + xlab("Amino Acid, from Hydrophilic (left) to Hydrophobic (right)") + ylab("Percentage") + scale_fill_manual(values=sample.colors) -AAfreqplot = AAfreqplot + theme(panel.background = element_rect(fill = "white", colour="black"),text = element_text(size=15, colour="black"), axis.text.x = element_text(angle = 45, hjust = 1), panel.grid.major.y = element_line(colour = "black"), panel.grid.major.x = element_blank()) +AAfreqplot = AAfreqplot + theme(panel.background = element_rect(fill = "white", colour="black"),text = element_text(size=15, colour="black"), panel.grid.major.y = element_line(colour = "black"), panel.grid.major.x = element_blank()) png("AAComposition.png",width = 1280, height = 720) AAfreqplot dev.off() + +ggsave("AAComposition.pdf", AAfreqplot, width=12, height=7) + write.table(AAfreq, "AAComposition.txt" , sep="\t",quote=F,na="-",row.names=F,col.names=T) # ---------------------- AA median CDR3 length ----------------------
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/report_clonality/circos/fonts.conf~ Tue Mar 28 05:40:04 2017 -0400 @@ -0,0 +1,8 @@ + +default = LTe50046.ttf +normal = LTe50046.ttf +bold = LTe50048.ttf +condensed = LTe50050.ttf +condensedbold = LTe50054.ttf +mono = pragmata.ttf +glyph = wingding.ttf
--- a/report_clonality/r_wrapper.sh Tue Mar 14 06:51:38 2017 -0400 +++ b/report_clonality/r_wrapper.sh Tue Mar 28 05:40:04 2017 -0400 @@ -118,25 +118,25 @@ echo "<div class='tabber'><div class='tabbertab' title='Gene frequencies'>" >> $outputFile -echo "<img src='VFPlot.png'/>" >> $outputFile +echo "<a href='VFPlot.pdf'><img src='VFPlot.png'/></a>" >> $outputFile if [[ "$useD" == "true" ]] ; then - echo "<img src='DFPlot.png'/>" >> $outputFile + echo "<a href='DFPlot.pdf'><img src='DFPlot.png'/></a>" >> $outputFile fi -echo "<img src='VPlot.png'/>" >> $outputFile +echo "<a href='VPlot.pdf'><img src='VPlot.png'/></a>" >> $outputFile if [[ "$useD" == "true" ]] ; then - echo "<img src='DPlot.png'/>" >> $outputFile + echo "<a href='DPlot.pdf'><img src='DPlot.png'/></a>" >> $outputFile fi -echo "<img src='JPlot.png'/> <br />" >> $outputFile +echo "<a href='JPlot.pdf'><img src='JPlot.png'/></a> <br />" >> $outputFile -echo "<img src='DReadingFrame.png'/>" >> $outputFile +echo "<a href='DReadingFrame.pdf'><img src='DReadingFrame.png'/></a>" >> $outputFile cat $dir/naive_gene_freq.htm >> $outputFile echo "</div>" >> $outputFile echo "<div class='tabbertab' title='CDR3 Characteristics'>" >> $outputFile -echo "<img src='CDR3LengthPlot.png'/><br />" >> $outputFile -echo "<img src='AAComposition.png'/>" >> $outputFile +echo "<a href='CDR3LengthPlot.pdf'><img src='CDR3LengthPlot.png'/></a><br />" >> $outputFile +echo "<a href='AAComposition.pdf'><img src='AAComposition.png'/></a>" >> $outputFile echo "<table class='pure-table pure-table-striped'>" >> $outputFile @@ -158,11 +158,11 @@ for sample in $samples; do echo "<div class='tabbertab' title='$sample'><table border='1'><tr>" >> $outputFile if [[ "$useD" == "true" ]] ; then - echo "<td><img src='HeatmapVD_$sample.png'/></td>" >> $outputFile + echo "<td><a href='HeatmapVD_$sample.pdf'><img src='HeatmapVD_$sample.png'/></a></td>" >> $outputFile fi - echo "<td><img src='HeatmapVJ_$sample.png'/></td>" >> $outputFile + echo "<td><a href='HeatmapVJ_$sample.pdf'><img src='HeatmapVJ_$sample.png'/></a></td>" >> $outputFile if [[ "$useD" == "true" ]] ; then - echo "<td><img src='HeatmapDJ_$sample.png'/></td>" >> $outputFile + echo "<td><a href='HeatmapDJ_$sample.pdf'><img src='HeatmapDJ_$sample.png'/></a></td>" >> $outputFile fi echo "</tr></table></div>" >> $outputFile count=$((count+1)) @@ -194,11 +194,11 @@ for sample in $samples; do echo "<div class='tabbertab' title='$sample'><table border='1'><center>" >> $outputFile if [[ "$useD" == "true" ]] ; then - echo "<tr><td>V-D</td><td><img src='circosVD_${sample}.png' width='700' height='700'/></td></tr>" >> $outputFile + echo "<tr><td>V-D</td><td><a href='circosVD_${sample}.pdf'><img src='circosVD_${sample}.png' width='700' height='700'/></td></tr>" >> $outputFile fi - echo "<tr><td>V-J</td><td><img src='circosVJ_${sample}.png' width='700' height='700'/></td></tr>" >> $outputFile + echo "<tr><td>V-J</td><td><a href='circosVJ_${sample}.pdf'><img src='circosVJ_${sample}.png' width='700' height='700'/></td></tr>" >> $outputFile if [[ "$useD" == "true" ]] ; then - echo "<tr><td>D-J</td><td><img src='circosDJ_${sample}.png' width='700' height='700'/></td></tr>" >> $outputFile + echo "<tr><td>D-J</td><td><a href='circosDJ_${sample}.pdf'><img src='circosDJ_${sample}.png' width='700' height='700'/></td></tr>" >> $outputFile fi echo "<center></table></div>" >> $outputFile count=$((count+1))