Fig. 3From: plyranges: a grammar of genomic data transformationIdiomatic code examples for plyranges (a) and GenomicRanges (b) illustrating an overlap and aggregate operation that returns the same result. In each example, we have two BED files consisting of SNPs that are genome-wide association study (GWAS) hits and reference exons. Each code block counts for each SNP the number of distinct exons it overlaps. The plyranges code achieves this with an overlap join followed by partitioning and aggregation. Strand is ignored by default here. The GenomicRanges code achieves this using the “Hits” and “List” classes and their methodsBack to article page