
reverse.align(nucl.file, protaln.file, input.format = 'fasta', out.file, output.format = 'fasta', align.prot = FALSE, numcode = 1, clustal.path = NULL, forceDNAtolower = TRUE, forceAAtolower = FALSE)
align.prot
is
set to FALSE
. clustal.path
) align.prot
is TRUE. read.fasta
for reading
the nucleic acid file.read.alignment
for reading
the aligned protein sequence file. The alignment of the protein sequences can either be provided
directly, trough the 'protaln.file' parameter, or reconstructed with
ClustalW, if the parameter 'align.prot' is set to TRUE. In the latter
case, the pathway of the ClustalW binary must be given in the
'clustal.path' argument.
The protein and nucleic sequences must have the same name in the files
nucl.file
and protaln.file
.
The reverse-aligned nucleotide sequences are written to the file specified in the compulsory 'out.file' argument. For now, the only output format implemented is FASTA.
Warning: the 'align.prot=TRUE' option has only been tested on LINUX operating systems. ClustalW must be installed on your system in order for this to work.
citation('seqinr')
read.alignment
, read.fasta
, write.fasta
#
# Read example 'bordetella.fasta': a triplet of orthologous genes from
# three bacterial species (Bordetella pertussis, B. parapertussis and
# B. bronchiseptica):
#
nucl.file <- system.file('sequences/bordetella.fasta', package = 'seqinr')
triplet <- read.fasta(nucl.file)
#
# For this example, 'bordetella.pep.aln' contains the aligned protein
# sequences, in the Clustal format:
#
protaln.file <- system.file('sequences/bordetella.pep.aln', package = 'seqinr')
triplet.pep<- read.alignment(protaln.file, format = 'clustal')
#
# Call reverse.align for this example:
#
reverse.align(nucl.file = nucl.file, protaln.file = protaln.file,
input.format = 'clustal', out.file = 'test.revalign')
#
# Simple sanity check against expected result:
#
res.new <- read.alignment("test.revalign", format = "fasta")
data(revaligntest)
stopifnot(identical(res.new, revaligntest))
#
# Alternatively, we can use ClustalW to align the translated nucleic
# sequences. Here the ClustalW program is accessible simply by the
# 'clustalw' name.
#
## Not run:
# reverse.align(nucl.file = nucl.file, out.file = 'test.revalign.clustal',
# align.prot = TRUE, clustal.path = 'clustalw')## End(Not run)
Run the code above in your browser using DataLab