PoonLab / tn

Optimization of genetic clustering methods by predictive modeling
GNU General Public License v3.0
0 stars 0 forks source link

Cannot run import.tree #34

Closed ArtPoon closed 3 years ago

ArtPoon commented 3 years ago
> tS <- import.tree("stKing_Old.fasta.treefile")
 Error in strsplit(x, reVars) : object 'reVars' not found 

Function is missing reVars argument: https://github.com/PoonLab/tn/blob/76f1218fc2a85437478c92e040e4db214620a5ec/subT_Lib.R#L9-L12

ArtPoon commented 3 years ago

Restored reVars, new warning message:

> tS <- import.tree("stKing_Old.fasta.treefile")
Warning message:
In eval(jsub, SDenv, parent.frame()) : NAs introduced by coercion
ArtPoon commented 3 years ago

This line is causing the problem:

>   t$n[,"Bootstrap" := c(rep(100, nrow(t$seqInfo)), as.numeric(t$node.label))]
Warning message:
In eval(jsub, SDenv, parent.frame()) : NAs introduced by coercion
> summary(as.numeric(t$node.label))
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
    2.0    18.0    26.0    47.4    96.0   100.0       3
> t$node.label[which(is.na(as.numeric(t$node.label)))]
[1] "Root" ""     "" 
ConnorChato commented 3 years ago

The rest of the analysis has always been able to handle this warning. I believe that a lot of future confidence analysis sorts out these NAs, or compromises by resolving the root to a 1. It's also helped me catch errors in the past that try to calculate the bootstrap confidence of the root as though it were a normal node