I have been creating rainfall plots following the tutorial from https://bernatgel.github.io/karyoploter_tutorial//Examples/Rainfall/Rainfall.html
Does anyone know how I could extract only mutations with a high degree of spatial clustering from the GRanges object? For example if I want to create a new object which is a list of all mutations that are within 1kb of another mutation. The output would be in this format for input into another program:
Chr start end ref alt
1 10 10 A T
1 50 50 C G
2 181 181 A T
2 280 280 T A
I also have the raw list of all variants in the format above that becomes a GRanges object, so it might be easier just to use a function that works directly on that to find clustered variants? I imagine a tool must already exist to identify variants that are spatially clustered in the genome, but I have not yet found one.
Thanks in advance for suggestions.
Most probably not an exact answer but you can look at Andreas Wagners paper (here https://www.genetics.org/content/176/4/2451 ) The perl script to find clusters of SNPs is available here https://www.ieu.uzh.ch/wagner/publications-software.html