createPosVec: Find most conserved nucleotide in each position and its...

Description Usage Arguments Value Examples

View source: R/PositionCal.R

Description

This function grab the nucleotide for all of sequences at index position to create a XString sequence for a collection of this nucleotide. Then the function reformats the Xstring into a string clean it up.

Usage

1
createPosVec(seqSet, index)

Arguments

seqSet

A set of aligned sequence read from fasta file

index

A numeric index for generating Position String at that position.

Value

A String containing nucleotides at index position for sequences.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# Example 1: Use a sequence set with short sequence from data,
# create a string containing nucleotides at index 1 for this sequence set.

data(testSeqShort)
testSeq <- testSeqShort
position1Vec <- createPosVec(testSeq, 1)
position1Vec # "ATT"

# Example 2: Use a raw data sequence set, create a string containing
# nucleotides at index 10 for these raw data sequences.
findpath <- system.file("extdata", "sampleSeq3.txt", package = "conservedPos")
rawSeq <- Biostrings::readBStringSet(findpath,"fasta")
position10Vec <- createPosVec(rawSeq, 10)
position10Vec <- "TTTCACTACCAA"

hezijin/conservedPos documentation built on Jan. 1, 2021, 3:18 a.m.