Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

Chain-class

Chain objects


Description

A Chain object represents a UCSC chain alignment, typically imported from a chain file, and is essentially a list of ChainBlock objects. Each ChainBlock has a corresponding chromosome (its name in the list) and is a run-length encoded alignment, mapping a set of intervals on that chromosome to intervals on the same or other chromosomes.

Accessor Methods

In the code snippets below, x and object are ChainBlock objects.

ranges(x): Get the IntegerRanges object holding the starts and ends of the "from" ranges. Each range is a contiguous block of positions aligned without gaps to the other sequence.

offset(x): Integer offset from the "from" start to the "end" start (which could be in another chromosome).

score(x): The score for each mapping.

space(x): The space (chromosome) of the "to" range.

reversed(x): Whether the mapping inverts the region, i.e., the alignment is between different strands.

Import

A Chain object can be loaded from a UCSC chain format file simply by passing the path import function. If the file extension is not “chain”, then either pass “chain” to the format argument, or cast the path to a ChainFile object. The import.chain function is provided as a (slight) convenience. It is documented below, along with the extra exclude argument to the import method.

import.chain(con, exclude = "_", ...): Imports a chain file named con as a Chain object, a list of ChainBlocks. Alignments for chromosomes matching the exclude pattern are not imported.

Note

A chain file essentially details many local alignments, so it is possible for the "from" ranges to map to overlapping regions in the other sequence. The "from" ranges are guaranteed to be disjoint (but do not necessarily cover the entire "from" sequence).

Author(s)

Michael Lawrence

See Also

liftOver for performing lift overs using a chain alignment


rtracklayer

R interface to genome annotation files and the UCSC genome browser

v1.50.0
Artistic-2.0 + file LICENSE
Authors
Michael Lawrence, Vince Carey, Robert Gentleman
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.