Browse code

Commit made by the Bioconductor Git-SVN bridge. Consists of 1 commit.

Commit information:

Commit id: 91095e5380cc1cc8e62af3850af012809a8c93b3

cleaning up ssPermAnalysis

Committed by: nosson
Author Name: nosson
Commit date: 2015-02-03 16:29:10 -0500
Author date: 2015-02-03 16:29:10 -0500


git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/metagenomeSeq@99013 bc3139a8-67e5-0310-9ffc-ced21a209358

Joseph Paulson authored on 03/02/2015 21:29:20
Showing 3 changed files

... ...
@@ -1,7 +1,7 @@
1 1
 Package: metagenomeSeq
2 2
 Title: Statistical analysis for sparse high-throughput sequencing
3
-Version: 1.9.22
4
-Date: 2015-2-1
3
+Version: 1.9.23
4
+Date: 2015-2-3
5 5
 Author: Joseph Nathaniel Paulson, Hisham Talukder, Mihai Pop, Hector Corrada
6 6
     Bravo
7 7
 Maintainer: Joseph N. Paulson <jpaulson@umiacs.umd.edu>
... ...
@@ -1,5 +1,6 @@
1
-version 1.9.xx (2014)
1
+version 1.9.xx (2015)
2 2
 	+ Added flexibility in formula choice for fitTimeSeries
3
+	+ Added readability in ssPermAnalysis
3 4
 	+ Added fitTimeSeries vignette
4 5
 	+ Removed interactiveDisplay to namespace - moved to suggests
5 6
 	+ Fixed ordering of MRtable,MRfulltable first four columns
... ...
@@ -140,6 +140,7 @@ ssPerm <- function(df,B) {
140 140
 ssPermAnalysis <- function(data,formula,permList,intTimes,timePoints,include=c("class", "time:class"),...){
141 141
     resPerm=matrix(NA, length(permList), nrow(intTimes))
142 142
     permData=data
143
+    case = data.frame(time=timePoints, class=factor(levels(data$class)[2]))
143 144
     for (j in 1:length(permList)){
144 145
         
145 146
         permData$class = permList[[j]]
... ...
@@ -149,9 +150,8 @@ ssPermAnalysis <- function(data,formula,permList,intTimes,timePoints,include=c("
149 150
         } else{
150 151
             permModel = gss::ssanova(abundance ~ time * class,data=permData,...)
151 152
         }
152
-        permFit        = cbind(timePoints, (2*predict(permModel,data.frame(time=timePoints, class=factor(1)),#abs 
153
-            include=include, se=TRUE)$fit))
154 153
 
154
+        permFit = cbind(timePoints, (2*predict(permModel,case,include=include, se=TRUE)$fit))
155 155
             for (i in 1:nrow(intTimes)){
156 156
                 permArea=permFit[which(permFit[,1]==intTimes[i,1]) : which(permFit[,1]==intTimes[i, 2]), ]
157 157
                 resPerm[j, i]=metagenomeSeq::trapz(x=permArea[,1], y=permArea[,2])
... ...
@@ -367,7 +367,7 @@ fitTimeSeries <- function(obj,formula,feature,class,time,id,method=c("ssanova"),
367 367
                         lvl=NULL,include=c("class", "time:class"),C=0,B=1000,
368 368
                         norm=TRUE,log=TRUE,sl=1000,...) {
369 369
     if(method=="ssanova"){
370
-        if(requireNamespace(gss)){
370
+        if(requireNamespace("gss")){
371 371
             if(missing(formula)){
372 372
                 res = fitSSTimeSeries(obj=obj,feature=feature,class=class,time=time,id=id,
373 373
                         lvl=lvl,C=C,B=B,norm=norm,log=log,sl=sl,include=include,...)