simonhmartin / twisst

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

apparent error in x-axis of Twisst plots #43

Closed dcmain closed 11 months ago

dcmain commented 12 months ago

Hi Simon, I have been playing around with your different functions in R. In particular, I have tried to make my figures somewhat less convoluted by subsetting my twisst data by scaffold and also by choosing only the top 2 or top 4 topologies. After playing around with these different functions, I noticed something unusual. When I subset by scaffold, the number of positions on the x-axis does not change. I was under the impression that the positions labeled on the x-axis of the twist plots are positions that span the genome and if you subset by scaffold then these would be positions that span the scaffold you have chosen. But regardless of how I subset my data, there are still 500 million positions on the x-axis. Do you have any idea why this might be? I have attached my weights file below if that helps

barbatulum_biallelic_weights.csv

simonhmartin commented 12 months ago

Hi Devon, Interesting - this sounds like a bug I was unaware of. Are you providing the window data file or just the weights file to the script? Do you mind sending me the R commands you're using? Email is also fine.

dcmain commented 11 months ago

Thanks Simon, it seems like the issue was that when I substituted different scaffolds into the 'subset to only specific regions' section and carried those substitutions throughout the script, it was initially still plotting scaffold 1 even if I'd chosen a different scaffold. Ultimately, I think this problem was just due to my inexperience with R. I didn't realize that I also needed to adjust the integer contained within the square brackets of the weights and positions dataframes to the relevant scaffold. After changing that integer to reflect the scaffold I was interested in, my problem was solved.