diff get_deseq_dataset.R @ 20:89d26b11d452 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/deseq2 commit 82fc6e1098b8af8b769ff07689704c5275b76459
author iuc
date Thu, 06 Dec 2018 15:49:22 -0500
parents c56e0689e46e
children 0696db066a5b
line wrap: on
line diff
--- a/get_deseq_dataset.R	Tue Dec 04 08:19:06 2018 -0500
+++ b/get_deseq_dataset.R	Thu Dec 06 15:49:22 2018 -0500
@@ -57,13 +57,16 @@
         })
         txdb <- makeTxDbFromGFF(gffFile)
         k <- keys(txdb, keytype = "TXNAME")
-        tx2gene <- select(txdb, k, "GENEID", "TXNAME")
+        tx2gene <- select(txdb, keys=k, columns="GENEID", keytype="TXNAME")
+        # Remove 'transcript:' from transcript IDs (when gffFile is a GFF3 from Ensembl and the transcript does not have a Name)
+        tx2gene$TXNAME <- sub('^transcript:', '', tx2gene$TXNAME)
       }
       try(txi <- tximport(txiFiles, type=txtype, tx2gene=tx2gene))
       if (!exists("txi")) {
-        # Remove version from transcript IDs
-        tx2gene$TXNAME <- sub('\\.[0-9]+', '', tx2gene$TXNAME)
-        txi <- tximport(txiFiles, type=txtype, tx2gene=tx2gene)
+        # Remove version from transcript IDs in tx2gene...
+        tx2gene$TXNAME <- sub('\\.[0-9]+$', '', tx2gene$TXNAME)
+        # ...and in txiFiles
+        txi <- tximport(txiFiles, type=txtype, tx2gene=tx2gene, ignoreTxVersion=TRUE)
       }
       dds <- DESeqDataSetFromTximport(txi,
                                       subset(sampleTable, select=-c(filename)),