rtracklayer (version 1.32.1)

Chain-class: Chain objects


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 Ranges 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.


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.

See Also

liftOver for performing lift overs using a chain alignment