arendsee / phylostratr

An R framework for phylostratigraphy
GNU General Public License v3.0
33 stars 7 forks source link

Error in if (class(strata) != "Strata") { : the condition has length > 1 #28

Open Dabaixian opened 1 year ago

Dabaixian commented 1 year ago

Hi Arendsee, Thanks for your help, i get the preliminary results from the phylostratr package. It boosts my study a lot, thank you sincerely! However, i met some new problems in further study, like in plot_heatmaps , strata2 <- strata_convert(strata, target='all', to='name') ,get_phylostrata_map(strata) and so on. It have problems like ①strata2 <- strata_convert(strata, target='all', to='name') %>%

②map <- get_phylostrata_map(strata) %>% select(mrca, ps) %>% distinct Error in if (class(strata) != "Strata") { : the condition has length > 1 👆 this one i really don't know how to resolve.....

③plot_heatmaps(results, filename="human.pdf",tree=strata@tree, focal_id=focal_taxid,to_name = TRUE, scheme = ) Scale for fill is already present. Adding another scale for fill, which will replace the existing scale. ……………… Scale for fill is already present. Adding another scale for fill, which will replace the existing scale. Error in stat_tree(): ! Problem while converting geom to grob. ℹ Error occurred in the 1st layer. Caused by error in check.length(): ! 'gpar'成分'lwd'的长度不能为零 Run rlang::last_error() to see where the error occurred.

Could you remind me how to solve the problem,thank you !! I wish you all the best!!

arendsee commented 1 year ago

Could you tell me the results of running class(strata)? The error message is saying the type of strata is glue, which is a type for string interpolation, certainly not a tree. I think something is going wrong earlier in the pipeline.

Could you maybe post the pipeline you are running here? If you don't mind sharing it, you can just paste it into the comments. Alternatively, you can DM me a text file with the code.