SaveHaplotypes: Save consensus haplotypes after sorting by mutation and...

View source: R/SaveHaplotypes.R

SaveHaplotypesR Documentation

Save consensus haplotypes after sorting by mutation and abundance

Description

Sorts and renames haplotypes by the number of mutations with respect to the dominant haplotype, and by abundance, and saves their sequences in a FASTA file.

Usage

SaveHaplotypes(flnm = "./SavedHaplotypes.fna", bseqs, nr, max.difs = 250)

Arguments

flnm

File path of the FASTA file that will be generated with haplotype sequences.

bseqs

Character object with the haplotype alignment.

nr

Vector with the haplotype counts.

max.difs

Maximum number of mismatches allowed with respect to the dominant one

Details

This function is similar to SortByMutations function from QSutils package but has new features. For example, in this case haplotypes with a huge number of mutations (defined by max.difs) with respect to the dominant one are discarted, and columns with all gaps are eliminated. Also, the final sequences are saved in a FASTA file.

Value

A list containing the following:

bseqs

DNAStringSet or AAStringSet with the haplotype sequences.

nr

Vector of the haplotype counts.

nm

Vector of the number of differences of each haplotype with respect to the dominant haplotype.

After execution, a FASTA file named as flnm with the bseqs element will be generated.

Author(s)

Alicia Aranda

See Also

SortByMutations, ConsHaplotypes, IntersectStrandHpls


aliafdz/QApckg documentation built on June 2, 2022, 10:29 a.m.