Re: [Bioc-devel] Efficient Random Sampling of Positions in GRanges

2016-02-18 Thread Hervé Pagès
Hi, On 02/18/2016 03:00 AM, Dario Strbenac wrote: Good day, Thank you for these two suggestions. I have questions about both options. GPos seems to have a limit on the number of bases it can represent. I get an error: Error in GPos(samplingAreas) : too many genomic positions in 'pos_runs'.

Re: [Bioc-devel] Efficient Random Sampling of Positions in GRanges

2016-02-18 Thread Dario Strbenac
Good day, Thank you for these two suggestions. I have questions about both options. GPos seems to have a limit on the number of bases it can represent. I get an error: Error in GPos(samplingAreas) : too many genomic positions in 'pos_runs'. What exactly is this limit ? Could it be added to the

Re: [Bioc-devel] Efficient Random Sampling of Positions in GRanges

2016-02-16 Thread Hervé Pagès
Hi Dario, On 02/16/2016 03:00 AM, Dario Strbenac wrote: Hello, There is no convenience function to sample nucleotide positions from a GRanges object. My approach is to generate a GRanges of every chromosomal position with a width of 1, then find the overlaps with the desired ranges

Re: [Bioc-devel] Efficient Random Sampling of Positions in GRanges

2016-02-16 Thread Bernat Gel
Hi Dario, You could use a package called regioneR for that. It has functions to create random regions and to randomize existing sets of regions along the genome and it can do it taking into account a possible set of masked regions. In your case, you could create a mask for the genome that

[Bioc-devel] Efficient Random Sampling of Positions in GRanges

2016-02-16 Thread Dario Strbenac
Hello, There is no convenience function to sample nucleotide positions from a GRanges object. My approach is to generate a GRanges of every chromosomal position with a width of 1, then find the overlaps with the desired ranges (admissible regions), then sample the positions that overlapped.