ancestor_processing: Resolve the ancestor argument of remove_hypermut

Description Usage Arguments Details Value Examples

View source: R/ancestor_processing.R

Description

A simple function that resolves the ancestor argument passed to the remove_hypermut function.

Usage

1
ancestor_processing(ancestor, dat)

Arguments

ancestor

Either 'consensus' to indicate that the consensus sequences must be computed, or 'first' to indicate that the first sequence in the dataset should be considered to be the ancestral sequence, or the ancestral sequence itself.

dat

The sequence data

Details

Three options exists for specifying the ancestral sequence to compare the query sequences in the dataset to.

consensus

If the value 'consensus' is specified via the ancestor parameter, a consensus sequence will be computed from the sequences in the input file. The letter that most frequently occurs is placed in the consensus sequence. In the case of ties, the first letter, when arranged alphabetically, is used.

first

Include the ancestral sequence as the first sequence in the input file and to set the value of the ancestor parameter to 'first'. In this case, the first sequence will be removed from the dataset before proceeding.

Ancestral sequence

The ancestor parameter can be assigned the ancestral sequence itself. The only validation that is performed on the last of the three options is to check that the sequence assigned to ancestor has the same length as the sequences in the input file.

Value

A list with two elements:

cons

The ancestral sequence. Originally, only the consensus sequence option was supported, hence it is called 'cons' for historical reasons.

dat

The sequence dataset. The dataset that was passed into this function via the dat parameter with the first sequence removed in the case of the 'first' option and unaltered in case of the other two options.

Examples

1
2
ancestors <- ancestor_processing('consensus', ld_seqs)
print(ancestors$cons)

philliplab/hypermutR documentation built on Sept. 2, 2020, 2:51 p.m.