Skip to content

Commit

Permalink
allow calling combat without covariates. see #1.
Browse files Browse the repository at this point in the history
  • Loading branch information
brentp committed Jun 10, 2013
1 parent 612c913 commit 9c7e12e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion combat.py 100644 → 100755
Expand Up @@ -36,8 +36,13 @@ def design_mat(mod, numCovs, batch_levels):
def combat(dat, batch, mod, numCovs=None):
if isinstance(numCovs, basestring):
numCovs = [numCovs]
if numCovs is None:
numCovs = []

mod["batch"] = list(batch)
if mod:
mod["batch"] = list(batch)
else:
mod = pa.DataFrame({'batch': batch})

batch_items = mod.groupby("batch").groups.items()
batch_levels = [k for k, v in batch_items]
Expand Down Expand Up @@ -191,3 +196,6 @@ def postvar(sum2, n, a, b):
print ebat.ix[:5, :5]

ebat.to_csv("py-batch.txt", sep="\t")

mod = False
ebat = combat(dat, pheno.batch, mod)

0 comments on commit 9c7e12e

Please sign in to comment.