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
MatchRegionStats( meta.feature, query.feature, features.match = c("GC.percent"), n = 10000, verbose = TRUE, ... )
A dataframe containing DNA sequence information for features to choose from
A dataframe containing DNA sequence information for features to 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.
Number of regions to select, with characteristics matching the query
Arguments passed to other functions
Returns a character vector
For each requested feature to match, a density
distribution is estimated using the
and a set of weights for each feature in the dataset estimated based on the
density distribution. If multiple features are to be matched (for example,
GC content and overall accessibility), a joint density distribution is then
computed by multiplying the individual feature weights. A set of features
with characteristics matching the query regions is then selected using the
sample function, with the probability of randomly
selecting each feature equal to the joint density distribution weight.
metafeatures <- Seurat::GetAssayData( object = atac_small[['peaks']], slot = 'meta.features' ) query.feature <- metafeatures[1:10, ] features.choose <- metafeatures[11:nrow(metafeatures), ] MatchRegionStats( meta.feature = features.choose, query.feature = query.feature, features.match = "percentile", n = 10 ) #> Matching percentile distribution #>  "chr1-1108888-1109641" "chr1-8212306-8213910" "chr1-2573495-2575472" #>  "chr1-2486054-2489237" "chr1-2043788-2044372" "chr1-2046611-2047074" #>  "chr1-3703815-3704555" "chr1-5541924-5542287" "chr1-6418151-6420435" #>  "chr1-8570017-8570771"