View source: R/intervals-liftover.R
| gintervals.load_chain | R Documentation |
Loads assembly conversion table from a chain file.
gintervals.load_chain(
file = NULL,
src_overlap_policy = "error",
tgt_overlap_policy = "auto",
src_groot = NULL,
min_score = NULL
)
file |
name of chain file | |||||||||||||||||||||
src_overlap_policy |
policy for handling source overlaps: "error" (default), "keep", or "discard". "keep" allows one source interval to map to multiple target intervals, "discard" discards all source intervals that have overlaps and "error" throws an error if source overlaps are detected. | |||||||||||||||||||||
tgt_overlap_policy |
policy for handling target overlaps. One of:
| |||||||||||||||||||||
src_groot |
optional path to source genome database for validating source chromosomes and coordinates. If provided, the function temporarily switches to this database to verify that all source chromosomes exist and coordinates are within bounds, then restores the original database. | |||||||||||||||||||||
min_score |
optional minimum alignment score threshold. Chains with scores below this value are filtered out. Useful for excluding low-quality alignments. |
This function reads a file in 'chain' format and returns assembly conversion table that can be used in 'gtrack.liftover' and 'gintervals.liftover'.
Source overlaps occur when the same source genome position maps to multiple target genome positions. Target overlaps occur when multiple source positions map to overlapping regions in the target genome.
The 'src_overlap_policy' controls how source overlaps are handled:
"error" (default): Throw an error if source overlaps are detected
"keep": Keep all mappings, allowing one source to map to multiple targets
"discard": Remove all chain intervals involved in source overlaps
The 'tgt_overlap_policy' controls how target overlaps are handled:
"error": Throw an error if target overlaps are detected
"auto" (default) / "auto_first": Keep the first overlapping chain (original file order) by trimming or discarding later overlaps while keeping source/target lengths consistent
"auto_longer": Keep the longer overlapping chain and trim/drop the shorter ones
"discard": Remove all chain intervals involved in target overlaps
"keep": Allow target overlaps to remain untouched (liftover must be able to handle them)
A data frame representing assembly conversion table with columns: chrom, start, end, strand, chromsrc, startsrc, endsrc, strandsrc, chain_id, score.
gintervals.liftover, gtrack.liftover
gdb.init_examples()
chainfile <- paste(.misha$GROOT, "data/test.chain", sep = "/")
# Load chain file with default policies
gintervals.load_chain(chainfile)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.