Skip to contents

Return a vector if genomic regions that match the distribution of a set of query regions for any given set of characteristics, specified in the input meta.feature dataframe.

Usage

MatchRegionStats(
  meta.feature,
  query.feature,
  features.match = c("GC.percent"),
  n = 10000,
  verbose = TRUE,
  ...
)

Arguments

meta.feature

A dataframe containing DNA sequence information for features to choose from

query.feature

A dataframe containing DNA sequence information for features to match.

features.match

Which features of the query to match when selecting a set of regions. A vector of column names present in the feature metadata can be supplied to match multiple characteristics at once. Default is GC content.

n

Number of regions to select, with characteristics matching the query

verbose

Display messages

...

Arguments passed to other functions

Value

Returns a character vector

Details

If multiple features are to be matched (for example, GC content and overall accessibility), the features are first transformed so that they are uncorrelated with each other using a Cholesky decomposition. Each candidate region is then assigned to its nearest query region in this decorrelated space, using Euclidean distance.

Examples

metafeatures <- atac_small[["peaks"]][[]]
query.feature <- metafeatures[1:10, ]
features.choose <- metafeatures[11:nrow(metafeatures), ]
MatchRegionStats(
  meta.feature = features.choose,
  query.feature = query.feature,
  features.match = "GC.percent",
  n = 10
)
#> Matching region characteristics using nearest-neighbor distance
#>  [1] "chr1:1222590-1223380" "chr1:1201061-1201938" "chr1:1012999-1013896"
#>  [4] "chr1:865460-866306"   "chr1:890356-891196"   "chr1:1098941-1099797"
#>  [7] "chr1:1188896-1189774" "chr1:1261037-1261825" "chr1:633579-634474"  
#> [10] "chr1:1259851-1260705"