click to view group 25’s GitHub Repository
This package can be used to replicate the central dogma of molecular biology. The central dogma of biology describes the flow of genetic information: DNA is transcribed into RNA, which is then translated into proteins.
Dependencies for this package: ggplot2 and stringr.
library(centraldogma)
This function creates a random DNA sample of user-defined length (input is an integer defining DNA_length).
Example
generate_DNA(10)
#> [1] "GGTCAATCCC"
Transcribes the DNA sequence to RNA by substitution of the amino acid ‘T’ with ‘U’. The input is a DNA sequence given as a string.
Example
transcription("ATCG")
#> [1] "AUCG"
This function splits the mRNA sequence into codons. Inputs are the position at which to start at (int, Default is 1) and the mRNA sequence. It returns a list of codons.
Example
# Define an illustrative mRNA sequence (replace with a real sequence when using the package)
mRNA_seq <- "AACCCGTTAAAGGATCTGTAACAATACTGGACAA"
# Use the defined mRNA sequence in the function
mRNA_to_codons(mRNA_seq)
#> [1] "AAC" "CCG" "TTA" "AAG" "GAT" "CTG" "TAA" "CAA" "TAC" "TGG" "ACA"
The function translates from codons to amino acid sequences. Input (codons) is a list of codons to translate and output is a string of amino acid sequences.
translation("UUU")
#> [1] "F"
This function takes a string as input and plots a bar chart showing the frequency of each unique character in the string. The plot is generated using ggplot2.
plot_character_frequency(mRNA_seq)
For the function
plot_character_frequency,
I used ggplot2
for plotting and stringr
for string manipulation.
Added via @importFrom
in Roxygen comments. By specifying the functions
I need, I keep the package lightweight and reduce potential conflicts
with other packages.
We limited dependencies to ggplot2
and stringr
to keep the package
lightweight and avoid conflicts. While adding more could enhance the
functionality, it would also complicate the maintenance.
We chose to use @importFrom
to import only what is needed, making the
package efficient. Using package::function()
could clutter our code,
so we avoided it for clarity.