colourHelices: Assign colours to helices

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Functions to generate colours for helices by various rules, including integer counts, value ranges, percent identity covariation, conservation, percentage canonical basepair, basepair frequency, and non-pseudoknotted groups.

Usage

1
2
3
4
5
6
7
8
9

Arguments

helix

A helix data frame to be coloured.

cols

An array of characters (or numbers) representing a set of colours to colour helix with. When missing, a default set of colours from defaultPalette() will be used. Valid input include hex codes, colour names from the colours function, and integer numbers. The colours will be interpreted as being from best to worst.

counts

An array of integers the same length as cols, dictating the number of times each corresponding colour should be used. When missing, the function will divide the number of helices evenly over each of the colours available.

breaks

An integer number of intervals to break the ‘value’ column of helix into, or a list of numbers defining the interval breaks. If missing, the range of ‘helix$value’ will automatically be split evenly into intervals for each colour available.

get

If TRUE, returns the input helix with a col column, else simply returns an array of colours the same length as the number of row in helix. The exceptions are colourByBasepairFrequency and colourByUnknottedGroups which will return a different helix if TRUE, and a list of colours that will not match the input helix if FALSE.

log

If TRUE, will breaks values into even log10 space intervals, useful when values are p-values.

include.lowest

Whether the lowest interval should include the lowest value, passed to cut

...

Additional arguments passed to cut, potentially useful ones include right (whether intervals should be inclusive on the right or left) and dig.lab (number of digits in interval labels).

msa

A multiple sequence alignment. Can be either a Biostrings XStringSet object or a named array of strings like ones obtained from converting XStringSet with as.character.

Details

colourByCount assigns colours indepenent of the helix input's value column, and instead operates over the number of helices (i.e. rows).

colourByValue uses cut to assign each of the helices to an interval based on its value.

colourByCovariation, colourByConservation , and colourByCanonical, colour helices according to compensatory mutations (or covariation), percentage identity conservation, and percentage canonical basepair repsectively, relative to the multiple sequence alignment provided.

colourByBasepairFrequency colours each basepair according to the number of times it appear in the input, regardless of its value.

colourByUnknottedGroups greedily partitions the basepairs into non- pseudoknotted groups, and assigns a colour to each.

Value

All “colourBy” functions return a list of colours when get = FALSE, and a helix with a col column if get = TRUE. In both bases, the returned object has attributes “legend” and “fill”, showing the mapping between interval (in legend) and colour (in fill), which can as eponymous arguments legend.

defaultPalette returns the default list of colours.

Author(s)

Daniel Lai

See Also

plotHelix

logseq

basepairFrequency

unknottedGroups

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11

R4RNA documentation built on Nov. 8, 2020, 5:15 p.m.