seqs2hap: Generate Hap Results from Seqs

View source: R/hap2seqs.R

seqs2hapR Documentation

Generate Hap Results from Seqs

Description

generate hapResults from aligned and trimed sequences

Usage

seqs2hap(
  seqs,
  Ref = names(seqs)[1],
  hetero_remove = TRUE,
  na_drop = TRUE,
  maxGapsPerSeq = 0.25,
  hapPrefix = "H",
  pad = 3,
  chrName = "Chr0",
  ...
)

trimSeqs(seqs,
         minFlankFraction = 0.1)

Arguments

seqs

object of DNAStringSet or DNAMultipleAlignment class

Ref

the name of reference sequences. Default as the name of the first sequence

hetero_remove

whether remove accessions contains hybrid site or not. Default as TRUE

na_drop

whether drop sequeces contain "N" Default as TRUE.

maxGapsPerSeq

value in ⁠[0, 1]⁠ that indicates the maximum fraction of gaps allowed in each seq after alignment (default as 0.25). Seqs with gap percent exceed that will be dropped

hapPrefix

prefix of hap names. Default as "H"

pad

The number length in haplotype names should be extend to.

chrName

the Name should be used for haplotype

...

Parameters not used.

minFlankFraction

A value in ⁠[0, 1]⁠ that indicates the minimum fraction needed to call a gap in the consensus string (default as 0.1).

Value

object of hapResult class

Examples


data("geneHapR_test")
seqs
seqs <- trimSeqs(seqs,
         minFlankFraction = 0.1)
seqs
hapResult <- seqs2hap(seqs,
                      Ref = names(seqs)[1],
                      hetero_remove = TRUE, na_drop = TRUE,
                      maxGapsPerSeq = 0.25,
                      hapPrefix = "H")


geneHapR documentation built on May 29, 2024, 11:59 a.m.