human_nt: Human-readable nucleotide scale

Description Usage Arguments Details Value Author(s) Examples

View source: R/plot_helpers.R

Description

Return a human readable list from a nucleotide position or lenght.

Usage

1

Arguments

nt

A nucleotide position

signif

Either a logical or an integer. If FALSE (default), nt is not rounded. Else, it returns signif significant digits.

Details

Return a nucleotide value in nt, kb, Mb or Gb, according to the value given. This is particularly useful to display nice scales without too many trailing zeros.

Value

Returns a list with 4 elements

n

A numeric value corresponding to nt divided by mult (see below).

tag

A character, giving the multiplier used in text.

mult

The muliplier used, in numeric value.

text

A character, giving the value in a human readable format.

Author(s)

Lionel Guy

Examples

1
2
3
human_nt(123456)
human_nt(123456, signif=2)
human_nt(123456890, signif=2)

genoPlotR documentation built on Jan. 5, 2021, 3:02 p.m.