knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
The biocentral R package contains functions pertaining to the central dogma including transcription and translation. The package also contains functions to synthesise DNA and measure amino acid frequency in a peptide.
First the package is installed and loaded.
if (!require("biocentral", quietly = TRUE)) devtools::install_github("rforbiodatascience22/group_1_package") library(biocentral)
To transcribe a DNA sequence we first need to synthesise our DNA with the createdna function.
set.seed(123) DNAseq <- createdna(30) DNAseq
Next, the DNA sequence is transcribed using the dna_to_rna function.
RNAseq <- dna_to_rna(DNAseq) RNAseq
Next, insert the RNA sequence in the codon_start function to split the sequence to codons. Here we start at position 1, but other reading frames can be used by changing the start position.
codons <- codon_start(RNAseq, start = 1) codons
Translation is done with the codon2amino function.
aa <- codon2amino(codons) aa
To determine the amino acid frequency, the seq_count function is used. This function will create a bar plot showing the amino acid frequency. It will only show the amino acids that appear at least once in the sequence.
seq_count(seq = aa)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.