<- read.table(
expr_data file = "../exos_data/read-counts.csv", # replace the path with your own
header = TRUE, sep = ",", row.names = 1
)
Week 3 - Homework
week03
homework
Write your code directly in a Quarto document.
To create a Quarto document: go to File -> New File -> Quarto Document, then click Create.
- Create a matrix of two columns to store numbers 1 to 8, use the
dimnames
parameter of thematrix
function to name the rows and columns directly. (see?matrix
) (You can name the rows/columns whatever you want.)
Use the following code to import the file “read-counts.csv” (you have already downloaded it for the hand-on examples of week01). Name the imported data expr_data
.
- Create a list
info_expr
to store information aboutexpr_data
:
- “col_names”: column names
- “row_names”: row names
- “dimension”: number of rows and columns
- “sum_sample”: the sum of expression level across all genes for each sample
- “avg_gene”: the average expression level across all samples for each gene
- Calculate the median of the average gene expression levels across all samples.
- Use
summary()
to generate summary statistics of the sum of expression level across all genes.
- Calculate the log2 fold change of the gene TOS6 for the WT and RRP6 samples. Is TOS6 up or down-regulated in the RRP6 samples compared to WT?
- Perform a Wilcoxon test to check if the TOS6 expression is different between WT and RRP6 samples.
- Store the test results in a variable (object) called
res_wilcox
. What is the data structure of the results? Extract the p-value from the results. - Use \(\alpha = 0.05\), what is your conclusion?
- Visualize the expression level of TOS6 for WT and RRP6 samples using boxplot.
- Click “Render” to generate your Quarto report.
The homework correction is available here: link