From 63913ede72045902b0fa225c3fc94cc0c4b6e5f0 Mon Sep 17 00:00:00 2001
From: Holger Brandl <brandl@mpi-cbg.de>
Date: Mon, 24 Nov 2014 14:59:56 +0100
Subject: [PATCH] cont. dge analysis

---
 R/bio/cummerutils.R | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/R/bio/cummerutils.R b/R/bio/cummerutils.R
index 6522de5..7ceb150 100644
--- a/R/bio/cummerutils.R
+++ b/R/bio/cummerutils.R
@@ -16,3 +16,18 @@ filterByExpression <- function(fpkmMat, minFPKM=1, logMode=F){
 
     fpkmMat[geneMax>minFPKM,]
 }
+
+
+guess_mart <- function(gene_id){
+    an_id <-gene_id[1]
+    if(str_detect(an_id, "ENSCAFG")){
+        return("cfamiliaris_gene_ensembl")
+    }else if(str_detect(an_id, "ENSMUSG")){
+        return("mmusculus_gene_ensembl")
+    }else if(str_detect(an_id, "ENSG")){
+        return("hsapiens_gene_ensembl")
+    }else{
+        stop(paste("could not guess mart from ", an_id))
+    }
+}
+#guess_mart("ENSCAFG00000000043")
-- 
GitLab