From e7214d8a8ff1d9ac3c850224a4c4ae43a5c733d7 Mon Sep 17 00:00:00 2001 From: Paul Harrison Date: Fri, 6 Oct 2017 14:23:46 +1100 Subject: [PATCH] Fix R problem with empty data --- .gitignore | 2 ++ nesoni/nesoni-r/DESCRIPTION | 12 ++++++++++-- nesoni/nesoni-r/R/counts.R | 4 ++++ nesoni/nesoni-r/R/fitnoise.R | 6 +++--- nesoni/reference_directory.py | 8 ++++---- 5 files changed, 23 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 36e098d..2ee26d7 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ dist/* test/.state/* doc/_* nesoni.egg-info +*.sublime-* + diff --git a/nesoni/nesoni-r/DESCRIPTION b/nesoni/nesoni-r/DESCRIPTION index ff7f7ac..57eb9d3 100644 --- a/nesoni/nesoni-r/DESCRIPTION +++ b/nesoni/nesoni-r/DESCRIPTION @@ -5,5 +5,13 @@ Title: Nesoni R component Description: The R component of the Nesoni toolsuite. Author: Paul Harrison Maintainer: Paul Harrison -Depends: limma, edgeR, Matrix, parallel -Suggests: goseq, seriation, NMF \ No newline at end of file +Depends: + limma, + edgeR, + Matrix, + parallel +Suggests: + goseq, + seriation, + NMF, + varistran diff --git a/nesoni/nesoni-r/R/counts.R b/nesoni/nesoni-r/R/counts.R index d7125cc..bdc705a 100644 --- a/nesoni/nesoni-r/R/counts.R +++ b/nesoni/nesoni-r/R/counts.R @@ -10,6 +10,10 @@ read.counts <- function(filename, min.total=0, min.max=0, keep=NULL, norm.file=N data <- read.grouped.table(filename, require=c('Count'), default.group='Count') counts <- as.matrix( data$Count ) + + # Can happen with empty data + if (storage.mode(counts) == "logical") + storage.mode(counts) <- "numeric" gene <- data.frame(row.names=rownames(counts), locus_tag=rownames(counts)) diff --git a/nesoni/nesoni-r/R/fitnoise.R b/nesoni/nesoni-r/R/fitnoise.R index 959413c..14da00a 100644 --- a/nesoni/nesoni-r/R/fitnoise.R +++ b/nesoni/nesoni-r/R/fitnoise.R @@ -7,9 +7,9 @@ # # -library(Matrix) -library(limma) # EList class, p.adjust -library(parallel) +#library(Matrix) +#library(limma) # EList class, p.adjust +#library(parallel) ################################## diff --git a/nesoni/reference_directory.py b/nesoni/reference_directory.py index 3487c0c..1f9ac2d 100644 --- a/nesoni/reference_directory.py +++ b/nesoni/reference_directory.py @@ -214,14 +214,14 @@ def run(self): reference.set_annotations(annotations) with legion.Stage() as stage: + if self.genome: + stage.process(reference.build_genome, self.genome_select) + if config.apply_ifavailable_program(self.bowtie, 'bowtie2-build'): + stage.process(reference.build_bowtie_index) if config.apply_ifavailable_program(self.ls, 'gmapper-ls'): stage.process(reference.build_shrimp_mmap, False) if config.apply_ifavailable_program(self.cs, 'gmapper-cs'): stage.process(reference.build_shrimp_mmap, True) - if config.apply_ifavailable_program(self.bowtie, 'bowtie2-build'): - stage.process(reference.build_bowtie_index) - if self.genome: - stage.process(reference.build_genome, self.genome_select) if config.apply_ifavailable_jar(self.snpeff, 'snpEff.jar'): stage.process(reference.build_snpeff)