Skip to content

Commit a4cc357

Browse files
committed
first commit
0 parents  commit a4cc357

36 files changed

+979
-0
lines changed

.Rbuildignore

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
^.*\.Rproj$
2+
^\.Rproj\.user$
3+
^doc$
4+
^Meta$
5+
^LICENSE\.md$
6+
.github
7+
Dockerfile
8+
_pkgdown.yml
9+
^data-raw$
10+
dev$
11+
CONTRIBUTING.md
12+
^iscb2021tidytranscriptomics\.Rcheck$
13+
^iscb2021tidytranscriptomics.*\.tar\.gz$
14+
^iscb2021tidytranscriptomics.*\.tgz$

.github/workflows/basic_checks.yaml

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
on: [push]
2+
3+
env:
4+
cache-version: v1
5+
repo-name: tidytranscriptomics-workshops/bioc2022_tidytranscriptomics
6+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
7+
8+
jobs:
9+
job1:
10+
runs-on: ubuntu-latest
11+
container: bioconductor/bioconductor_docker:RELEASE_3_14
12+
steps:
13+
- uses: actions/checkout@v1
14+
15+
- name: Query dependencies and update old packages
16+
run: |
17+
# We'll install the specific versions from the install instructions
18+
BiocManager::install("stemangiola/[email protected]")
19+
BiocManager::install("stemangiola/[email protected]")
20+
21+
# Then install the other dependencies in the usual way
22+
BiocManager::install(ask=FALSE)
23+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
24+
shell: Rscript {0}
25+
26+
- name: Cache R packages
27+
if: runner.os != 'Windows'
28+
uses: actions/cache@v1
29+
with:
30+
path: /usr/local/lib/R/site-library
31+
key: ${{ env.cache-version }}-${{ runner.os }}-r-${{ hashFiles('.github/depends.Rds') }}
32+
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-r-
33+
34+
# This lets us augment with additional dependencies
35+
- name: Install system dependencies
36+
if: runner.os == 'Linux'
37+
env:
38+
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
39+
run: |
40+
Rscript -e "remotes::install_github('r-hub/sysreqs')"
41+
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
42+
sudo -s eval "$sysreqs"
43+
44+
- name: Install dependencies
45+
run: |
46+
options(repos = c(CRAN = "https://cran.r-project.org"))
47+
BiocManager::repositories()
48+
remotes::install_deps(dependencies = TRUE, repos = BiocManager::repositories())
49+
remotes::install_cran("rcmdcheck")
50+
shell: Rscript {0}
51+
52+
- name: Check
53+
env:
54+
_R_CHECK_CRAN_INCOMING_REMOTE_: false
55+
run: rcmdcheck::rcmdcheck(args = c("--no-manual"), error_on = "error", check_dir = "check")
56+
shell: Rscript {0}
57+
58+
- name: Build pkgdown
59+
if: github.ref == 'refs/heads/master'
60+
run: |
61+
PATH=$PATH:$HOME/bin/ Rscript -e 'pkgdown::build_site(".")'
62+
63+
# deploy needs rsync? Seems so.
64+
- name: Install deploy dependencies
65+
if: github.ref == 'refs/heads/master'
66+
run: |
67+
apt-get update
68+
apt-get -y install rsync
69+
70+
- name: Deploy 🚀
71+
uses: JamesIves/github-pages-deploy-action@releases/v3
72+
if: github.ref == 'refs/heads/master'
73+
with:
74+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75+
BRANCH: gh-pages # The branch the action should deploy to.
76+
FOLDER: docs # The folder the action should deploy
77+

.gitignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.Rproj.user
2+
doc
3+
Meta
4+
.RData
5+
.Rhistory
6+
*.Rproj
7+
iscb2021tidytranscriptomics.Rcheck/
8+
iscb2021tidytranscriptomics*.tar.gz
9+
iscb2021tidytranscriptomics*.tgz
10+
dev
11+
/doc/
12+
/Meta/

