Skip to content
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.

Commit

Permalink
TST: fix floating point error in test_differential_abundance.py
Browse files Browse the repository at this point in the history
Also add missing `bioconductor=TRUE` to fitZIG.r.
  • Loading branch information
jairideout committed Dec 24, 2014
1 parent 4ed2c18 commit aaad5b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions qiime/support_files/R/fitZIG.r
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sourcedir <- args[which(args == '--source_dir') + 1]
source(sprintf('%s/util.r',sourcedir))

load.library('optparse')
load.library('metagenomeSeq')
load.library('metagenomeSeq', bioconductor=TRUE)
load.library('biom')

# make option list and parse command line
Expand Down Expand Up @@ -46,4 +46,4 @@ if(is.null(opts$subcategory_2)) stop('Please supply a second subcategory.')
MRfulltable(fit, number = nrow(assayData(MGS)$counts), file=out_path, group=3)
}

fitZIG(opts$input_path, opts$out_path, opts$mapping_category, opts$subcategory_1, opts$subcategory_2)
fitZIG(opts$input_path, opts$out_path, opts$mapping_category, opts$subcategory_1, opts$subcategory_2)
7 changes: 6 additions & 1 deletion tests/test_differential_abundance.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ def test_metagenomeSeq_fitZIG_format(self):
'979\t0\t10\t0\t20\t0\t0\t0.0956087104342576\t6.04991702771485e-07\t5.04159752309571e-06\t0.0855575301280384\t1.4678274119766\t0.00901541795158288\t-7.07862887279825\t0.000648824231851767\t0.00540686859876472\n',
'1314\t4\t0\t7\t0\tInf\t0.34924924266116\tInf\t0.277924541082436\t0.347405676353045\t0.412980602558517\t-1.25800421238268\t-0.711956542078996\t22.3778549863952\t0.00315666606837298\t0.0197291629273311\n',
'1351\t0\t6\t0\t12\t0\t0\t0.320469784786932\t0.000621585760904647\t0.00194245550282702\t0.106944586260241\t1.21145998904839\t0.0112690273007214\t-8.84809361558598\t0.00579444501011918\t0.0289722250505959\n']
self.assertEqual(zig[1:6],exp)
for a, e in zip(zig[1:6],exp):
af = map(float,a.split('\t'))
ef = map(float,e.split('\t'))
self.assertEqual(len(af), len(ef))
for af_e, ef_e in zip(af, ef):
self.assertAlmostEqual(af_e, ef_e)

def test_DESeq2_nbinom_format(self):
nbinom = open(self.tmp_otu_fp_DESeq2_out).readlines()
Expand Down

0 comments on commit aaad5b2

Please sign in to comment.