caitiecollins / treeWAS

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

browseVignettes("treeWAS") & test data set fails #32

Closed WallyL closed 5 years ago

WallyL commented 5 years ago

Hi Caitlin, I just installed treeWAS and after getting all the required libraries/dependencies in place, it appears to have installed just fine without any errors. The install is on a 32 core Linux box running Xubuntu 16.04.6 LTS.

I then ran and got the following:

> library(treeWAS) 
> browseVignettes("treeWAS")

No vignettes found by browseVignettes("treeWAS")

Next, I went to the Example Data and ran through that. It all seemed to run okay until the last line. I've included all the calls and outputs since I don't know what I should be expecting to see:

> ## Load example data:
> data(snps)
> data(phen)
> data(tree)
> ## Examine data:
> ## genetic data
> str(snps)
 num [1:100, 1:20003] 0 1 1 1 1 1 1 1 1 1 ...
 - attr(*, "dimnames")=List of 2
  ..$ : chr [1:100] "A_1090" "B_1078" "A_1070" "B_1083" ...
  ..$ : chr [1:20003] "1.g" "1.a" "2.t" "2.g" ... 
> ## phenotype
> str(phen)
 Factor w/ 2 levels "A","B": 2 2 2 2 1 2 1 1 2 2 ...
 - attr(*, "names")= chr [1:100] "B_1132" "B_1105" "B_1079" "B_1133" ...
> table(phen)
phen
 A  B 
45 55 
> ## tree
> str(tree)
List of 5
 $ edge       : int [1:198, 1:2] 167 167 150 150 168 168 184 184 190 190 ...
 $ tip.label  : chr [1:100] "B_1132" "B_1105" "B_1079" "B_1133" ...
 $ edge.length: num [1:198] 0.00884 0.00884 0.01584 0.01584 0.00863 ...
 $ Nnode      : int 99
 $ node.label : chr [1:99] "NODE_101" "NODE_102" "NODE_103" "NODE_104" ...
 - attr(*, "class")= chr "phylo"
 - attr(*, "order")= chr "pruningwise"
> ## Load colours:
> data(phen.plot.col) 
> ## Plot tree showing phenotype:
> plot.phen(tree, phen.nodes=phen.plot.col$all.nodes)
Error in plot.phen(tree, phen.nodes = phen.plot.col$all.nodes) : 
  could not find function "plot.phen"

So, before I try and play with this any further, I thought I would check to see if you have any ideas as to why I'm getting these failures and maybe suggest a remedy.

Best, Walt

xavierdidelot commented 5 years ago

Hi Walt,

There is a typo, the function is plot_phen not plot.phen

Best wishes, Xavier

WallyL commented 5 years ago

Thanks, Xavier. FYI, the Example set in Data & Data Cleaning still shows

## Plot tree showing phenotype:
plot.phen(tree, phen.nodes=phen.plot.col$all.nodes)

Best, Walt

xavierdidelot commented 5 years ago

Thanks, I've just corrected this.