CONTRIBUTING.md

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
Contributing to TidyTranscriptomics Workshop
2+
===
3+
4+
:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:
5+
6+
The following is a set of guidelines for contributing to this training material on GitHub.
7+
8+
# Table of contents
9+
10+
- [What should I know before I get started?](#what-should-i-know-before-i-get-started)
11+
- [How can I contribute?](#how-can-i-contribute)
12+
- [How do I add new content?](#how-do-i-add-new-content)
13+
- [How is the training material maintained?](#how-is-the-training-material-maintained)
14+
15+
# What should I know before I get started?
16+
17+
This repository contains the files for the TidyTranscriptomics workshop.
18+
19+
By contributing, you agree that we may redistribute your work under [this repository's license](LICENSE).
20+
21+
We will address your issues and/or assess your change proposal as promptly as we can.
22+
23+
If you have any questions, you can reach us by creating an [Issue](https://github.com/tidytranscriptomics-workshops/iscb2021_tidytranscriptomics/issues/new/choose) in the workshop repository.
24+
25+
# How can I contribute?
26+
27+
You can report mistakes or errors, add suggestions, additions, updates or improvements for content. Whatever is your background, there is probably a way to do it: via the GitHub website, via command-line. If you feel it is too much, you can even write it with any text editor and contact us: we will work together to integrate it.
28+
29+
# How is the training material maintained?
30+
31+
## Maintainers
32+
33+
The maintainers are listed in the [DESCRIPTION](https://github.com/tidytranscriptomics-workshops/iscb2021_tidytranscriptomics/blob/master/DESCRIPTION) file.
34+
35+
They are responsible for making sure issues and change requests are looked at. They have the final say over what is included in the training material.
36+
37+
## Labels
38+
39+
This repository is using the following labels for issues, pull requests and project management:
40+
41+
- Type
42+
- `bug`: errors to be fixed
43+
- `improvement`: enhancement to an existing functionality
44+
- `feature`: new functionality
45+
- `discussion`: discussion threads
46+
- `question`: often turn into discussion threads
47+
- Status
48+
- `help-wanted`: requests for assistance
49+
- `newcomer-friendly`: suitable for people who want to start contributing
50+
- `work-in-progress`: someone is working on this
51+
- `review-needed`: requests for review

DESCRIPTION

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
Package: bioc2022tidytranscriptomics
2+
Title: Introduction to Tidy Transcriptomics
3+
Version: 0.12.0
4+
Authors@R: c(
5+
person("Maria", "Doyle", email="[email protected]",
6+
role = c("aut"),
7+
comment = c(ORCID = "0000-0003-4847-8436")),
8+
person("Stefano", "Mangiola", email="[email protected]",
9+
role = c("aut","cre"),
10+
comment = c(ORCID = "0000-0001-7474-836X")))
11+
Maintainer: Maria Doyle <[email protected]>, Stefano Mangiola <[email protected]>
12+
Description: This workshop will present how to perform analysis of RNA sequencing data following the tidy data paradigm, using the tidyseurat, tidySingleCellExperiment and tidyverse packages.
13+
License: CC BY-SA 4.0 + file LICENSE
14+
Encoding: UTF-8
15+
LazyData: true
16+
Roxygen: list(markdown = TRUE)
17+
RoxygenNote: 7.1.2
18+
Depends:
19+
R (>= 4.0.0)
20+
Imports:
21+
tidySingleCellExperiment,
22+
tidyseurat,
23+
tidygate,
24+
Seurat,
25+
SeuratWrappers,
26+
stats,
27+
utils,
28+
tibble,
29+
stringr,
30+
ggplot2,
31+
dplyr,
32+
readr,
33+
tidyr,
34+
purrr,
35+
forcats,
36+
ggrepel,
37+
plotly,
38+
uwot,
39+
igraph,
40+
broom,
41+
devtools,
42+
rlang,
43+
magrittr,
44+
R.utils,
45+
dittoSeq
46+
Suggests:
47+
knitr,
48+
rmarkdown,
49+
pkgdown
50+
Remotes: satijalab/seurat-wrappers
51+
Biarch: true
52+
biocViews: RNASeq, DifferentialExpression, GeneExpression, Normalization, Clustering, QualityControl, Sequencing, SingleCell, Transcription, Transcriptomics
53+
URL: https://tidytranscriptomics-workshops.github.io/bioc2022_tidytranscriptomics/
54+
BugReports: https://github.com/tidytranscriptomics-workshops/bioc2022_tidytranscriptomics/issues/new/choose
55+
VignetteBuilder: knitr

LICENSE

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Copyright 2020 Maria Doyle and Stefano Mangiola
2+
3+
This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit https://creativecommons.org/licenses/by-sa/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.

NAMESPACE

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Generated by roxygen2: do not edit by hand
2+

R/data.R

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#'"seurat_obj"
2+
#'
3+
#' A Seurat dataset of single cell RNA sequencing data
4+
#'
5+
#'
6+
#' @format A Seurat object.
7+
#' @usage data(seurat_obj)
8+
"seurat_obj"
9+
10+
#' gate_seurat_obj
11+
#'
12+
#' Coordinates for a gate interactively drawn using tidygate
13+
#'
14+
#'
15+
#' @format A list containing x,y coordinates for one gate
16+
#' @usage data(gate_seurat_obj)
17+
"gate_seurat_obj"
18+
19+
20+
#' seurat_obj_UMAP3
21+
#'
22+
#' A Seurat dataset of single cell RNA sequencing data with 3 UMAP dimesions
23+
#'
24+
#'
25+
#' @format A Seurat object.
26+
#' @usage data(seurat_obj_UMAP3)
27+
"seurat_obj_UMAP3"

README.md

+98
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
<!-- badges: start -->
2+
[![DOI](https://zenodo.org/badge/379767139.svg)](https://zenodo.org/badge/latestdoi/379767139)
3+
[![.github/workflows/basic_checks.yaml](https://github.com/tidytranscriptomics-workshops/iscb2021_tidytranscriptomics/workflows/.github/workflows/basic_checks.yaml/badge.svg)](https://github.com/tidytranscriptomics-workshops/iscb2021_tidytranscriptomics/actions)
4+
<!-- badges: end -->
5+
6+
# Introduction to Tidy Transcriptomics
7+
<p float="left">
8+
<img height="100" width="300" alt="iscbacademy" src="man/figures/ISCBacademy.png"/>
9+
<img height="100" alt="tidybulk" src="https://github.com/Bioconductor/BiocStickers/blob/master/tidybulk/tidybulk.png?raw=true"/>
10+
</p>
11+
12+
## Instructor names and contact information
13+
14+
* Maria Doyle <Maria.Doyle at petermac.org>
15+
* Stefano Mangiola <mangiola.s at wehi.edu.au>
16+
17+
## Syllabus
18+
19+
Material [web page](https://tidytranscriptomics-workshops.github.io/bioc2022_tidytranscriptomics/articles/tidytranscriptomics_case_study.html).
20+
21+
More details on the workshop are below.
22+
23+
## Workshop package installation
24+
25+
For the bioc2022 workshop, an RStudio in the cloud will be provided with everything installed, all that participants will need is a web browser.
26+
27+
If you want to install the packages and material post-workshop, the instructions are below. The workshop is designed for R `4.1` and Bioconductor 3.14.
28+
29+
```
30+
#install.packages('remotes')
31+
32+
# Need to set this to prevent installation erroring due to even tiny warnings, similar to here: https://github.com/r-lib/remotes/issues/403#issuecomment-748181946
33+
Sys.setenv("R_REMOTES_NO_ERRORS_FROM_WARNINGS" = "true")
34+
35+
# Install same versions used in the workshop
36+
remotes::install_github(c("stemangiola/[email protected]", "stemangiola/[email protected]"))
37+
38+
# Install workshop package
39+
40+
remotes::install_github("tidytranscriptomics-workshops/bioc2022_tidytranscriptomics", build_vignettes = TRUE)
41+
42+
# To view vignettes
43+
library(bioc2022tidytranscriptomics)
44+
browseVignettes("bioc2022tidytranscriptomics")
45+
```
46+
47+
To run the code, you could then copy and paste the code from the workshop vignette or [R markdown file](https://raw.githubusercontent.com/tidytranscriptomics-workshops/bioc2022_tidytranscriptomics/master/vignettes/tidytranscriptomics.Rmd) into a new R Markdown file on your computer.
48+
49+
## Workshop Description
50+
51+
This tutorial will present how to perform analysis of single-cell RNA sequencing data following the tidy data paradigm. The tidy data paradigm provides a standard way to organise data values within a dataset, where each variable is a column, each observation is a row, and data is manipulated using an easy-to-understand vocabulary. Most importantly, the data structure remains consistent across manipulation and analysis functions.
52+
53+
This can be achieved with the integration of packages present in the R CRAN and Bioconductor ecosystem, including [tidyseurat](https://stemangiola.github.io/tidyseurat/), [tidySingleCellExperiment](https://stemangiola.github.io/tidySingleCellExperiment/) and [tidyverse](https://www.tidyverse.org/). These packages are part of the tidytranscriptomics suite that introduces a tidy approach to RNA sequencing data representation and analysis. For more information see the [tidy transcriptomics blog](https://stemangiola.github.io/tidytranscriptomics/).
54+
55+
### Pre-requisites
56+
57+
* Basic familiarity with single cell transcriptomic analyses
58+
* Basic familiarity with tidyverse
59+
60+
61+
### Workshop Participation
62+
63+
The workshop format is a 2 hour session consisting of hands-on demos, exercises and Q&A.
64+
65+
### _R_ / _Bioconductor_ packages used
66+
67+
* tidyseurat
68+
* tidySingleCellExperiment
69+
* org.Hs.eg.db
70+
* ggrepel
71+
* GGally
72+
* plotly
73+
74+
75+
76+
### Workshop goals and objectives
77+
78+
In exploring and analysing RNA sequencing data, there are a number of key concepts, such as filtering, scaling, dimensionality reduction, hypothesis testing, clustering and visualisation, that need to be understood. These concepts can be intuitively explained to new users, however, (i) the use of a heterogeneous vocabulary and jargon by methodologies/algorithms/packages, (ii) the complexity of data wrangling, and (iii) the coding burden, impede effective learning of the statistics and biology underlying an informed RNA sequencing analysis.
79+
80+
The tidytranscriptomics approach to RNA sequencing data analysis abstracts out the coding-related complexity and provides tools that use an intuitive and jargon-free vocabulary, enabling focus on the statistical and biological challenges.
81+
82+
#### Learning goals
83+
84+
* To approach data representation and analysis though a tidy data paradigm, integrating tidyverse with tidyseurat, tidySingleCellExperiment and tidyHeatmap.
85+
86+
#### What you will learn
87+
88+
* Basic tidy operations possible with tidyseurat and tidySingleCellExperiment
89+
* The differences between Seurat and SingleCellExperiment representation, and tidy representation
90+
* How to interface Seurat and SingleCellExperiment with tidy manipulation and visualisation
91+
* A real-world case study that will showcase the power of tidy single-cell methods compared with base/ad-hoc methods
92+
93+
#### What you will not learn
94+
95+
* The molecular technology of single-cell sequencing
96+
* The fundamentals of single-cell data analysis
97+
* The fundamentals of tidy data analysis
98+

_pkgdown.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
url: https://tidytranscriptomics-workshops.github.io/iscb2021_tidytranscriptomics
2+
3+
template:
4+
params:
5+
bootswatch: flatly
6+
ganalytics: UA-93043521-1
7+
8+
home:
9+
title: "TidyTranscriptomics"
10+
type: inverse
11+
12+
toc:
13+
depth: 4
14+
15+
navbar:
16+
title: ~
17+
type: default
18+
left:
19+
- text: Workshop
20+
href: articles/tidytranscriptomics_case_study.html
21+
22+
right:
23+
- icon: fab fa-github
24+
href: https://github.com/tidytranscriptomics-workshops/bioc2022_tidytranscriptomics
25+

data-raw/seurat_obj.R

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
seurat_obj <- readRDS("/stornext/Bioinf/data/bioinf-data/Papenfuss_lab/projects/mangiola.s/PostDoc/oligo_breast/expanded_analyses_with_control/cancer_only_analyses/lymphoid/cancer_lymphoid_cell_type_curated.rds")
2+
3+
seurat_obj = seurat_obj |> RunPCA() |> select(-contains("UMAP")) |> RunUMAP(dims=1:20)
4+
seurat_obj = seurat_obj |> select(cell, file, 3, 8, 9,S.Score, G2M.Score , Phase , curated_cell_type , contains("UMAP"))
5+
seurat_obj = seurat_obj %>% filter(.cell %in% (seurat_obj %>% sample_frac(0.5) %>% pull(.cell) %>% c(seurat_obj %>% filter(grepl("Delta", curated_cell_type)) %>% pull(.cell)) %>% unique))
6+
seurat_obj = seurat_obj[VariableFeatures(seurat_obj),]
7+
seurat_obj[["SCT"]]@scale.data = seurat_obj[["SCT"]]@scale.data[c("CD3D", "TRDC", "TRGC1", "TRGC2", "CD8A", "CD8B"),]
8+
seurat_obj[["SCT"]]@data = seurat_obj[["SCT"]]@data[c("CD3D", "TRDC", "TRGC1", "TRGC2", "CD8A", "CD8B"),]
9+
DefaultAssay(seurat_obj) = "SCT"
10+
seurat_obj[["integrated"]] = NULL
11+
save(seurat_obj , file="data/seurat_obj.rda", compress = "xz")

0 commit comments

Comments
 (0)