0% found this document useful (0 votes)
4 views8 pages

Coursework R Programming

Uploaded by

rinrithiya1340
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views8 pages

Coursework R Programming

Uploaded by

rinrithiya1340
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Part 1: Brief Lab Report (60%)

We will not test your programming skill at this point; however, we need to examine whether you have
practiced programming by following the lab session. For this purpose, we need you to submit a brief lab
report containing around 10 screen shots of your lab practice and some very brief explanation (so that we
can confirm you know what you are doing.)

One example is provided in the following. You should prepare at least 10 screenshots, maybe more if you
want.

Put your answers below


ID Your Screenshot Your Explanation
Example An Example I plotted a pie chart with 3 slices

pie(c(100,50,20),c("Adam","Jack","David"))

(These texts were directly copied from R Console,


and picture was captured using snipping tool)

1 I used R as a calculator to perform basic


arithmetic operations including addition,
multiplication, exponentiation, square
root, and the built-in constant pi.

(Picture was captured using snipping tool)

2 I created variables using the assignment


operator <- and checked their data types
using typeof(). Numeric values are
"double" and text values are "character".

(Picture was captured using snipping tool)


3 I created a data frame with student
information and used [Link]() to find
Eva had the highest score, and
aggregate() to calculate average scores
by gender.

(Picture was captured using snipping tool)


4 I created a bar plot showing student
heights using barplot() with custom
labels, title, and blue color.

