gene_snv_aln: Get gene SNV alignment

Description Usage Arguments Value

View source: R/sequence.r

Description

Takes SNP informmation from multiple samples for a sequence fragment, and a reference sequence for that fragment. It produces and 'alignment' object that has one 'aligned' sequnece per sample where the SNPs have been replaced.

Usage

1
2
3
4
5
6
7
gene_snv_aln(
  snps,
  seq,
  missing_as = "major",
  strand = "+",
  keep_last_codon = TRUE
)

Arguments

snps

A tibble or data.frame. It must have columns 'site_id', 'sample', 'ref_pos', 'ref_allele', 'major_allele', and 'allele'. Column 'minor_allele' is not required at the moment but might be in the future.

seq

A character vector with the sequence of the fragment.

missing_as

How to treat sites in samples when there is no information in snps? Either 'N'(set all those sites to N), 'major' (use the major allele for that site), or 'ref' (use the reference allele).

strand

If strand is '-', then the sequence will be reverse complemented.

keep_last_codon

This is useful to remove stop codons when gene is a CDS. It will trim the last 3 sites from the alignment.

Value

An algnment object from seqinr


surh/HMVAR documentation built on Aug. 18, 2021, 1:21 a.m.