This repository contains a cleaned and reproducible R workflow for comparing bulk RNA-seq expression profiles from brain, lung, and skin GTEx samples. The analysis uses recount/recount3 data structures and edgeR for filtering, TMM normalisation, multidimensional scaling, quasi-likelihood differential expression, tissue-specific gene identification, and marker validation.
- Reconstruction of read counts from recount objects.
- Calculation of TPM and CPM expression values.
- Sample-level QC using RIN, library size, mapping rate, rRNA fraction, and mitochondrial read percentage.
- Removal of mitochondrial/non-canonical chromosomes and short-RNA features.
- Selection of three manually reviewed samples per tissue.
- Low-expression filtering with
filterByExpr. - TMM library-size normalisation.
- MDS evaluation of tissue separation and possible QC-related effects.
- Pairwise edgeR quasi-likelihood tests:
- Lung vs Brain
- Skin vs Brain
- Skin vs Lung
- Identification of genes consistently upregulated in each tissue relative to both other tissues.
- TPM-based validation of TTBK1, VSTM2B, TBX4, and HOXC10.
The RDS files are not included because they can be large and may be subject to course or data-distribution restrictions.
From the repository root, run:
Rscript install_packages.RRscript analysis/run_analysis.RThe selected sample indices and statistical thresholds can be changed in
config/config.R.
- FDR:
< 0.01 - Absolute log2 fold change:
> 1
A gene is labelled tissue-specific and upregulated only when it passes both thresholds in comparisons with each of the other two tissues.
- Removed repeated package installation and repeated TPM calculations.
- Replaced absolute Windows paths with project-relative paths.
- Consolidated repeated brain/lung/skin processing into reusable functions.
- Replaced hard-coded gene row numbers with gene-name lookup.
- Kept continuous QC variables numeric instead of converting them to factors.
- Removed duplicated MDS code and empty blocks.
- Corrected extraction and ranking of edgeR result tables.
- Added automatic output folders, descriptive file names, and session details.
- Preserved the original script under
legacy/for full traceability.
The sample choices in config/config.R reproduce the manual selections in the
original analysis. They should be re-evaluated if different recount objects or
sample orders are used.