knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

sequence tree or sequence names

First thing the software needs is the sequence files and sequence names.

library(synal)
library(Biostrings)
specNames <- c('Scer','Spar','Smik','Skud','Sbay','Sarb')
filename <- system.file('examples','exampleAlignment.fa',package='synal')
aln <- readDNAStringSet(filename)

proto-gene sequence

After you read the alignment file and sequence names, the ORF of interest should be given. If you are interested in an S.cerevisiae annotated ORF, you can find the sequence using findYgeneSeq function.

ygene <- findYGeneSeq('YBR196C-A')

alignment and getting subalignments

After giving correct inputs, it is easy to get subalignments and Amino acid translations.

  dnalist <- align(aln,'YBR196C-A',ygeneSeq = ygene)
  DNAStr <- dnalist$dnaAlignmentList[[1]]
  start <- dnalist$dnaAlignmentList[[2]]
  stop <- dnalist$dnaAlignmentList[[3]]
  subalignment <- subseq(DNAStr,start,stop)
  aa_alignment <- dnalist$aa_alignment

finding orthologs

if you are interested in finding all overllaping ORFs with your ORF of interest you can do so.

types<-specNames#c('scer','Spar','Smik','Skud','Sbay','Sarb')
vec <- c(1,1,1,0,0,0)
types <- types[vec>0]
homologs <- findHomolog(DNAStr[vec>0], start, stop, ygene, types, orfName = 'YBR196C-A')
homologs

getting dataframe

todo:add example inputs to use in analyze function

#dataTable <- analyze('../../synal_deneme/','YBR013C',types)

all in one

finally all of the above can be done using a single function for all the sequences in the given alignment file

#dataTable <- alignAnalyze('~/Downloads/combined/YBR013C/YBR013C_alignment.fa','YBR013C',outputDirectory = '../../synal_deneme/',specNames = specNames)


oacar/synal documentation built on Feb. 22, 2020, 1:42 p.m.