Skip to content

Commit

Permalink
fixed indentation in the report template
Browse files Browse the repository at this point in the history
  • Loading branch information
federicomarini committed Sep 11, 2024
1 parent 25e21d5 commit 19630ae
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions inst/extdata/reportTemplate.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,11 @@ This plot shows how the samples are related to each other by plotting PC `r inpu

```{r}
res <- pcaplot(values$mydst,intgroup = input$color_by,ntop = input$pca_nrgenes,
pcX = as.integer(input$pc_x),pcY = as.integer(input$pc_y),
text_labels = input$sample_labels,
point_size = input$pca_point_size, title="Samples PCA - zoom in",
ellipse = input$pca_ellipse, ellipse.prob = input$pca_cislider
)
pcX = as.integer(input$pc_x),pcY = as.integer(input$pc_y),
text_labels = input$sample_labels,
point_size = input$pca_point_size, title="Samples PCA - zoom in",
ellipse = input$pca_ellipse, ellipse.prob = input$pca_cislider
)
res <- res + theme_bw()
res
```
Expand Down Expand Up @@ -154,14 +154,14 @@ This plot illustrates how the top `r input$pca_nrgenes` variant genes are distri

```{r}
if(!is.null(input$color_by)) {
expgroups <- as.data.frame(colData(values$mydst)[,input$color_by])
expgroups <- interaction(expgroups)
expgroups <- factor(expgroups,levels=unique(expgroups))
} else {
expgroups <- colnames(values$mydst)
}
colGroups <- colSel()[factor(expgroups)]
expgroups <- as.data.frame(colData(values$mydst)[,input$color_by])
expgroups <- interaction(expgroups)
expgroups <- factor(expgroups,levels=unique(expgroups))
} else {
expgroups <- colnames(values$mydst)
}
colGroups <- colSel()[factor(expgroups)]
res <- genespca(values$mydst,
ntop = input$pca_nrgenes,
Expand All @@ -180,10 +180,10 @@ For the selected genes, this is the overall profile across all samples

```{r}
if(!is.null(input$pcagenes_brush) & length(input$color_by)>0)
geneprofiler(values$mydst,
genelist = curData_brush()$ids,
intgroup = input$color_by,
plotZ = input$zprofile)
geneprofiler(values$mydst,
genelist = curData_brush()$ids,
intgroup = input$color_by,
plotZ = input$zprofile)
```

And here is an interactive heatmap for that subset
Expand All @@ -197,9 +197,9 @@ if(!is.null(input$pcagenes_brush))
selectedGenes <- brushedObject$ids
toplot <- assay(values$mydst)[selectedGenes,]
rownames(toplot) <- values$myannotation$gene_name[match(rownames(toplot),rownames(values$myannotation))]
mycolss <- c("#313695","#4575b4","#74add1","#abd9e9","#e0f3f8","#fee090","#fdae61","#f46d43","#d73027","#a50026") # to be consistent with red/blue usual coding
heatmaply(toplot,Colv = as.logical(input$heatmap_colv),colors = mycolss)
}
}
Expand Down Expand Up @@ -311,23 +311,23 @@ if(input$composemat > 0){
tcol <- obj3()[[2]]
tcol2 <- obj3()[[3]]
pres <- prcomp(t(pcmat),scale=FALSE)
plot.index <- c(as.integer(input$pc_x_multifac),as.integer(input$pc_y_multifac))
offset <- ncol(pcmat)/2
gene.no <- offset
pcx <- pres$x
# set.seed(11)
# for (i in 1:ncol(pcx)) {
# pcx[,i] <- pcx[,i] + rnorm(nrow(pcx),sd=diff(range(pcx[,i]))/100)
# }
plot(pcx[(offset+1):ncol(pcmat),plot.index[1]][1:gene.no],pcx[(offset+1):ncol(pcmat),plot.index[2]][1:gene.no],xlim=range(pcx[,plot.index[1]]),ylim=range(pcx[,plot.index[2]]),pch=20,col=tcol,cex=0.3)#,type="n")
#plot(0,type="n",xlim=range(pres$x[,plot.index]),ylim=range(pres$x[,plot.index]))
lcol <- ifelse(tcol != tcol2,"black","grey")
for (i in 1:gene.no) {
lines(pcx[c(i,offset+i),plot.index[1]],pcx[c(i,offset+i),plot.index[2]],col=lcol[i])
}
points(pcx[1:offset,plot.index[1]][1:gene.no],pcx[1:offset,plot.index[2]][1:gene.no],pch=20,col=tcol,cex=0.3)
points(pcx[(offset+1):ncol(pcmat),plot.index[1]][1:gene.no],pcx[(offset+1):ncol(pcmat),plot.index[2]][1:gene.no],pch=20,col=tcol2,cex=0.3)}
# for (i in 1:ncol(pcx)) {
# pcx[,i] <- pcx[,i] + rnorm(nrow(pcx),sd=diff(range(pcx[,i]))/100)
# }
plot(pcx[(offset+1):ncol(pcmat),plot.index[1]][1:gene.no],pcx[(offset+1):ncol(pcmat),plot.index[2]][1:gene.no],xlim=range(pcx[,plot.index[1]]),ylim=range(pcx[,plot.index[2]]),pch=20,col=tcol,cex=0.3)#,type="n")
#plot(0,type="n",xlim=range(pres$x[,plot.index]),ylim=range(pres$x[,plot.index]))
lcol <- ifelse(tcol != tcol2,"black","grey")
for (i in 1:gene.no) {
lines(pcx[c(i,offset+i),plot.index[1]],pcx[c(i,offset+i),plot.index[2]],col=lcol[i])
}
points(pcx[1:offset,plot.index[1]][1:gene.no],pcx[1:offset,plot.index[2]][1:gene.no],pch=20,col=tcol,cex=0.3)
points(pcx[(offset+1):ncol(pcmat),plot.index[1]][1:gene.no],pcx[(offset+1):ncol(pcmat),plot.index[2]][1:gene.no],pch=20,col=tcol2,cex=0.3)}
```

# About pcaExplorer
Expand Down

0 comments on commit 19630ae

Please sign in to comment.