Learn R Programming

kmeRtone (version 1.0)

UCSC_Genome: Class constructor - build Genome object

Description

Class constructor - build Genome object

Class constructor - build Genome object

Arguments

Public fields

root_path

A path to a directory containing chromosome-separated fasta files.

genome_name

A genome name.

paths

Individual chromosome sequence files.

seq

A chromosome-named list of sequences.

seq_len

A chromosome-named vector of sequence length.

load_limit

Maximum chromosome sequences loaded.

mask

Genome mask status: "hard", "soft", or "none".

info_file

Path to info file with pre-computed values.

chr_names

Chromosome names.

Methods


Method new()

Create a new Genome class

Usage

UCSC_Genome$new(genome.name, root.path, mask, load.limit)

Arguments

genome.name

A genome name. UCSC genome is included with kmeRtone.

root.path

Path to a directory of user-provided genome FASTA files or the destination to save the NCBI/UCSC downloaded reference genome files.

mask

Genome mask status: "hard", "soft", or "none". Default is "none".

load.limit

Maximum chromosome sequences loaded. Default is 1.

Returns

A new Genome object.


Method [()

Calling chromosome sequence by loading on demand. Maximum load is determine by load_limit field.

Usage

UCSC_Genome$[(chr.names, reload = FALSE)

Arguments

chr.names

Chromosome name. It can be a vector of chromosomes.

reload

Reload the sequence from the root_path. Default is FALSE.

Returns

A single or list of sequence of requested chromosome.


Method print()

Print summary of Genome object.

Usage

UCSC_Genome$print()

Returns

Message of Genome object summary.


Method get_length()

Get chromosome length from pre-calculated length

Usage

UCSC_Genome$get_length(chr.names, recalculate = FALSE)

Arguments

chr.names

Chromosome name. It can be a vector of chromosomes.

recalculate

Recalculate the pre-calculated length.

Returns

A chromosome-named vector of length value.


Method get_content()

Get pre-calculated sequence content e.g. G+C content

Usage

UCSC_Genome$get_content(chr.names, seq, recalculate = FALSE)

Arguments

chr.names

Chromosome name. It can be a vector of chromosomes.

seq

Sequence to count. e.g. c("G", "C")

recalculate

Recalculate the pre-calculated length.

Returns

A chromosome-named vector of sequence content.


Method clone()

The objects of this class are cloneable with this method.

Usage

UCSC_Genome$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.