Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
Adding DEG Type prefix to output karyplot to prevent race conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
skchronicles committed Jun 27, 2019
1 parent 4090cba commit 7b33da1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
10 changes: 5 additions & 5 deletions Results-template/Scripts/Deseq2Report.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ sessionInfo()

## **Count Distribution** {.tabset}

### Before Normalization
### **Before Normalization**

```{r before_hist, echo=FALSE, warning=FALSE,message=FALSE,webgl=TRUE}
Expand Down Expand Up @@ -411,7 +411,7 @@ for(i in seq(1, length(contras), by = 2)) {
}
if (SPECIES=="hg19" | SPECIES=="hg38" | SPECIES=="mm10" | SPECIES=="mm9" | SPECIES=="canFam3" | SPECIES=="Mmul_8.0.1" ){
system(paste0("cd ",getwd(),";/data/CCBR_Pipeliner/db/PipeDB/Conda/envs/r_env/bin/Rscript ../Scripts/karyoploter.R -d DESeq2_DEG_",contras[i],"-",contras[i+1],"_all_genes.txt -c ", params$karyotext, " -g ", SPECIES))
system(paste0("cd ",getwd(),";/data/CCBR_Pipeliner/db/PipeDB/Conda/envs/r_env/bin/Rscript ../Scripts/karyoploter.R -o deseq2 -d DESeq2_DEG_",contras[i],"-",contras[i+1],"_all_genes.txt -c ", params$karyotext, " -g ", SPECIES))
}
}
Expand All @@ -424,7 +424,7 @@ res=as.data.frame(cbind(mfc,mpval))
rownames(res)=rownames(res1)
write.table(res,file="DESeq2_res_all_contrasts.txt",sep="\t",col.names=NA)
#DT::datatable(res, caption=htmltools::tags$caption("DEG for contrast",style="color:grey; font-size: 18px" ))
DT::datatable(deseq2out, extensions = 'Buttons', options = list(dom = 'Bfrtip', buttons = c('colvis','excel', 'csv')))
DT::datatable(deseq2out, extensions = 'Buttons', options = list(dom = 'Bfrtip', buttons = c('colvis','excel', 'csv'), pageLength = 15))
```


Expand All @@ -448,7 +448,7 @@ v_fdr

