CoolFace
Apppublic

somiya-khan01/tcga_dashboard_cancer_analysis

sourceHugging Faceupdated 4mo agoView on Hugging Face
0likes
App README

🧬 TCGA Breast Cancer RNA-Seq Dashboard

Interactive Streamlit dashboard for exploring DESeq2 differential expression results from TCGA-BRCA data.


⚑ Quickstart

bash
# 1. Clone / copy your project folder
cd tcga_dashboard

# 2. Create and activate a virtual environment (recommended)
python -m venv venv
source venv/bin/activate          # Mac / Linux
# venv\Scripts\activate           # Windows

# 3. Install dependencies
pip install -r requirements.txt

# 4. Launch the dashboard
streamlit run app.py

The app opens automatically at http://localhost:8501


πŸ“ Required Input Files

Upload these three CSV files via the sidebar in the app.


1. deseq2_results.csv β€” DESeq2 output

Export from R with:

r
write.csv(as.data.frame(res_ordered), "deseq2_results.csv", quote = FALSE)

Expected columns (DESeq2 standard output):

ColumnDescription
(row names)Gene symbol or Ensembl ID
baseMeanMean normalized count across all samples
log2FoldChangelogβ‚‚(Tumor / Normal)
lfcSEStandard error of log2FC
statWald statistic
pvalueRaw p-value
padjBH-adjusted p-value ← required
The first column becomes gene after import. Make sure row names are gene IDs.

2. normalized_counts.csv β€” Normalized count matrix

Export from R with:

r
norm_counts <- counts(dds, normalized = TRUE)
write.csv(norm_counts, "normalized_counts.csv", quote = FALSE)

Expected format:

*(gene)*TCGA-A1-01TCGA-A2-01…
BRCA1142.398.7…
TP5367.1201.4…
  • β€”Rows = genes (row names are gene IDs)
  • β€”Columns = sample IDs (must match metadata index)

3. sample_metadata.csv β€” Sample condition labels

Export from R with:

r
write.csv(sample_info, "sample_metadata.csv", quote = FALSE)

Expected format:

*(sample)*condition
TCGA-A1-01Tumor
TCGA-A1-11Normal
  • β€”Row names = sample IDs (must match counts matrix column names)
  • β€”`condition` column = "Tumor" or "Normal"

πŸ–₯️ Dashboard Sections

TabDescription
🏠 HomeProject overview, dataset stats, pipeline summary
πŸ“Š Data OverviewSample counts, metadata table, expression preview
πŸ”΅ PCA AnalysisInteractive PCA plot, variance explained
πŸ“‹ Differential ExpressionFilterable DEG table with up/down coloring
πŸŒ‹ Volcano PlotInteractive volcano with threshold lines
πŸ—ΊοΈ HeatmapZ-score heatmap of top N DE genes
πŸ† Top GenesTop 20 up/downregulated + gene search
πŸ§ͺ Biological InterpretationPathway and biomarker context
⬇️ DownloadsExport DESeq2 results, top genes, PCA coords

πŸ› οΈ Dependencies

PackageVersionPurpose
streamlitβ‰₯ 1.32Dashboard framework
pandasβ‰₯ 2.0Data handling
numpyβ‰₯ 1.26Numerical operations
plotlyβ‰₯ 5.20Interactive visualizations
scikit-learnβ‰₯ 1.4PCA computation

πŸ”§ Troubleshooting

Heatmap shows no genes β†’ Gene IDs in DESeq2 results and counts matrix must match exactly (both Ensembl IDs, or both gene symbols).

PCA shows "No matching samples" β†’ Column names in normalized_counts.csv must exactly match row names in sample_metadata.csv.

Slow performance on large counts matrices β†’ Pre-filter to the top 5,000 most variable genes before export, or subsample columns to the 100 samples analyzed.


Dashboard built with Streamlit Β· Plotly Β· scikit-learn