knitr::opts_chunk$set(echo = FALSE) library(tidyverse) library(knitr)
You will be using the scRNAseq
dataset to answer all the following questions
Add your answers (text and/or code chunks as required) in the space after each question
The scRNAseq
dataset can be found in the scRNAseq package. To load it, run the following
devtools::install_github("devangthakkar/scRNAseq") library(scRNAseq)
What type of object is cell_1
?
Filter the dataset to only include genes that are specifically expressed in the brain or in the heart and assign it to a new dataset organ_data
. How many genes does organ_data
have?
Using the organ_data
dataset, select the following columns - gene_name
, organ
, and any column with the word cell
in the column name. Store the result into a new dataset filtered_data
. How many columns does filtered_data
have?
Sort the filtered_data
dataset from Z to A based on gene_name
. Store the result into a new dataset sorted_data
.
Using the sorted_data
dataset, we now want to look at what organ does cell_1
originate from. Group the data set by the organ
, and summarize the mean counts for cell_1
BONUS: Identify the origin to which all the 10 cells belong. You will need to use the across
functionality to select all columns that contain the word cell
. Check out the documentation here: https://dplyr.tidyverse.org/reference/across.html
# filtered_data %>% group_by(organ) %>% summarise(across(contains("cell"), mean))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.