arborworkflows / aRbor

aRbor, an R package with useful functions for Arbor workflows
5 stars 3 forks source link

check for singleton nodes et al. #49

Closed bobthacker closed 9 years ago

bobthacker commented 9 years ago

See the GoogleDrive folder "files that failed at Biosphere2" These are from Jenna, a microbiologist in Jonathan's lab at UC-Davis. The Kirr.csv file needed a header, so I fixed that. The Kirr.phy file contains singleton nodes. It draws the following error in EasyMode: "Analysis failed. Error in read.tree(text = input) : The tree has apparently singleton node(s): cannot read tree file. Reading Newick file aborted at tree no. 1"

For EasyMode to be easy, instead of just giving this error that there is a singleton node, the software should just fix the singleton node for the user:

library(phytools) phy<-read.newick(input) phy<-collapse.singles(phy) phy<-multi2di(phy)

(could also check minimum edge length) if (min(phy$edge.length) == 0) { phy$edge.length = phy$edge.length + 0.00001 }

because we really want

To fix all this for Jenna, I ran in R

phy<-read.newick("Kirr.phy") Read 1 item phy<-collapse.singles(phy) phy<-multi2di(phy) min(phy$edge.length) [1] 1e-06 write.tree(phy,"KirrCollapsed.phy")

Now the error in easy mode is

"Analysis failed. Error in make.treedata(tree, table) : No matching names found between data and tree"

This one is easier. The tree has underscores and the .csv does not. Change the .csv. A good error message here, so easily noticed and fixed.

Now the error in easy mode is

"Analysis failed. Error in check.tree(tree) : 'tree' must be ultrametric"

newphy<-compute.brlen(phy,method="Grafen") write.tree(newphy,"KirrGrafen.phy")

Now easyMode works, but 3 other issues came up

  1. no color in circles at tips; circles at nodes much larger than circles at tip (which should just be larger)
  2. when I drop in a new .csv file, the preview does not change, even though the file name changes.
  3. broken arbor logo in EasyMode-Ancestral State Reconstruction
bobthacker commented 9 years ago

For EasyMode to really be "EASY" we need to automatically fix

bobthacker commented 9 years ago

I think it is OK to do all of these things for the user, but it would be great to also display some feedback on the screen like

lukejharmon commented 9 years ago

Moved to arborwebapps