Commit c53fda77 authored by khalid's avatar khalid
Browse files

Change species names for deseq

parent 66e44bdb
......@@ -111,7 +111,30 @@ cat("# id: Top_genes
# plot_type: 'table'\ngene\t", file=snakemake@output[["Top_genes"]])
write.table(topGenes,snakemake@output[["Top_genes"]],append=TRUE,sep="\t")
speciesData = snakemake@params[["biomaRtDataset"]]
if ( speciesData != "None")
{
topGenes= cbind(topGenes, link=sprintf('<a href="http://www.ensembl.org/%s/geneview?gene=%s" target="_blank" class="btn btn-success" style="color: #fff; background-color: #449d44; border-color: #255625" >%s</a>',speciesData, rownames(topGenes), rownames(topGenes)))
ficout = paste0(snakemake@params[["outDir"]],"/TopGenes_ensembl_links_mqc.yaml")
cat("id: 'ensembl_links'
section_name: 'Top genes with links'
description: 'Using the links in this table, you can directly get detailed info from ensembl.org.'
plot_type: 'table'
pconfig:
id: 'ensembl_links_table'
namespace: 'ensembl links'
title: 'Ensembl links'
scale: false
data:
", file = ficout)
for (i in 1:nrow(topGenes))
{
cat (paste0(" ",rownames(topGenes)[i],":\n") ,file = ficout, append=TRUE)
for (j in 1:ncol(topGenes)) cat ( paste0(" ",colnames(topGenes)[j],": '", topGenes[i,j], "'\n" ) ,file = ficout, append=TRUE)
}
}
png(filename = snakemake@output[["MA_plot"]], height=800, width=800)
DESeq2::plotMA(res, ylim=c(-5,5))
dev.off()
......@@ -137,7 +160,7 @@ png(filename = snakemake@output[["Heatmap"]], height=800, width=800)
pheatmap(assayNTD[select,], cluster_rows=FALSE, show_rownames=FALSE, cluster_cols=TRUE, annotation_col=df)
dev.off()
speciesData = snakemake@params[["biomaRtDataset"]]
#what if we have tarnscript ID or not ENSEMBL ID instead of gene ID ?????????
......@@ -147,14 +170,16 @@ if (speciesData != "None") {
library(biomaRt)
tryCatch({
mart <- useMart(biomart="ENSEMBL_MART_ENSEMBL", host="uswest.ensembl.org")
species_mart <- useMart(biomart = "ENSEMBL_MART_ENSEMBL", host = "uswest.ensembl.org", dataset = speciesData)
#"mus_musculus" -> "mmusculus_gene_ensembl"
martName = paste0(substring(speciesData, 1, 1), unlist(strsplit(speciesData,"_"))[2] ,"_gene_ensembl")
species_mart <- useMart(biomart = "ENSEMBL_MART_ENSEMBL", host = "uswest.ensembl.org", dataset = martName)
#for the moment the top genes change to significant genes ?
ann <- getBM(filter="ensembl_gene_id",value=rownames(topGenes),attributes=c("ensembl_gene_id","description","transcript_length"),mart=species_mart)
go_ann <- getBM(filter="ensembl_gene_id",value=rownames(topGenes),attributes=c("ensembl_gene_id","description","go_id","name_1006","namespace_1003"),mart=species_mart)
write.table(go_ann,paste0(snakemake@params[["outDir"]],"/TopGenes_go_ann_mqc.tsv"),sep="\t",row.names =FALSE, quote = FALSE)
},
error = function(err) {
......@@ -164,7 +189,7 @@ if (speciesData != "None") {
#test for gene enrichment with gprofiler2
library(gprofiler2)
#for the moment the top genes change to significant genes ?
organisme = gsub("_gene_ensembl", "", speciesData)
organisme = gsub("_gene_ensembl", "", martName)
#limit to GO sources
sources = c("GO:BP", "GO:MF", "GO:CC")
......
......@@ -59,13 +59,13 @@
type: select,
choices: [
None: "None",
Mus musculus: "mmusculus_gene_ensembl",
Homo sapiens: "hsapiens_gene_ensembl",
Nile tilapia: "oniloticus_gene_ensembl",
Drosophila melanogaster: "dmelanogaster_gene_ensembl"
Mus musculus: "mus_musculus",
Homo sapiens: "homo_sapiens",
Nile tilapia: "oreochromis_niloticus",
Drosophila melanogaster: "drosophila_melanogaster"
],
value: "None",
label: "Species"
label: "Species name in Ensembl.org"
},
# {
# name: deseq2_fitType,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment