import_fasta_sparse_nt: import_fasta_sparse_nt

View source: R/import_fasta_sparse_nt.R

import_fasta_sparse_ntR Documentation

import_fasta_sparse_nt

Description

Imports a fasta file to a sparse matrix representing SNPs from the consensus

Usage

import_fasta_sparse_nt(fasta, prior = "baps", check.fasta = TRUE)

Arguments

fasta

path to the fasta file or an ape DNAbin object

prior

the type of prior to use. Can be one of 'baps' and 'mean' (default=baps)

check.fasta

whether to check the fasta file for issue. Slows things down a little but may be avoided for very large fasta files.

Value

A sparse matrix representation of the SNPs (different to the consensus sequence)

Examples

fasta <- system.file("extdata", "seqs.fa", package = "fastbaps")
sparse.data <- import_fasta_sparse_nt(fasta)

fasta <- ape::read.FASTA(fasta)
sparse.data.ape <- import_fasta_sparse_nt(fasta)



gtonkinhill/fastbaps documentation built on Sept. 25, 2022, 1:56 p.m.