caitiecollins / treeWAS

treeWAS: A Phylogenetic Tree-Based Tool for Genome-Wide Association Studies in Microbes
Other
93 stars 18 forks source link

Set mem.lim = numeric error? #20

Closed cizydorczyk closed 6 years ago

cizydorczyk commented 6 years ago

Hi Caitlin,

I have been playing around with treeWAS again, and when trying out the new mem.lim option, setting it to a numeric, I get the following error:

> snps.treewas.42 <- treeWAS(snps=snps.matrix, phen=phenotypes_vector, tree=phylo, n.snps.sim = 111*ncol(snps.matrix), mem.lim = 60, p.value = 0.05, filename.plot = "/home/conrad/Data/primary_project_3/gwas/H58_treewas/H58_treewas_plots.pdf", seed=42)
Error in treeWAS(snps = snps.matrix, phen = phenotypes_vector, tree = phylo,  : 
  object 'mf' not found

The only reference I have been able to find to an 'mf' object is in the following block of treeWAS code, part of the "## Update chunk.size, given mem.lim: ##" block of code (last line below):

#######################################
      ## Update chunk.size, given mem.lim: ##
      #######################################
      ## Check memory occuppied by snps:
      # require(pryr)
      memreq <- as.numeric(object_size(snps))/1000000000 # bytes --> GB

      ## Get n.snps.sim factor:
      fac <- n.snps.sim/ncol(snps)
      ## Update memreq:
      memreq <- memreq*fac

      ## Multiply by second factor to approximate total mem req'd by treeWAS:
      fac2 <- 70 ## (!!) NOTE---THIS IS AN ESTIMATE---IT MAY NEED TO BE IMPROVED... (!!)
      ## Update memreq:
      memreq <- memreq*fac2

      ## Get n.chunks (round up):
nc <- ceiling(memreq/mf)

Unfortunately, I cannot find where 'mf' is first assigned - perhaps this has something to do with the error?

Best, Conrad Izydorczyk

caitiecollins commented 6 years ago

Hi Conrad,

Sorry about this one. Just sheer stupidity on my part. The "mf" was a relic from a previous version I had done.

Should be fixed now though, if you reinstall the package.

Thank you for letting me know!

All the best, Caitlin.