Skip to contents

This function translates a cds fasta file into an aa fasta file.

Usage

cdsfile2aafile(
  infile,
  outfile,
  shorten = FALSE,
  frame = 1,
  framelist = NULL,
  genetic.code = NULL
)

Arguments

infile

cds fasta file [mandatory]

outfile

aa fasta file [mandatory]

shorten

shorten all sequences to multiple of three [default: FALSE]

frame

indicates the first base of a the first codon [default: 1]

framelist

supply vector of frames for each entry [default: NULL]

genetic.code

The genetic code to use for the translation of codons into Amino Acid letters [default: NULL]

Value

aa fasta file

See also

Author

Kristian K Ullrich

Examples

## define file path
cdsfile <- system.file("fasta", "ath.cds.fasta.gz", package="CRBHits")
## create empty temp file
aafile <- tempfile()
## convert input CDS fasta file into AA fasta file
cdsfile2aafile(cdsfile, aafile)
aa <- Biostrings::readAAStringSet(aafile)
aa
#> AAStringSet object of length 1000:
#>        width seq                                            names               
#>    [1]   430 MEDQVGFGFRPNDEELVGHYLR...NMIIGVLLFISVISWIILVG* AT1G01010.1
#>    [2]   199 MIIFIDLILHRPKVYRHVLYNA...IFLIQIGSLLQYMSYFFRIV* AT1G01020.5
#>    [3]   359 MDLSLAPTTTTSSDQEQDRDQE...GDDDQFAKKGKSSLSLNFNP* AT1G01030.1
#>    [4]  1910 MVMEDEPREATIKPSYWLDACE...KKAKDSAAVLLLELLNKTFS* AT1G01040.1
#>    [5]   213 MSEETKDNQRLQRPAPRLNERI...EAIQYSMDLYAEYILHTLRR* AT1G01050.1
#>    ...   ... ...
#>  [996]   914 MSLSHLLRRLCTTTTTTRSPLS...PGPSHECQETQEKKVVELRN* AT1G10270.1
#>  [997]   413 MARGGKEEGEKHIGLLKLAQTL...KFSPSALAPLMNLSSTVLGF* AT1G10280.1
#>  [998]   915 MEAIDELSQLSDSMKQAASLLA...RTTPNRLPPAPPPTGSAYRY* AT1G10290.1
#>  [999]   659 MVKYNFKKITVVPNGKQFVDIV...SLKPKHLFSGKRGNGKNQRR* AT1G10300.2
#> [1000]   243 MTMATPFSGAANSIVAARTVLI...KAATMILNLTAGDNGGSLTV* AT1G10310.1