BlockByRank: Return simple summaries of blocks of candidate pairs.

View source: R/BlockByRank.R

BlockByRankR Documentation

Return simple summaries of blocks of candidate pairs.

Description

This function is designed to work internally to SummarizePairs so it works on relatively simple atomic vectors and has little overhead checking. All arguments must be the same length.

Usage

BlockByRank(index1,
            partner1,
            index2,
            partner2)

Arguments

index1

Integer; references the contigs containing candidate feature partners.

partner1

Integer; references the candidate feature partners by row position in the source DataFrame.

index2

Integer; references the contigs containing candidate feature partners.

partner2

Integer; references the candidate feature partners by row position in the source DataFrame.

Details

BlockByRank uses the diagonal rank to identify where runs of candidate features are present in sequential blocks. In cases where a candidate feature is part of two competing blocks it is assigned to the larger.

Value

A list with named elements absblocksize and blockidmap.

Author(s)

Nicholas Cooley npc19@pitt.edu

See Also

NucleotideOverlap, SummarizePairs, FindSynteny

Examples

data("Endosymbionts_Pairs01", package = "SynExtend")
x <- paste(Endosymbionts_Pairs01$p1, Endosymbionts_Pairs01$p2, sep = "_")
x <- do.call(rbind, strsplit(x = x, split = "_", fixed = TRUE))
x <- matrix(data = as.integer(x), nrow = nrow(x))
y <- BlockByRank(index1 = x[, 2],
                 partner1 = x[, 3],
                 index2 = x[, 5],
                 partner2 = x[, 6])

npcooley/SynExtend documentation built on June 8, 2025, 5:24 a.m.