Modular, reproducible Python CLI tools designed for bulk RNA-seq data processing:
- Pre- and post-trimming quality audit reporting from MultiQC JSON
- Read synchronization and pair integrity validation
- GENCODE annotation parsing and biotype composition analysis
- Public cohort downloading and tissue-specific subsetting from UCSC Xena Toil
- Publication-quality supplementary table generation
.
├── 01_qc_and_trimming_audits/
│ ├── qc_audit.py # Pre-trimming FastQC metrics & flag reporter
│ ├── post_trim_qc_audit.py # Post-trimming QC & read retention auditor
│ └── validate_pe.py # Paired-end FASTQ read integrity validator
├── 02_biotype_and_matrix_qc/
│ └── biotype_audit.py # Reference biotype mapping & matrix stratification
├── 03_external_cohort_subsetting/
│ └── fetch_and_subset_xena_toil.py # Multi-tissue UCSC Xena Toil cohort subsetter
├── 04_supplementary_table_builders/
│ ├── make_supp_table_s1.py # Supplementary Table S1 builder (Pre-trim QC)
│ └── make_supp_table_s2.py # Supplementary Table S2 builder (Post-trim QC)
├── requirements.txt # Python library dependencies
├── LICENSE # MIT License
└── README.md # Documentation and CLI usage guide
git clone https://github.com/Silico-Notes/python_scripts.git
cd python_scripts
# Optional: set up a virtual environment
python3 -m venv .venv
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txtAudit raw FastQC data from MultiQC outputs:
python3 01_qc_and_trimming_audits/qc_audit.py \
--input ./results/01_multiqc_raw/multiqc_raw_report_data/multiqc_data.json \
--table-format markdownAudit trimmed reads and calculate retention percentages:
python3 01_qc_and_trimming_audits/post_trim_qc_audit.py \
--input ./results/02_multiqc_trimmed/multiqc_trimmed_report_data/multiqc_data.json \
--raw-json ./results/01_multiqc_raw/multiqc_raw_report_data/multiqc_data.jsonVerify pair synchronization between forward and reverse FASTQ files:
python3 01_qc_and_trimming_audits/validate_pe.py \
./data/SAMPLE_01_R1.fq.gz \
./data/SAMPLE_01_R2.fq.gz \
--expected-pairs 25000000Map count matrices to GENCODE biotypes:
python3 02_biotype_and_matrix_qc/biotype_audit.py \
--gtf ./reference/annotation.gtf \
--counts ./results/stringtie_quant/matrices/gene_count_matrix.csv \
--tpm ./results/stringtie_quant/matrices/gene_tpm_matrix.tsv \
--metadata ./data/samplesheet.csv \
--outdir ./results/pre_de_audit/tablesDownload and subset TCGA + GTEx Toil matrices for any organ or tumor type:
python3 03_external_cohort_subsetting/fetch_and_subset_xena_toil.py \
--cache-dir ./external_validation/tcga_gtex_toil \
--primary-site Breast \
--cancer-code BRCAGenerate formatted CSV tables for publication:
# Pre-trimming QC summary
python3 04_supplementary_table_builders/make_supp_table_s1.py \
--input ./results/01_multiqc_raw/multiqc_raw_report_data/multiqc_data.json \
--output ./results/summary_tables/Supplementary_Table_S1_PreTrim_QC.csv
# Post-trimming QC summary
python3 04_supplementary_table_builders/make_supp_table_s2.py \
--input ./results/02_multiqc_trimmed/multiqc_trimmed_report_data/multiqc_data.json \
--output ./results/summary_tables/Supplementary_Table_S2_PostTrim_QC.csv