simonhmartin / twisst

Topology weighting by iterative sampling of sub-trees
GNU General Public License v3.0
70 stars 18 forks source link

problem with plot.twisst #34

Closed CristianFRC closed 1 year ago

CristianFRC commented 1 year ago

I am plotting small regions of a 73 samples dataset, but when I try to plot with plot.twisst including show_topos=TRUE it shows me the following error: Error in layout(rbind(topos_layout_matrix, weights_layout_matrix), height = c(rep(1, : too many columns in layout, limit 200

I've also tried to plot with small and large values of width and height

simonhmartin commented 1 year ago

It sounds like you have a very large number of topologies. Did you run Twisst with 7 groups? If so, there will be too many to plot on in single image. I suggest identifying the most abundant topologies, and creating a subset of the Twisst object with just those before plotting. There is some example code provided in the example R script.

CristianFRC commented 1 year ago

Thank you for your reply.

I think the issue is that its trying to run hundreds of trees. Im trying to replace the trees and data file, reducing to those that weight more. But I would like to evaluate those resulting trees in the whole region of 15500 bp mitochondrial genome. Is it possible to load .fasta files instead of .geno or .vcf to evaluate the resulting trees that where calculated from the SNPs data?

I really appreciate your time making such an illustrative tutorial and for your code.

simonhmartin commented 1 year ago

I'm not too sure what you are asking, but I don't see why you would want to make sliding window trees for the mitochondria, since a non-recombining sequence should have just a single tree

tbusschau commented 1 year ago

Hi @simonhmartin

I get the same error trying to plot my results using your example plot. I also have 73 samples but in four groups. I can't figure out how to reduce the data for plotting, if that is the issue. I get the same error with and without smoothing.

This is the error I received.

plot.twisst(twisst_data_smooth, mode=2) #mode 2 overlays polygons, mode 3 would stack them Error in layout(rbind(topos_layout_matrix, weights_layout_matrix), height = c(rep(1, : too many rows in layout, limit 200

I'll appreciate your help, Theo

simonhmartin commented 1 year ago

It sounds like the problem here is different. This is caused by having too many different scaffolds in your assembly. You can specify a subset of regions to plot with plot.twisst() by including the regions option like regions=c("scaffold1", "scaffold3").

tbusschau commented 1 year ago

Thank you. That would makes sense and subsetting the scaffolds as suggested solved the problem.