gtonkinhill / panstripe

post processing of bacterial pangenome gene presence/absence matrices
GNU General Public License v2.0
51 stars 6 forks source link

Questions about tip_states #9

Closed verylili closed 10 months ago

verylili commented 1 year ago

Hi, I met an error as follows: Error in panstripe:::asr_max_parsimony(tree, pa[, .x] + 1, Nstates = 2) : ERROR: tip_states must be integers between 1 and 2, but found values between 2 and 3 If it means that there is something wrong about my tree? My tree was built using NJ method. But no error was reported by the software used for constructing tree.

gtonkinhill commented 1 year ago

Hi,

This is more likely to be an issue with your presence/absence matrix. Can you check that all the entries are either 1 or 0? i.e that all(pa %in% c(0,1)) returns TRUE

verylili commented 1 year ago

Hi,

This is more likely to be an issue with your presence/absence matrix. Can you check that all the entries are either 1 or 0? i.e that all(pa %in% c(0,1)) returns TRUE

Thanks a lot. I found that all(pa %in% c(0,1)) returns FLASE. So I changed all values > 1 to 1 in the gene presence/absence matrix. Then the panstripe worked well. Do you think that the results from the new matrix make sense?