Bar plot (c(160, 175, 180, 165, 170), c("Alice",


"Bob", "Charlie", "David", "Eva")

(These texts were directly copied from R Console,


and picture was captured using snipping tool)

5 I plotted a pie chart with 3 slices


representing values for Adam, Jack, and
David using the pie() function.

pie (c(100, 50, 20), c("Adam", "Jack", "David")


(These texts were directly copied from R Console,
and picture was captured using snipping tool)

(These texts were directly copied from R Console,


and picture was captured using snipping tool)
6 I generated 1000 random numbers from
a normal distribution and plotted a
histogram with customized title, labels,
and green color.

[Link](123)
x (rnorm(1000, mean = 50, sd = 10)
hist(x, main = "Random Normal Data", xlab =
"Value", ylab = "Frequency", col = "green")

(These texts were directly copied from R Console,


and picture was captured using snipping tool)
7 I used ggplot2 to create a scatter plot
showing the relationship between car
weight and miles per gallon from the
mtcars dataset.

library(ggplot2)
ggplot(mtcars, aes(x = wt, y = mpg)) +
+ geom_point() +
+ labs(title = "Car Weight vs MPG")

(These texts were directly copied from R Console,


and picture was captured using snipping tool)
8 I created a box plot comparing MPG
across different cylinder counts, with
colors representing automatic vs manual
transmission.

ggplot(mtcars, aes(x = factor(cyl), y = mpg, fill =


factor(am))) +
+ geom_boxplot() +
+ labs(title = "MPG by Cylinder Count and
Transmission",
+ x = "Number of Cylinders",
+ y = "Miles Per Gallon",
+ fill = "Transmission")

(These texts were directly copied from R Console,


and picture was captured using snipping tool)
9 I defined a custom function myMean()
that calculates both mean and standard
deviation, then tested it with numbers
10-50.

(Picture was captured using snipping tool)


10 I used the Biostrings package for DNA
sequence analysis, including reverse
complement, motif counting, and
dinucleotide frequency calculation.

(Picture was captured using snipping tool)


Checking Plagiarism Checking I complete the work on my laptop on
Run the following commands to record your May 19th, 2026.
session and system information. Paste the
returned results here.
sessionInfo()
R version 4.2.3 (2023-03-15)
Platform: x86_64-apple-darwin17.0
(64-bit)
Running under: macOS 26.3

Matrix products: default


LAPACK:
/Library/Frameworks/[Link]/Versi
ons/4.2/Resources/lib/[Link]
b

locale:
[1] en_US.UTF-8/en_US.UTF-
8/en_US.UTF-8/C/en_US.UTF-
8/en_US.UTF-8

attached base packages:


[1] stats4 stats graphics
grDevices utils datasets methods
base

other attached packages:


[1] Biostrings_2.66.0
GenomeInfoDb_1.34.9 XVector_0.38.0
IRanges_2.32.0 S4Vectors_0.36.2
[6] BiocGenerics_0.44.0 ggplot2_4.0.3

loaded via a namespace (and not


attached):
[1] zlibbioc_1.44.0 R6_2.6.1
rlang_1.2.0 tools_4.2.3
grid_4.2.3
[6] gtable_0.3.6 cli_3.6.6
withr_3.0.2
lifecycle_1.0.5 crayon_1.5.3
[11] S7_0.2.2
GenomeInfoDbData_1.2.9
BiocManager_1.30.27
RColorBrewer_1.1-3 farver_2.1.2
[16] vctrs_0.7.3
bitops_1.0-9 RCurl_1.98-
1.18 glue_1.8.1
labeling_0.4.3
[21] compiler_4.2.3
scales_1.4.0

[Link]()
sysname

"Darwin"

release

"25.3.0"

version
"Darwin Kernel Version 25.3.0: Wed
Jan 28 20:53:01 PST 2026; root:xnu-
12377.81.4~5/RELEASE_ARM64_T8103"

nodename

"[Link]"

machine

"x86_64"

login

"root"

user

"rinrithiya"

effective_user

"rinrithiya"

Please note that:


1. The lab report comprises 15% of your final mark in BIO006.
2. You should take at least 10 screen shots of yourself, and ideally those screenshots should cover a
wide range of the lab session. You should take the screenshots yourself and cannot use other
people’s screenshot.
3. Screenshot can be obtained using key combination: “windows + shift + s” (the snipping tool), or
you may also generate screen shot using other methods. You may also copy the texts in the
Console, which may be even easier.
4. Explain the result using your own language.
5. Submit the report in word format to Learning Mall.
Part 2: A short essay on Programming in Life Sciences (40%)

Please briefly introduce how programming has been applied in life sciences. You may want to cover one
or several perspectives listed in the following:

• What is programming? Why it is important?


• What life science problems are usually resolved by programming?
• What are the most popular programming language used in life sciences, and why they are so
popular? What are their advantages compared with other programming languages?
• Future perspective. Will programming be more popular in life science in the future? Why or why
not?
• Anything else you want to discuss.

Please note that:

• This essay comprises 10% of final marks of BIO006


• The essay is up to 400 words including reference. Try emphasizing your own idea.
• You should submit your essay in word format.

Put your writings here:

Programing is the process of writing instructions that computers follow to solve problems. In life science,
it serves as a critical bridge between biological data and mathematical analysis, enabling researchers
datasets far too large for manual handling (Gentleman e al., 2004). In modern biology it is necessary to
generates enormous volumes of data. A single human genome contains approximately 3 billion base
pairs, while RNA-seq experiments can produce millions of reads per sample. Programing automates the
analysis of such data, performs statistical testing, and creates visualizations that reveal biological
patterns. Without computational tools, interpreting this information would be impractical. R Is the most
widely used language in life science and statistical research. It dominates statistical analysis and
visualization through packages like ggplot2 and Bioconductor, which provides over 2000 specialized tools
for genomic data (Huber et al., 2015). R is particularly strong in bioinformatics because of its extensive
statistical functions, cross-platform compatibility, and free open-source nature. If we compared to other
older languages like Perl, R offers superior readability, built-in data visualization capabilities, and a cast
repository of packages specifically designed for biological research. Its integration with R Markdown also
allows researchers to generate reproducible reports combining code, results, and narrative in a single
document. Inn traditional biological research often relied on manual data entry, hand drawn graphs, and
calculator based statistics. These methods were not only time consuming but also highly prone to human
error. A single miscalculation or transcription mistake could invalidate an entire experiment.
Programming eliminates these risks by automating data processing that allows biologist to focus on
interpreting results rather than spending hours on repetitive calculations.
In my opinion, in the future, programming will become increasingly essential in life sciences. Emerging
fields such as single cell sequencing, AI driven drug discovery, and personalized medicine rely heavily on
computational analysis. As data complexity grows, so does the demand for researchers who can write
code. There are a significant increase of universities now that recognize this by requiring programming
training in biological curricula for bio-related student.
In conclusion, programming transforms raw biological data into meaningful insights. For life scientists, it
is no longer an optional skill but a fundamental tool for modern research.

References

Gentleman, R. et al. (2004). Bioconductor: Open software development for computational biology and
bioinformatics. Genome Biology, 5(10), R80.

Huber, W. et al. (2015). Orchestrating high-throughput genomic analysis with Bioconductor. Nature
Methods, 12(2), 115-121.

You might also like