BDI-pathogens / phyloscanner

Phylogenetics between and within hosts at once, all along the genome.
GNU General Public License v3.0
44 stars 14 forks source link

split_hosts_to_subgraphs.R Error: length(lims) == 2 is not TRUE #42

Closed damientully closed 5 years ago

damientully commented 5 years ago

Hi Matthew,

I seem to be getting an error when running the split_hosts_to_subgraphs.R script. I am clearly doing something wrong:

Getting tip read counts... Identifying tips with hosts... Constructing vector of hosts... Finding tips for each host... Finding MRCAs for each host... Reconstructing internal node hosts with the Sankoff algorithm... Calculating node costs... Building full cost matrix... |==================================================| 100% Reconstructing... Identifying split hosts... Writing output to file NEW/subgraphs_s_NEW.rda ... Drawing tree... Error: length(lims) == 2 is not TRUE Execution halted

Any suggestions?

Thanks, Damien

mdhall272 commented 5 years ago

Hi Damien,

No, it's not you, it's us! Those scripts are rather elderly to be honest, and might very well go in a future release. But for now I've fixed it. You might avoid similar issues in future by using phyloscannerR interactively, however. Running phyloscanner.analyse.trees (the R function, not the bash script) should do what you want.

damientully commented 5 years ago

Thanks. I normally would use run the phyloscanner.analyse.trees script but I am trying to get a pairwise_relationships.rda file for use in Phyloscanner.R.utilities and I think the only way to do so is to follow those steps as outlined in the Phyloscanner.R.utilities page as the current pipeline does not output this file (I think!)?

mdhall272 commented 5 years ago

If you use -rda then you'll get an R image at the end which saves absolutely everything, so you just need to pluck what you need from that. Though I'm not sure how well that fits with Phyloscanner.R.utilities as it is now - what do you need from that? Much of that content has been moved across to the main repository.

damientully commented 5 years ago

Ah ok. I guess it was more to visualise the phylogenetic relationships between two individuals across the genome with the function phsc.plot.phyloscan which I guess one could pull that info out of the classification tables

mdhall272 commented 5 years ago

There is a specific function in phyloscannerR called produce.pairwise.graphs. This admittedly isn't quite the same as Olli's version and I have been meaning to implement that as well.