Restructure code/analysis/ into scRNA-seq_code/ and Bulk-code/ subdirectories
Browse filesFiles changed (13)
- code/README.md+45-10
- code/bulk_counts.R → code/analysis/Bulk-code/bulk_counts.RRenamed
- code/analysis/bulk_geo.R → code/analysis/Bulk-code/bulk_geo.RRenamed
- code/analysis/bulk_tcga.R → code/analysis/Bulk-code/bulk_tcga.RRenamed
- code/analysis/README.md+76-23
- code/annotate_single.R → code/analysis/scRNA-seq_code/annotate_single.RRenamed
- code/analysis/doublets.py → code/analysis/scRNA-seq_code/doublets.pyRenamed
- code/analysis/format_deg.R → code/analysis/scRNA-seq_code/format_deg.RRenamed
- code/analysis/format_enrichment.R → code/analysis/scRNA-seq_code/format_enrichment.RRenamed
- code/analysis/format_gene_sctype.R → code/analysis/scRNA-seq_code/format_gene_sctype.RRenamed
- code/analysis/format_gene_singler.R → code/analysis/scRNA-seq_code/format_gene_singler.RRenamed
- code/analysis/single_cell.R → code/analysis/scRNA-seq_code/single_cell.RRenamed
- code/single_cell_analysis.R → code/analysis/scRNA-seq_code/single_cell_analysis.RRenamed
12345678912 unmodified lines222324252627282930313233343527 unmodified lines636465666768# P2M.db Analysis Code- `analysis/`: complete original analysis scripts, documentation and MIT license.- [validation/](validation/): matrix QC, five-cohort annotation comparisons, marker checks and manuscript figures.- [validation/parameters.csv](validation/parameters.csv): shared workflow settings; recorded accession-specific settings remain in each dataset directory.- `read_data.R`: example for reading expression data and specimen metadata.## Read the data12 unmodified lines## Analysis scripts`single_cell_analysis.R` contains the pipeline for the added single-cell cohorts.`bulk_counts.R` handles the added bulk count matrices. These current scripts areseparate from the archived workflow in `analysis/`.`analysis/single_cell.R` and `analysis/doublets.py` contain the single-cell pipeline.`analysis/bulk_geo.R` and `analysis/bulk_tcga.R` contain the bulk pipelines.`analysis/format_deg.R`, `analysis/format_enrichment.R`, `analysis/format_gene_singler.R` and`analysis/format_gene_sctype.R` prepare analysis outputs.Source: https://github.com/bigdata-lrkai/P2M.RcodeCommit: `11530593102b06d74ad7199a940adcbb234015f1`.27 unmodified linesKaplan-Meier curves use a median expression split and a log-rank test.The current survival workflow is in[`code/validation/survival/`](code/validation/survival/). GEO survival files retaintheir source-specific endpoints and historical subsets; the TCGA update does notassert that those GEO analyses were reproduced.123456789101112 unmodified lines242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697027 unmodified lines9899100101102103# P2M.db Analysis Code- `analysis/`: complete analysis scripts partitioned into `scRNA-seq_code/` and `Bulk-code/`, documentation and MIT license.- [validation/](validation/): matrix QC, five-cohort annotation comparisons, marker checks and manuscript figures.- [validation/parameters.csv](validation/parameters.csv): shared workflow settings; recorded accession-specific settings remain in each dataset directory.- `read_data.R`: example for reading expression data and specimen metadata.- `parameters.py`: general formatter for processing_parameters.csv parameter group tables.- `export_expression.R`: general export utility for RDS expression matrices and metadata.## Read the data12 unmodified lines## Analysis scriptsAnalysis pipelines are partitioned into dedicated subdirectories under `analysis/`:### Single-cell RNA-seq scripts (`analysis/scRNA-seq_code/`)All single-cell analysis and downstream formatting scripts are organized under `code/analysis/scRNA-seq_code/`:- `single_cell.R`: original single-cell pipeline (QC, normalization, Harmony integration, SingleR annotation, CellChat, Monocle3, clusterProfiler).- `single_cell_analysis.R`: multi-stage comparative analysis pipeline for added single-cell cohorts.```shRscript code/analysis/scRNA-seq_code/single_cell_analysis.R GSE203067 prepare```- `annotate_single.R`: automated and reference-based cell annotation using SingleR and scType marker scoring.```shRscript code/analysis/scRNA-seq_code/annotate_single.R GSE203067```- `doublets.py`: DoubletDetection wrapper script for identifying doublet cells.```shpython code/analysis/scRNA-seq_code/doublets.py```- `format_deg.R`: cell-type differential expression table formatting.- `format_enrichment.R`: cell-type functional enrichment table formatting.- `format_gene_singler.R`: SingleR cell-type marker expression matrix formatting.- `format_gene_sctype.R`: scType cell-type marker expression matrix formatting.### Bulk transcriptome scripts (`analysis/Bulk-code/`)All bulk transcriptome analysis and preprocessing pipelines are organized under `code/analysis/Bulk-code/`:- `bulk_geo.R`: bulk GEO microarray and RNA-seq analysis pipeline (limma, GEOquery).- `bulk_tcga.R`: bulk TCGA pan-cancer primary-versus-metastasis processing pipeline.- `bulk_counts.R`: author count matrix ingestion, QC, and packaging into standardized RDS objects.```shRscript code/analysis/Bulk-code/bulk_counts.R INPUT_DIR OUTPUT_DIR GSE317536 package```### General utilities (top-level `code/`)Top-level general dataset utilities, shared databases, and benchmark code remain at the `code/` root:- `read_data.R`: example for reading expression matrices and specimen metadata.- `parameters.py`: parameter table group formatter.- `export_expression.R`: expression matrix export utility.```shRscript code/export_expression.R scRNA-seq/GSE264205/GSE264205.rds OUTPUT_DIR```- `resources/`: reference gene sets and marker databases.- `validation/`: benchmark validation, quality control, and paper figure code.Source: https://github.com/bigdata-lrkai/P2M.RcodeCommit: `11530593102b06d74ad7199a940adcbb234015f1`.27 unmodified linesKaplan-Meier curves use a median expression split and a log-rank test.The current survival workflow is in[`validation/survival/`](validation/survival/). GEO survival files retaintheir source-specific endpoints and historical subsets; the TCGA update does notassert that those GEO analyses were reproduced.
123456789101112131415161718192021222324252627282930313233343536373839# Code used to perform online analysis at P2M.db###### P2M.db is equipped with 13 online analysis tools designed to characterize the differences between primary and metastatic tumors.* Among these tools are eight methodologies based on **scRNA-seq data**, including differential gene expression analysis, cell interaction analysis, cell trajectory analysis, and cell functional state analysis.* Additionally, there are five tools focused on **bulk data**, such as protein interaction analysis, immune cell infiltration analysis, and survival analysis.* Enhanced with visualization plugins like Echarts, Highcharts, and Plotly, **our database provides users with an immersive visual interface, facilitating data exploration and interpretation.**###### We provide all the original code used for online analysis. Here is a detailed introduction to the online analysis tools supported by P2M.db.---<img src="md/Figure 3.jpg" alt="Figure 3" style="zoom:80%;" align="left"/>**The detailed functions of the online tool for scRNA-seq data are described as follows**1. ***Data Characteristics*.** This function shows the difference in the number of counts, the number of genes, and the percent of mitochondrial genes detected between the primary and metastatic samples, which can reflect the quality of the current data to a certain extent.2. ***Cell Cluster and Cell type*.** This function demonstrates the difference between cell types in primary and metastatic samples, as well as the distribution and number of various cell types in two-dimensional space.3. ***Differentially Expressed Genes*.** This function calculates significantly differentially expressed genes between primary and metastatic samples, including analysis of primary vs. metastasis as a whole and for each cell type individually.4. ***Functional Characteristics*.** Functional enrichment analysis of differentially expressed genes in different cell types between primary and metastasis.5. ***Cell Interaction Characteristics*.** Compare the difference in cell interaction by describing the cell interaction relationship in primary and metastasis.6. ***Cell Trajectory Analysis*.** Comparison of cell differentiation characteristics between primary and metastatic sites by cell trajectory analysis.7. ***Gene Characteristics*.** This function shows the proportion and means of expression of genes with a high coefficient of variation in primary and metastasis.8. ***Cell Functional State*.** Compare the differences in 18 cellular functional states, including G1/S, G2/M, M/G1, Angiogenesis, Differentiation, DNA damage, DNA repair, EMT, Hypoxia, Invasion, Metastasis, Proliferation, Quiescence, and Stemness, between primary and metastatic sites.---<img src="md/Figure 4.jpg" alt="Figure 4" style="zoom:80%;" align="left"/>**The detailed functions of the online tool for bulk data are described as follows**1. ***Differentially Expressed Genes*.** This function calculates significantly differentially expressed genes between primary and metastatic samples, including analysis of primary vs. metastasis as a whole and for each cell type individually.2. ***Functional Characteristics*.** Functional enrichment analysis of differentially expressed genes in different cell types between primary and metastasis.3. ***Protein-protein Interaction*.** Comparing the differences in protein interactions between primary and metastatic samples through protein interaction analysis4. ***Immune Infiltration Analysis*.** Comparing the difference in immune cell proportion between primary and metastatic samples through immune infiltration analysis5. ***Survival Analysis*.** Comparing the effects of different genes on the survival status of primary and metastatic samples1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192# P2M.db Analysis PipelinesThis directory contains the computational analysis pipelines and downstream formatting utilities used in P2M.db to characterize differences between primary and metastatic tumors.The scripts are organized into dedicated subdirectories for single-cell and bulk transcriptome analyses:```code/analysis/├── scRNA-seq_code/ # Single-cell RNA-seq pipelines and formatting scripts├── Bulk-code/ # Bulk transcriptome processing and analysis pipelines├── LICENSE # MIT license└── README.md # Directory documentation```---## 1. Single-cell RNA-seq Scripts (`scRNA-seq_code/`)The `scRNA-seq_code/` directory contains 8 scripts supporting single-cell quality control, preprocessing, integration, comparative analysis, cell annotation, and downstream formatting:| Script | Purpose || --- | --- || `single_cell.R` | Original single-cell analysis pipeline: raw count ingestion, Seurat QC (nFeature, nCount, percent.mt), Harmony integration, SingleR annotation, CellChat communication, Monocle3 pseudotime trajectories, and clusterProfiler enrichment. || `single_cell_analysis.R` | Multi-stage comparative analysis pipeline for added single-cell cohorts across primary and metastatic sites (`prepare`, `gc`, `deg`, `fe`, `ci`, `cs`, `ct`, `release`). || `annotate_single.R` | Automated, reference-based cell annotation using SingleR and scType marker scoring without altering source expression. || `doublets.py` | DoubletDetection wrapper script identifying potential cell doublets on count matrices. || `format_deg.R` | Cell-type differential expression table formatting across primary and metastatic comparisons. || `format_enrichment.R` | Cell-type functional enrichment table formatting for GO terms and KEGG pathways. || `format_gene_singler.R` | Formats SingleR cell-type marker expression matrices. || `format_gene_sctype.R` | Formats scType cell-type marker expression matrices. |### Runnable Examples- **Cohort preparation and multi-stage analysis:**```sh# Run preparation stage (Seurat 5, Harmony)Rscript code/analysis/scRNA-seq_code/single_cell_analysis.R GSE203067 prepare# Run differential expression analysisRscript code/analysis/scRNA-seq_code/single_cell_analysis.R GSE203067 deg```- **Automated cell annotation:**```shRscript code/analysis/scRNA-seq_code/annotate_single.R GSE203067```- **Doublet detection:**```shpython code/analysis/scRNA-seq_code/doublets.py```---## 2. Bulk Transcriptome Scripts (`Bulk-code/`)The `Bulk-code/` directory contains 3 scripts supporting bulk microarray, RNA-seq, and count matrix processing:| Script | Purpose || --- | --- || `bulk_geo.R` | Bulk GEO microarray and RNA-seq pipeline: series download, platform annotation, limma differential expression, and downstream formatting. || `bulk_tcga.R` | Bulk TCGA pan-cancer primary-versus-metastasis processing pipeline for 21 tumor types. || `bulk_counts.R` | Author raw count matrix ingestion, QC validation, and packaging into standardized RDS containers. |### Runnable Examples- **Count matrix packaging and analysis:**```sh# Ingest author counts and create standardized expression.rdsRscript code/analysis/Bulk-code/bulk_counts.R /path/to/input /path/to/output GSE317536 package# Run differential expression and downstream analysesRscript code/analysis/Bulk-code/bulk_counts.R /path/to/input /path/to/output GSE317536 analyse```- **GEO bulk pipeline:**```shRscript code/analysis/Bulk-code/bulk_geo.R```- **TCGA bulk pipeline:**```shRscript code/analysis/Bulk-code/bulk_tcga.R```---## Provenance and LicenseHistorical upstream repository: https://github.com/bigdata-lrkai/P2M.Rcode (Commit: `11530593102b06d74ad7199a940adcbb234015f1`).The original scripts retain historical paths, manual grouping, and known formatting syntax limitations. Script filenames have been standardized and organized into modular directories. Code availability does not certify that all historical analyses were rerun.All code files are licensed under the MIT License; see [LICENSE](LICENSE) for details.
code/README.md+45-10
code/bulk_counts.R → code/analysis/Bulk-code/bulk_counts.RRenamed
code/analysis/bulk_geo.R → code/analysis/Bulk-code/bulk_geo.RRenamed
code/analysis/bulk_tcga.R → code/analysis/Bulk-code/bulk_tcga.RRenamed
code/analysis/README.md+76-23
code/annotate_single.R → code/analysis/scRNA-seq_code/annotate_single.RRenamed
code/analysis/doublets.py → code/analysis/scRNA-seq_code/doublets.pyRenamed
code/analysis/format_deg.R → code/analysis/scRNA-seq_code/format_deg.RRenamed
code/analysis/format_enrichment.R → code/analysis/scRNA-seq_code/format_enrichment.RRenamed
code/analysis/format_gene_sctype.R → code/analysis/scRNA-seq_code/format_gene_sctype.RRenamed
code/analysis/format_gene_singler.R → code/analysis/scRNA-seq_code/format_gene_singler.RRenamed
code/analysis/single_cell.R → code/analysis/scRNA-seq_code/single_cell.RRenamed
code/single_cell_analysis.R → code/analysis/scRNA-seq_code/single_cell_analysis.RRenamed