```{r, echo=FALSE, warning=FALSE,message=FALSE,results='asis'}
if (SPECIES=="hg19" | SPECIES=="hg38" | SPECIES=="mm10" | SPECIES=="mm9" | SPECIES=="canFam3" | SPECIES=="Mmul_8.0.1" ){
cat("![](karyoplot1.png)")
cat("![](deseq2_karyoplot1.png)")
} else {
cat("Genome Not Supported")
}
Expand All @@ -459,7 +459,7 @@ if (SPECIES=="hg19" | SPECIES=="hg38" | SPECIES=="mm10" | SPECIES=="mm9" | SPECI

```{r, echo=FALSE, warning=FALSE,message=FALSE,results='asis'}
if (SPECIES=="hg19" | SPECIES=="hg38" | SPECIES=="mm10" | SPECIES=="mm9" | SPECIES=="canFam3" | SPECIES=="Mmul_8.0.1" ){
cat("![](karyoplot2.png)")
cat("![](deseq2_karyoplot2.png)")
} else {
cat("Genome Not Supported")
}
Expand Down
10 changes: 5 additions & 5 deletions Results-template/Scripts/EdgerReport.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ for(i in 1:nb){
}
if (SPECIES=="hg19" | SPECIES=="hg38" | SPECIES=="mm10" | SPECIES=="mm9" | SPECIES=="canFam3" | SPECIES=="Mmul_8.0.1" ) {
system(paste0("cd ",getwd(),";/data/CCBR_Pipeliner/db/PipeDB/Conda/envs/r_env/bin/Rscript ../Scripts/karyoploter.R -d edgeR_DEG_",contras[i],"-",contras[i+1],"_all_genes.txt -c ", params$karyotext, " -g ", SPECIES))
system(paste0("cd ",getwd(),";/data/CCBR_Pipeliner/db/PipeDB/Conda/envs/r_env/bin/Rscript ../Scripts/karyoploter.R -o edgeR -d edgeR_DEG_",contras[i],"-",contras[i+1],"_all_genes.txt -c ", params$karyotext, " -g ", SPECIES))
}
}
Expand All @@ -483,7 +483,7 @@ rownames(res)=rownames(res1)
write.table(res,file="edgeR_res_all_contrasts.txt",sep="\t",col.names=NA)
#DT::datatable(res, caption=htmltools::tags$caption("DEG for all contrasts",style="color:blue; font-size: 18px"))
DT::datatable(edgerout, extensions = 'Buttons', options = list(dom = 'Bfrtip', buttons = c('colvis','excel', 'csv')))
DT::datatable(edgerout, extensions = 'Buttons', options = list(dom = 'Bfrtip', buttons = c('colvis','excel', 'csv'), pageLength = 15))
```

## **Volcano Plots** {.tabset}
Expand All @@ -506,7 +506,7 @@ v_fdr

```{r de_karyo1, echo=FALSE, warning=FALSE,message=FALSE,results='asis'}
if (SPECIES=="hg19" | SPECIES=="hg38" | SPECIES=="mm10" | SPECIES=="mm9" | SPECIES=="canFam3" | SPECIES=="Mmul_8.0.1" ){
cat("![](karyoplot1.png)")
cat("![](edgeR_karyoplot1.png)")
} else {
cat("Genome Not Supported")
}
Expand All @@ -517,7 +517,7 @@ if (SPECIES=="hg19" | SPECIES=="hg38" | SPECIES=="mm10" | SPECIES=="mm9" | SPECI

```{r de_karyo2, echo=FALSE, warning=FALSE,message=FALSE,results='asis'}
if (SPECIES=="hg19" | SPECIES=="hg38" | SPECIES=="mm10" | SPECIES=="mm9" | SPECIES=="canFam3" | SPECIES=="Mmul_8.0.1" ){
cat("![](karyoplot2.png)")
cat("![](edgeR_karyoplot2.png)")
} else {
cat("Genome Not Supported")
}
Expand Down Expand Up @@ -566,4 +566,4 @@ if (SPECIES=="hg19" | SPECIES=="mm10" | SPECIES=="hg38"){
} else {
cat("Genome Not Supported")
}
```
```
6 changes: 3 additions & 3 deletions Results-template/Scripts/LimmaReport.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ for (i in 1:nb) {
}
if (SPECIES=="hg19" | SPECIES=="hg38" | SPECIES=="mm10" | SPECIES=="mm9" | SPECIES=="canFam3" | SPECIES=="Mmul_8.0.1" ) {
system(paste0("cd ",getwd(),";/data/CCBR_Pipeliner/db/PipeDB/Conda/envs/r_env/bin/Rscript ../Scripts/karyoploter.R -d limma_DEG_",contras[i],"-",contras[i+1],"_all_genes.txt -c ", params$karyotext, " -g ", SPECIES))
system(paste0("cd ",getwd(),";/data/CCBR_Pipeliner/db/PipeDB/Conda/envs/r_env/bin/Rscript ../Scripts/karyoploter.R -o limma -d limma_DEG_",contras[i],"-",contras[i+1],"_all_genes.txt -c ", params$karyotext, " -g ", SPECIES))
}
}
Expand Down Expand Up @@ -473,7 +473,7 @@ v_fdr

```{r karyo_gene1, echo=FALSE, warning=FALSE,message=FALSE,results='asis'}
if (SPECIES=="hg19" | SPECIES=="hg38" | SPECIES=="mm10" | SPECIES=="mm9" | SPECIES=="canFam3" | SPECIES=="Mmul_8.0.1" ){
cat("![](karyoplot1.png)")
cat("![](limma_karyoplot1.png)")
} else {
cat("Genome Not Supported")
}
Expand All @@ -484,7 +484,7 @@ if (SPECIES=="hg19" | SPECIES=="hg38" | SPECIES=="mm10" | SPECIES=="mm9" | SPECI

```{r karyo_gene2, echo=FALSE, warning=FALSE,message=FALSE,results='asis'}
if (SPECIES=="hg19" | SPECIES=="hg38" | SPECIES=="mm10" | SPECIES=="mm9" | SPECIES=="canFam3" | SPECIES=="Mmul_8.0.1" ){
cat("![](karyoplot2.png)")
cat("![](limma_karyoplot2.png)")
} else {
cat("Genome Not Supported")
}
Expand Down
5 changes: 4 additions & 1 deletion Results-template/Scripts/karyoploter.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ parser$add_argument("-g", "--genome", type="character", required=TRUE,
help="Genome .. either hg19/hg38/mm9/mm10/Mmul8.0.1/canFam3")
parser$add_argument("-f", "--fdr", type="double", default=0.05,
help="FDR cutoff to use")
parser$add_argument("-o", "--outfileprefix", type="character", required=TRUE,
help="DEG type output file prefix: limma/edgeR/DESeq2")

args <- parser$parse_args()


Expand Down Expand Up @@ -92,7 +95,7 @@ if (nrow(neg_strand_down_triangle)>0) {neg_strand_down_triangle$log2fc=neg_scale

for (i in seq(1,length(chrs_subsets))) {
chrs2=unlist(chrs_subsets[i])
png(paste("karyoplot",i,".png",sep=""), width = 10, height = 6, units = 'in', res = 1600)
png(paste(args$outfileprefix,"_karyoplot",i,".png",sep=""), width = 10, height = 6, units = 'in', res = 1600)
kp <- plotKaryotype(genome=genome, plot.type=2, chromosomes = chrs2)

kpDataBackground(kp, data.panel = 1, r0=0, r1=0.9)
Expand Down

0 comments on commit 7b33da1

Please sign in to comment.