region.as.fasta: Extract a region and write it to a FASTA file

Description Usage Arguments Details Examples

Description

This generic function writes a FASTA file of the observed biallelic positions to the current workspace.

Usage

1
2
## S4 method for signature 'GENOME'
region.as.fasta(object,region.id=FALSE,filename=FALSE,type=1,ref.chr=FALSE)

Arguments

object

an object of class "GENOME"

region.id

region of the genome

filename

name of the FASTA file

type

1: extract SNPs; 2: extract all nucleotides

ref.chr

reference sequence

Details

In case of type=2 we recommend to use the function splitting.data(,positions=list( ... ), type=2) before and apply the region.as.fasta() to this splitted object afterwards. The type=1 method will write a FASTA file including only the biallelic.sites.
region.id is the the region number specified in the PopGenome class GENOME.

Examples

1
2
3
4
5
#GENOME.class       <- readSNP("Arabidopsis",CHR=1)
# split the data into the genmic positions 100 to 2000
#GENOME.class.split <- splitting.data(GENOME.class, positions=list(100:2000),type=2)
#GENOME.class.split@region.names
#region.as.fasta(GENOME.class.split,1,"my_fasta_file.fas",type=2, ref.chr="chrom1.fas")

PopGenome documentation built on Feb. 1, 2020, 1:07 a.m.