-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
87 lines (55 loc) · 2.72 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
---
output: github_document
---
[**click to view group 25's GitHub Repository**](https://github.com/rforbiodatascience23/group_25_package)
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
# group_25_CentralDogma
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 Loading
```{r setup}
library(centraldogma)
```
## Function Descriptions
### generate_DNA
This function creates a random DNA sample of user-defined length (input is an integer defining DNA_length).
**Example**
```{r}
generate_DNA(10)
```
### transcription
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**
```{r}
transcription("ATCG")
```
### mRNA_to_codons
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**
```{r}
# 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)
```
### translation
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.
```{r}
translation("UUU")
```
### plot_character_frequency
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.
```{r, fig.width=2, fig.height=2}
plot_character_frequency(mRNA_seq)
```
### Dependencies for Function Five (plot_character_frequency)
For the function [plot_character_frequency](https://github.com/rforbiodatascience23/group_25_package/blob/master/R/plot_character_frequency.R), 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.
### Limits on the Number of Dependencies
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.
### Compare Approaches for Importing Functions
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.