.ctss_summary_for_clusters | R Documentation |
Summarise CTSSs included in clusters
.ctss_summary_for_clusters(ctss, clusters)
ctss |
A |
clusters |
A |
The clusters
object with a new dominant_CTSS
metadata in CTSS
format reporting the genomic coordinate and expression score of most
highly expressed position in each cluster, plus a nr_ctss
metadata reporting
the number of expressed CTSSs in each cluster.
# See also benchmarks/dominant_ctss.md
(ctss <- CTSS( 'chr1', IRanges(start = 1:10, end = 1:10)
, '+', score = c(1, 0, 0, 1, 2, 0, 2, 1, 0, 1)))
(clusters <- GRanges( 'chr1', IRanges(start = c(1,9)
, end = c(8,10)), '+')) |> as("TagClusters")
# The function assumes that all CTSSes have a score above zero
.ctss_summary_for_clusters(ctss[score(ctss)>0], clusters)
# If not the case, it will give incorrect nr_ctss and fail to remove singletons
.ctss_summary_for_clusters(ctss, clusters)
# The function needs its output to be sorted and is not going to check it.
.ctss_summary_for_clusters(rev(ctss), clusters)
.ctss_summary_for_clusters(ctss, rev(clusters))
# Ties are resolved with 5' preference for both plus and minus strands.
# This may create a small bias.
ctss_minus <- ctss
strand(ctss_minus) <- '-'
clusters_minus <- clusters
strand(clusters_minus) <- '-'
.ctss_summary_for_clusters(ctss_minus, clusters_minus)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.