Anna Lorenc
Immunogenomics, Gosia Trynka
al16@sanger.ac.uk
Bioinformatics for immunology
14:30 – 15:30 | Bioinformatics tools and resources for immunology | Anna Lorenc |
15:30 – 16:00 | Networking break | |
16:00 – 18:00 | R/Python intro | Marta Perez-Alcantara, Elena Lukyanova, Anna Lorenc |
genome
Technology
Bioinformatics tools and resources for immunology
transcriptome
proteome
TCRs/BCRs
epitopes
open chromatin
HLA
scRNAseq
scATACseq
CITEseq...
Bulk RNAseq
Bulk proteome
Bulk Chipseq
Flow cytometry
CYTOF
TCR/BCR
bulk/sc
RNA/DNA
Image analysis
Databases and datasets
Reference sequences for HLA/TCR/BCR
Aggregation of experimental datasets
(TCRs, flow cytometry, gene expression)
Topic databases of experimental data (TCR-antigen, antibody-epitope)
Specific experiments
proteome
TCR/BCR
5
VDJdb
ImmuneACCESS
McPass-TCR
TCRdb
iReceptor
VDJserver
OAS
Tools, references
Receptors
(tools + references)
MHC
(references + tools)
TRUST4
arcasHLA
R packages
Immunotation (Convert HLA alleles)
IgGeneUsage(bayesian tests for allele usage)
COMPASS (bayesian test for cell subset differences)
immunarch (CRAN)
Olga
(probability of generation)
TCRdist3
www.scrna-tools.org
github.com/seandavi/awesome-single-cell
R CRAN
Bioconductor
packages, vignettes, workflow examples, past courses, books...
Python
Where to look for help
stackoverflow
Biostars
Bioc list
github
scikit-learn
Scverse
single cell Python packages
Where to look for inspiration
rstats.wtf (also youtube)
Advanced R https://adv-r.hadley.nz/
Package/framework – specific sites
(often github)
Organising tools into workflows:
Shell scripts
Snakemake
Nextflow
Installing & organising tools
Conda (package manager) with thousands of biology relevant packages. Recipes to install ‘complicated’ software
Run a ready docker container – where all the software is already installed. Grab results
What shape?
What slots?
How to put/ access/ change the data in a container?
Input data?
Parameters?
Default values?
Methods implemented?
Type of output?
formatted
data
functions
results
raw data
AnnData <-> SingleCellExperiment<-> Seurat
| SingleCellExperiment | | AnnData | ||||
| R object used by Bioconductor packages��Rows contain features and columns contain cells | | Python object used by Scanpy and related packages��Rows contain observations (cells) and columns contain variables (features) | ||||
IMPLEMENTED | Each element is a matrix of expression values with the same dimensions | SimpleList of matrices | assays | ⇄ | X | Numpy array | Primary matrix of expression data |
layers | Dictionary of arrays | Dictionary-like object where each element is an array of expression values with the same dimensions as X | |||||
Any unstructured data | list | metadata | ⬄ | uns | OrderedDict | Unstructured annotation | |
Names of rows (cells) | vector | colnames | ⇄ | obs_names | Pandas index | Names of observations (cells) | |
Columns describe annotations of the columns (cells) | DataFrame | colData | ⇄ | obs | Pandas DataFrame | One-dimensional annotations of the observations (cells) | |
Each element is a matrix where the number of rows is equal to the number of cells and each column is a dimension | List of matrices | reducedDims | ⇄ | obsm | Dictionary of arrays | Dictionary-like object where each element is an array where the number of rows is equal to the number of observations (cells) | |
Relationships between columns (cells) | List of SelfHits | colPairs | ⇄ | obsp | Dictionary of arrays | Dictionary-like object where each element is a square array containing annotations between observations (cells) | |
Names of rows (features) | vector | rownames | ⇄ | var_names | Pandas index | Names of variables (features) | |
Columns describe annotations of the rows (features) | DataFrame | rowData | ⇄ | vars | Pandas DataFrame | One-dimensional annotations of the variables (features) | |
⇄ | varm | Dictionary of arrays | Dictionary-like object where each element is an array where the number of rows is equal to the number of variables (features) | ||||
Relationships between rows (features) | List of SelfHits | rowPairs | ⇄ | varp | Dictionary of arrays | Dictionary-like object where each element is a square array containing annotations between variables (features) | |
NOT IMPLMENTED | Nested SingleCellExperiments with information about alternative feature sets | List of SingleCellExperiments | altExp | | raw | AnnData | Raw version of X and var prior to any filtering. Is not indexed as part of the object. |
Internal unstructured data that is not meant to be modified by users | list | int_metadata | | | | | |
Internal annotation for columns (cells) that is not meant to be modified by users | DataFrame | int_colData | | | | | |
Internal annotation for rows (features) that is not meant to be modified by users | DataFrame | int_elementMetadata | | | | | |
data in containers
functions
results
data saved for a future analysis
plots
numerical/
tabular results
interactive presentations
your code
raw data
your code
raw data
your code
raw data
data saved for a future analysis
plots
numerical/
tabular results
interactive presentations
Raw data
Document!
For collaborators
For posteriority
For yourself
For publication
#Comment code
Comment choice of methods, parameters
Note software and references versions
Notebooks, markdown files – analysis narrative + code
RProjects
Git (+GitHub) - for version control and as a repository
Structure your working directories
README files
your code
raw data
Working with R projects
Start an Rproject for a project
Rproject <= scientific project
When you reopen an R project
Not recommended
GitHub/GitLab
local machine
online repo
git clone https://github.com/SomeUser/SomeRepo.git
git clone https://github.com/AnnaLorenc/tutorials22.git
Commandline, git managers
RStudio has a version control interface too
time
Git
├── .git
├── .gitignore
├── README
├── analysis
│ ├── R
│ │ ├── 01.summarise_genotypes.Rmd
│ │ └── 02.summarise_expression.Rmd
│ ├── eqtl
│ │ └── 04.tensor_flow
│ └── python
│ └── 03.join_expression_to_genotypes.ipynb
├── doc
│ ├── manuscript.md
│ └── notebook.md
├──external_data
│ ├──DICE_expression�│ └──README
├── raw_data
│ ├── expression
│ ├── genotypes
│ └── meta_data
└── results
├── eqtl_tensor_flow
└── plots
├── README.md
├── analysis
├── cellranger
├── count_tables
├── cytoimmgen-phase-2-env-spec-list.txt
├── jupyter_files
├── logs
├── metadata
├── plots
├── README.md
├── cellDeconvolution
│ ├── genotypingData
│ └── vireoOutput
├── colocalization
│ ├── Biogen_coloc_results
│ ├── README.md
│ ├── coloc_config_file.json
│ ├── colocalizing-snps_pp0.6_immune-traits_pseudobulked-time-points.tsv
│ ├── cytoimmgen_ld_calculations
│ ├── downstream_analysis
│ └── results
├── eQTL_mapping
│ ├── cytoimmgen-phase2-genotypes-rsids-dbSNP-v151-grch38-collapsed.tsv
│ ├── cytoimmgen-phase2-genotypes-rsids-dbSNP-v151-grch38.txt
│ ├── eQTL_catalogue_files
│ ├── eqtl_file_list.txt
│ ├── eqtl_groups_list.txt
│ ├── eqtl_sample_sizes.tsv
│ ├── lead_signals_with_q_value
│ ├── median_expression_file_list.txt
│ └── qtl_number.csv
└── scRNAseq_data_analysis
├── Activation-time-course-CD4-T-cells_farm.Rmd
├── EDA_resting_T_cells.ipynb
├── Effectorness_analysis_resting_CD4_cells.Rmd
.git
.gitignore
raw data
R
python
Shade A, Teal TK (2015) Computing
Workflows for Biologists: A Roadmap. PLoS Biol
Raw data + metadata safely backed up
Considering & trying many possible tools and workflows
Optimising parameters for the tools
Extracted final version of the analysis
Shade A, Teal TK (2015) Computing
Workflows for Biologists: A Roadmap. PLoS Biol
Wilson G, Bryan J, Cranston K, Kitzes J,
Nederbragt L, Teal TK (2017) Good enough
practices in scientific computing
PLoS Comput Biol
Box 1. Summary of practices
....
A lot of biologists suffered when testing essentiality of these rules!
Anna Lorenc
Marta Alcantara
Elena Lukyanova
Immunogenomics, Gosia Trynka
al16@sanger.ac.uk
R, Python intro
Exercise 1
Open exercises description in exercises.html
Activate conda
Start RStudio and navigate to a work directory
Start jupyter notebook
Create directory structure for your work
Exercise 2
Python with jupyter notebook
Exercise 3
tidyverse
Exercise 4
Working out an unknown package
/home/training/Bioinfo-T-Cell-Immunology-July22/Day1/tutorials22
Conda: group2_training_env
Change directory
cd
Display directory content
ls
Make directory DIR
mkdir DIR