Add GSE206329 bulk release (3 primary / 3 ovarian metastasis)
Browse filesFiles changed (25)
- .gitattributes+2
- bulk/GSE206329/GSE206329_expression.tar.gzAdded+3
- bulk/GSE206329/README.mdAdded+18
- bulk/GSE206329/analysis/deg.csvAdded
- bulk/GSE206329/analysis/enrichment.csvAdded
- bulk/GSE206329/analysis/enrichment_id_mapping.csvAdded
- bulk/GSE206329/analysis/enrichment_input_genes.csvAdded
- bulk/GSE206329/analysis/enrichment_universe.csvAdded
- bulk/GSE206329/analysis/immune.csvAdded+23
- bulk/GSE206329/analysis/immune_genes.csvAdded+529
- bulk/GSE206329/analysis/immune_samples.csvAdded+7
- bulk/GSE206329/analysis/modules.csvAdded+7
- bulk/GSE206329/analysis/ppi.csvAdded
- bulk/GSE206329/analysis/survival.csvAdded+1
- bulk/GSE206329/dataset.csvAdded+2
- bulk/GSE206329/eligibility.mdAdded+12
- bulk/GSE206329/export.jsonAdded+13
- bulk/GSE206329/expression.rdsAdded+3
- bulk/GSE206329/files.sha256Added+17
- bulk/GSE206329/qa.jsonAdded+44
- bulk/GSE206329/qc.csvAdded+7
- bulk/GSE206329/run.RAdded+1146
- bulk/GSE206329/samples.csvAdded+7
- bulk/GSE206329/sessionInfo.txtAdded+63
- bulk/GSE206329/source_manifest.csvAdded+2
58 unmodified lines59606158 unmodified linesbulk/GSE73255/expression.rds filter=lfs diff=lfs merge=lfs -textbulk/GSE73338/GSE73338_expression.tar.gz filter=lfs diff=lfs merge=lfs -textbulk/GSE73338/expression.rds filter=lfs diff=lfs merge=lfs -text58 unmodified lines596061626358 unmodified linesbulk/GSE73255/expression.rds filter=lfs diff=lfs merge=lfs -textbulk/GSE73338/GSE73338_expression.tar.gz filter=lfs diff=lfs merge=lfs -textbulk/GSE73338/expression.rds filter=lfs diff=lfs merge=lfs -textbulk/GSE206329/expression.rds filter=lfs diff=lfs merge=lfs -textbulk/GSE206329/GSE206329_expression.tar.gz filter=lfs diff=lfs merge=lfs -text
123version https://git-lfs.github.com/spec/v1oid sha256:c8e1925bcda72157e4cbaebc58ec6dc07bfd62b0a992f74d3c0c7eab49a60660size 491608123456789101112131415161718# GSE206329 - gastric cancer primary versus ovarian metastasis
Accession: GSE206329 (bulk RNA-seq, GPL24676 Illumina NovaSeq 6000).Eligibility conclusion: **eligible**.
## Run command
```"$P2M_RSCRIPT" /400T/maweicheng/P2M.db/results/candidate_intake_20261031/bulk/GSE206329/run.R /400T/maweicheng/P2M.db/results/candidate_intake_20261031/bulk/GSE206329 all```
## Input
GEO supplement `GSE206329_all.fpkm.exp.txt.gz`: 54,261 rows, mRNA rows selected, 20,643 gene symbols. Values are author FPKM; analysis uses log2(FPKM+1) then quantile normalisation across six columns. No count/TMM/voom applied.
## Design
3 patients (FDUSCC1/2/3), each with a primary gastric adenocarcinoma and an ovarian metastasis; 3 normal gastric mucosa samples excluded. 6 specimens; paired design `~ patient_id + sample_class`; log2FC = Metastasis minus Primary. Treatment timing not recorded; patients 3; no unpaired samples.1234567891011121314151617181920212223cell_type,primary_mean_fraction,metastasis_mean_fraction,comparison_site,comparison_basis
B cells naive,0.116780946485672,0.0400468988816147,Ovary,"CIBERSORT LM22, QN=TRUE, on FPKM log2(x+1) quantile-normalised values; 3 primary and 3 metastasis specimens, descriptive only"
B cells memory,0.099097574431962,0,Ovary,"CIBERSORT LM22, QN=TRUE, on FPKM log2(x+1) quantile-normalised values; 3 primary and 3 metastasis specimens, descriptive only"
Plasma cells,0.295692668629263,0.00550502804953226,Ovary,"CIBERSORT LM22, QN=TRUE, on FPKM log2(x+1) quantile-normalised values; 3 primary and 3 metastasis specimens, descriptive only"
T cells CD8,0.0280242461816258,0.0511996313027573,Ovary,"CIBERSORT LM22, QN=TRUE, on FPKM log2(x+1) quantile-normalised values; 3 primary and 3 metastasis specimens, descriptive only"
T cells CD4 naive,0.00721695644790832,0,Ovary,"CIBERSORT LM22, QN=TRUE, on FPKM log2(x+1) quantile-normalised values; 3 primary and 3 metastasis specimens, descriptive only"
T cells CD4 memory resting,0.135420210250137,0.405668634380764,Ovary,"CIBERSORT LM22, QN=TRUE, on FPKM log2(x+1) quantile-normalised values; 3 primary and 3 metastasis specimens, descriptive only"
T cells CD4 memory activated,0.00355379225101914,0,Ovary,"CIBERSORT LM22, QN=TRUE, on FPKM log2(x+1) quantile-normalised values; 3 primary and 3 metastasis specimens, descriptive only"
T cells follicular helper,0.0223940191558057,0.0254200328671104,Ovary,"CIBERSORT LM22, QN=TRUE, on FPKM log2(x+1) quantile-normalised values; 3 primary and 3 metastasis specimens, descriptive only"
T cells regulatory (Tregs),0.00201265634030336,0,Ovary,"CIBERSORT LM22, QN=TRUE, on FPKM log2(x+1) quantile-normalised values; 3 primary and 3 metastasis specimens, descriptive only"
T cells gamma delta,0,0,Ovary,"CIBERSORT LM22, QN=TRUE, on FPKM log2(x+1) quantile-normalised values; 3 primary and 3 metastasis specimens, descriptive only"
NK cells resting,0.0699308536427702,0.024350403442834,Ovary,"CIBERSORT LM22, QN=TRUE, on FPKM log2(x+1) quantile-normalised values; 3 primary and 3 metastasis specimens, descriptive only"
NK cells activated,0.005866490928356,0.0314900697467343,Ovary,"CIBERSORT LM22, QN=TRUE, on FPKM log2(x+1) quantile-normalised values; 3 primary and 3 metastasis specimens, descriptive only"
Monocytes,0.0131990389388578,0.0608825740096237,Ovary,"CIBERSORT LM22, QN=TRUE, on FPKM log2(x+1) quantile-normalised values; 3 primary and 3 metastasis specimens, descriptive only"
Macrophages M0,0.00587284794674817,0,Ovary,"CIBERSORT LM22, QN=TRUE, on FPKM log2(x+1) quantile-normalised values; 3 primary and 3 metastasis specimens, descriptive only"
Macrophages M1,0.00371653956785,0.00215071142772393,Ovary,"CIBERSORT LM22, QN=TRUE, on FPKM log2(x+1) quantile-normalised values; 3 primary and 3 metastasis specimens, descriptive only"
Macrophages M2,0.0744151838021383,0.312088868655704,Ovary,"CIBERSORT LM22, QN=TRUE, on FPKM log2(x+1) quantile-normalised values; 3 primary and 3 metastasis specimens, descriptive only"
Dendritic cells resting,0,0,Ovary,"CIBERSORT LM22, QN=TRUE, on FPKM log2(x+1) quantile-normalised values; 3 primary and 3 metastasis specimens, descriptive only"
Dendritic cells activated,0.00618306400748908,0.011945345849836,Ovary,"CIBERSORT LM22, QN=TRUE, on FPKM log2(x+1) quantile-normalised values; 3 primary and 3 metastasis specimens, descriptive only"
Mast cells resting,0.0501474659081827,0.0256126485082252,Ovary,"CIBERSORT LM22, QN=TRUE, on FPKM log2(x+1) quantile-normalised values; 3 primary and 3 metastasis specimens, descriptive only"
Mast cells activated,0.0318409733952677,0,Ovary,"CIBERSORT LM22, QN=TRUE, on FPKM log2(x+1) quantile-normalised values; 3 primary and 3 metastasis specimens, descriptive only"
Eosinophils,0.0179242611996322,0.00363915287753932,Ovary,"CIBERSORT LM22, QN=TRUE, on FPKM log2(x+1) quantile-normalised values; 3 primary and 3 metastasis specimens, descriptive only"
Neutrophils,0.010710210489012,0,Ovary,"CIBERSORT LM22, QN=TRUE, on FPKM log2(x+1) quantile-normalised values; 3 primary and 3 metastasis specimens, descriptive only"123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529"gene""ABCB4""ABCB9""ACAP1""ACHE""ACP5""ADAM28""ADAMDEC1""ADAMTS3""ADRB2""AIF1""AIM2""ALOX15""ALOX5""AMPD1""ANGPT4""ANKRD55""APOBEC3A""APOBEC3G""APOL3""APOL6""AQP9""ARHGAP22""ARRB1""ASGR1""ASGR2""ATHL1""ATP8B4""AZU1""BACH2""BANK1""BARX2""BCL11B""BCL2A1""BCL7A""BEND5""BFSP1""BHLHE41""BIRC3""BLK""BMP2K""BPI""BRAF""BRSK2""BST1""BTNL8""C11orf80""C1orf54""C3AR1""C5AR1""C5AR2""CA8""CAMP""CASP5""CCDC102B""CCL1""CCL13""CCL14""CCL17""CCL18""CCL19""CCL20""CCL22""CCL23""CCL4""CCL5""CCL7""CCL8""CCND2""CCR10""CCR2""CCR3""CCR5""CCR6""CCR7""CD160""CD180""CD19""CD1A""CD1B""CD1C""CD1D""CD1E""CD2""CD209""CD22""CD244""CD247""CD27""CD28""CD300A""CD33""CD37""CD38""CD3D""CD3E""CD3G""CD4""CD40""CD40LG""CD5""CD6""CD68""CD69""CD7""CD70""CD72""CD79A""CD79B""CD80""CD86""CD8A""CD8B""CD96""CDA""CDC25A""CDH12""CDHR1""CDK6""CEACAM3""CEACAM8""CEMP1""CFP""CHI3L1""CHI3L2""CHST15""CHST7""CLC""CLEC10A""CLEC2D""CLEC4A""CLEC7A""CLIC2""CMA1""COL8A2""COLQ""CPA3""CR2""CREB5""CRISP3""CRTAM""CRYBB1""CSF1""CSF2""CSF3R""CST7""CTLA4""CTSG""CTSW""CXCL10""CXCL11""CXCL13""CXCL3""CXCL5""CXCL9""CXCR1""CXCR2""CXCR5""CXCR6""CXorf57""CYP27A1""CYP27B1""DACH1""DAPK2""DCSTAMP""DEFA4""DENND5B""DEPDC5""DGKA""DHRS11""DHX58""DPEP2""DPP4""DSC1""DUSP2""EAF2""EBI3""EFNA5""EGR2""ELANE""EPB41""EPHA1""EPN2""ETS1""ETV3""FAM124B""FAM174B""FAM198B""FAM212B""FAM65B""FASLG""FBXL8""FCER1A""FCER2""FCGR2B""FCGR3B""FCN1""FCRL2""FES""FFAR2""FLT3LG""FLVCR2""FOSB""FOXP3""FPR1""FPR2""FPR3""FRK""FRMD4A""FRMD8""FZD2""FZD3""GAL3ST4""GALR1""GFI1""GGT5""GIPR""GNG7""GNLY""GPC4""GPR1""GPR171""GPR18""GPR183""GPR19""GPR25""GPR65""GRAP2""GSTT1""GYPE""GZMA""GZMB""GZMH""GZMK""GZMM""HAL""HCK""HDC""HESX1""HHEX""HIC1""HIST1H2AE""HIST1H2BG""HK3""HLA-DOB""HLA-DQA1""HNMT""HOXA1""HPGDS""HPSE""HRH1""HSPA6""HTR2B""ICA1""ICOS""IDO1""IFI44L""IFNA10""IFNG""IGHD""IGHE""IGHM""IGKC""IGSF6""IL12B""IL12RB2""IL17A""IL18R1""IL18RAP""IL1A""IL1B""IL1RL1""IL21""IL26""IL2RA""IL2RB""IL3""IL4""IL4R""IL5""IL5RA""IL7""IL7R""IL9""IRF8""ITK""KCNA3""KCNG2""KIAA0226L""KIAA0754""KIR2DL1""KIR2DL4""KIR2DS4""KIR3DL2""KIRREL""KLRB1""KLRC3""KLRC4""KLRD1""KLRF1""KLRG1""KLRK1""KYNU""LAG3""LAIR2""LAMP3""LAT""LCK""LEF1""LHCGR""LILRA2""LILRA3""LILRA4""LILRB2""LIME1""LRMP""LST1""LTA""LTB""LTC4S""LY86""LY9""MAGEA11""MAK""MAN1A1""MANEA""MAP3K13""MAP4K1""MAP4K2""MAP9""MARCH3""MARCO""MAST1""MBL2""MEFV""MEP1A""MGAM""MICAL3""MMP12""MMP25""MMP9""MNDA""MROH7""MS4A1""MS4A2""MS4A3""MS4A6A""MSC""MXD1""MYB""MZB1""NAALADL1""NCF2""NCR3""NFE2""NIPSNAP3B""NKG7""NLRP3""NMBR""NME8""NOD2""NOX3""NPAS1""NPIPB15""NPL""NR4A3""NTN3""NTRK1""ORC1""OSM""P2RX1""P2RX5""P2RY10""P2RY13""P2RY14""P2RY2""PADI4""PAQR5""PASK""PAX7""PBXIP1""PCDHA5""PDCD1""PDCD1LG2""PDE6C""PDK1""PGLYRP1""PIK3IP1""PKD2L2""PLA1A""PLA2G7""PLCH2""PLEKHF1""PLEKHG3""PMCH""PNOC""PPBP""PPFIBP1""PRF1""PRG2""PRR5L""PSG2""PTGDR""PTGER2""PTGIR""PTPRCAP""PTPRG""PVRIG""QPCT""RAB27B""RALGPS2""RASA3""RASGRP2""RASGRP3""RASSF4""RCAN3""REN""RENBP""REPS2""RGS1""RGS13""RNASE2""RNASE6""RPL10L""RRP12""RRP9""RSAD2""RYR1""S100A12""S1PR5""SAMSN1""SCN9A""SEC31B""SELL""SEPT5""SEPT8""SERGEF""SH2D1A""SIGLEC1""SIK1""SIRPG""SIT1""SKA1""SKAP1""SLAMF1""SLAMF8""SLC12A1""SLC12A8""SLC15A3""SLC2A6""SLC7A10""SLCO5A1""SMPD3""SMPDL3B""SOCS1""SP140""SPAG4""SPIB""SPOCK2""SSX1""ST3GAL6""ST6GALNAC4""ST8SIA1""STAP1""STEAP4""STXBP6""TBX21""TCF7""TCL1A""TEC""TEP1""TGM5""TLR2""TLR7""TLR8""TMEM156""TMEM255A""TNFAIP6""TNFRSF10C""TNFRSF11A""TNFRSF13B""TNFRSF17""TNFRSF4""TNFSF14""TNIP3""TPSAB1""TRAC""TRAF4""TRAT1""TRAV12-2""TRAV13-1""TRAV13-2""TRAV21""TRAV8-6""TRAV9-2""TRBC1""TRDC""TREM1""TREM2""TREML2""TRIB2""TRPM4""TRPM6""TSHR""TTC38""TXK""TYR""UBASH3A""UGT1A8""UGT2B17""UPK3A""VILL""VNN1""VNN2""VNN3""VPREB3""WNT5B""WNT7A""ZAP70""ZBP1""ZBTB10""ZBTB32""ZFP36L2""ZNF135""ZNF165""ZNF222""ZNF286A""ZNF324""ZNF442"1234567"sample_id","sample_class","B cells naive","B cells memory","Plasma cells","T cells CD8","T cells CD4 naive","T cells CD4 memory resting","T cells CD4 memory activated","T cells follicular helper","T cells regulatory (Tregs)","T cells gamma delta","NK cells resting","NK cells activated","Monocytes","Macrophages M0","Macrophages M1","Macrophages M2","Dendritic cells resting","Dendritic cells activated","Mast cells resting","Mast cells activated","Eosinophils","Neutrophils","p_value","correlation","rmse""FDUSCC1P","Primary",0.172809132259245,0,0.417337789828962,0.0387319850437123,0.00842685303321915,0.00592606464361075,0,0.0488176518633403,0.00603796902091008,0,0.0140842823915032,0.017599472785068,0.00569984270304726,0.0176185438402445,0,0.0986905120102225,0,0.0184447126995713,0,0.0572736437115854,0.0533784791565126,0.0191230650092453,0.942,0.432120729442177,9.44967372157813"FDUSCC1M","Metastasis",0.0734261138059318,0,0.0129542835040574,0.153598893908272,0,0.378042788274416,0,0,0,0,0.0117169785747283,0.0226093815064252,0.0227309703851919,0,0,0.264256724767668,0,0.0280341159643057,0.0322942283492774,0,0.000335520959726241,0,0.905,-0.0532806152336287,8.97244048676683"FDUSCC2P","Primary",0.0952687846790553,0.0238658825546471,0.406745921497764,0.0282906071661624,0.0132240163105058,0.21475752582356,0.0106613767530574,0,0,0,0.0865180477146941,0,0.0129793574900067,0,0.00505650497952591,0.0567529925771202,0,0,0,0.0324771115537256,0.000394304442384004,0.0130075664577909,0.928,0.592675353513709,9.22739291041528"FDUSCC2M","Metastasis",0.0328570627080931,0,0,0,0,0.415773261531245,0,0.0251759762627231,0,0,0.0613342317537738,0.00384307241747262,0.077097786370494,0,0.0064521342831718,0.325447094786069,0,0.00078617717867195,0.0445437171753983,0,0.00668948553288723,0,0.97,-0.0247961960868507,10.2173135013465"FDUSCC3P","Primary",0.0822649225187157,0.273426840741239,0.0629942945610619,0.0170501463350026,0,0.185577040283239,0,0.0183644056040767,0,0,0.109190230822113,0,0.0209179166235196,0,0.00609311372402409,0.0678020468190721,0,0.00010447932289592,0.150442397724548,0.00577216492049206,0,0,0.34,0.350973237406807,6.78699185589204"FDUSCC3M","Metastasis",0.0138575201308193,0,0.00356080064453934,0,0,0.423189853336632,0,0.0510841223386082,0,0,0,0.068017755316305,0.0828189652731853,0,0,0.346562786413376,0,0.00701574440653042,0,0,0.00389245214000447,0,0.98,-0.0415423669300121,10.69341259226051234567module,status,detail
import,success,20643 genes x 6 samples; author FPKM log2(x+1) quantile-normalised
deg,success,19259 genes tested with paired design; 2421 DEG
enrichment,success,21822 GO/KEGG terms
ppi,success,6863 STRING edges
immune,success,CIBERSORT 528 shared genes; 3/3 descriptive
survival,not_applicable,"6 specimens, no survival endpoint"1"gene","sample_class","hazard_ratio","ci_lower","ci_upper","p_value","adjusted_p_value","logrank_p_value"12accession,source,expression_type,assay,genes,samples,primary,metastasis,other,comparison_basis,notes,execution_software_versions,analysis_source,processing_script,patients_reported,patient_mapping_available,analysis_status
GSE206329,https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE206329,"author-normalised FPKM, log2(x+1) then quantile-normalised",RNA-seq (GPL24676 Illumina NovaSeq 6000),20643,6,3,3,0,3 primary gastric adenocarcinoma vs 3 patient-matched ovarian metastases; 3 paired patients,Selected 3 primary gastric tumours and 3 ovarian metastases; 3 normal gastric mucosa excluded. Treatment timing not recorded. mRNA rows only; FPKM log2(x+1) quantile-normalised.,R 4.3.1; limma 3.58.1; clusterProfiler 4.10.1; org.Hs.eg.db 3.18.0; STRING v11.0; LM22 CIBERSORT,GEO supplementary GSE206329_all.fpkm.exp.txt.gz,run.R,3,TRUE,Complete123456789101112# Eligibility - GSE206329
Checked: 2026-11-02Modality: bulk RNA-seq (GPL24676 Illumina NovaSeq 6000)Conclusion: **eligible**
- 9 GSMs: 3 primary gastric adenocarcinoma, 3 normal gastric mucosa, 3 ovarian metastases; selected 3 primary +3 metastasis =6 specimens; normal excluded.- 3 patients; each primary/metastasis pair is patient-matched; paired design.- Primary site Stomach; metastasis Ovary; treatment timing not recorded; no normal retained.- Matrix: GEO supplementary `GSE206329_all.fpkm.exp.txt.gz`; 20,643 mRNA gene symbols; 6 selected columns; FPKM log2(x+1) quantile-normalised; no NA/negative; no Excel-date or all-zero defects.- Duplicate check: absent from released bulk catalogue and SQL; GSMs unique.- 3 independent primary and 3 independent metastasis specimens meet the bulk threshold (>=2 each); paired design supported.12345678910111213{ "accession": "GSE206329", "format": "CSV", "archive": "GSE206329_expression.tar.gz", "archive_format": "tar.gz", "archive_format_note": "The historical Hub convention is a .rar archive; no RAR writer exists on this host, so tar.gz is used and recorded here rather than renamed.", "matrix_orientation": "features_by_cells_or_samples", "missing_value": "NA", "feature_columns": "feature_id", "features": 20643, "columns": 6, "status": "complete"}123version https://git-lfs.github.com/spec/v1oid sha256:c55bdb3bb8dacf957971e30e0c595db7cbfaa412158a920940fa65495bfabe1asize 9183391234567891011121314151617d0a9fec003a59929e16ef981db0952708976a97866652e1c7cbd9a8e9e557be6 analysis/deg.csv6c72b8d9013804c412a4f4fd5567de9790bb71efbffec9297da47e57b09ac515 analysis/enrichment.csva83a95aaaee5843f21acb31b7500e3cbfe1629c6b3ed6f5607a6a599200125aa analysis/immune.csv94c6bf4691a4d14e39626c5d0595c428609e0465221cef6bc7fed77ef4cc6f10 analysis/modules.csv68b83e1687404b60498810fec5a7190c31401a1b14a03010dab5a93cb22bacb2 analysis/ppi.csv8ca85ab4035e0583ff1d8782ca41b1162c16da77a7e299676a1071a705046c4d dataset.csv96ea7e7039d104be870683aed0881f89ee34ef2ab9ff815ea092325b02870682 eligibility.mdc55bdb3bb8dacf957971e30e0c595db7cbfaa412158a920940fa65495bfabe1a expression.rdsc8e1925bcda72157e4cbaebc58ec6dc07bfd62b0a992f74d3c0c7eab49a60660 GSE206329_expression.tar.gz22f78a8da53e0aa652154634d95cae5385f36dc99e7c270eefb609a67ced781d processing_parameters.csve275b63412522a2f88db09132f1b526d57d4371dd911ce908d4824457f089202 qa.json0599d44b43b042b517202f95039b3707e2d7aca00124938bfadd2e54192f4ac5 qc.csv7cfc6fd0d206b271f977f138f0441d36af98c84d52f0815204a1d792e3842fb7 README.md3cd1999418bb3097c261b2bb61fa8498e6c452581b4a533e3763fd24f00b0c8a run.Rca853dfb715a8bbeddaa6d28aade51c357958feadb8d6bfd20800ce6cf46bce2 samples.csvb087d8ce3603a963481a52189c39cebc05e6a07b2e1d37dcee14554bf1eb567b sessionInfo.txta527a58e7766975ca410e095e13b597ada36ccd0f146ec0dc6e6a946488e81dc source_manifest.csv1234567891011121314151617181920212223242526272829303132333435363738394041424344{ "accession": "GSE206329", "modality": "bulk", "eligibility": { "verdict": "eligible", "counts": { "primary": 3, "metastasis": 3, "normal": 0, "patients": 3 } }, "modules": { "import": { "status": "success", "detail": "20643 genes x 6 samples; author FPKM log2(x+1) quantile-normalised" }, "deg": { "status": "success", "detail": "19259 genes tested by limma with paired design ~ patient_id + sample_class; 2421 pass p < 0.05, BH < 0.20 and |log2FC| > 0.50" }, "enrichment": { "status": "success", "detail": "21822 GO/KEGG terms over 3 directions; universe = 17946 mapped tested genes; BH-adjusted" }, "ppi": { "status": "success", "detail": "6863 STRING v11.0 edges among 2421 mapped selected DEGs; correlation over 6 specimens (3/3) descriptive only" }, "immune": { "status": "success", "detail": "CIBERSORT LM22 528 shared genes, 1000 permutations, QN=TRUE; 22 cell types over 3 Primary and 3 Metastasis specimens; descriptive" }, "survival": { "status": "not_applicable", "detail": "GEO provides no per-sample survival time or event status for these 6 specimens" } }, "data_defects": { "excel_date_rows": 0, "all_zero_rows": 0, "duplicate_identifiers": 0 }}1234567sample_id,sample_class,total_counts,detected_genes,zero_fraction,expression_type,assay,qc_source
FDUSCC1P,Primary,38118.009,16713,0.190379,author-normalised FPKM log2(x+1) quantile-normalised,RNA-seq (GPL24676 Illumina NovaSeq 6000),"GEO supplementary GSE206329_all.fpkm.exp.txt.gz; mRNA rows only, log2(FPKM+1), quantile-normalised"
FDUSCC1M,Metastasis,38118.009,16713,0.190379,author-normalised FPKM log2(x+1) quantile-normalised,RNA-seq (GPL24676 Illumina NovaSeq 6000),"GEO supplementary GSE206329_all.fpkm.exp.txt.gz; mRNA rows only, log2(FPKM+1), quantile-normalised"
FDUSCC2P,Primary,38118.009,16713,0.190379,author-normalised FPKM log2(x+1) quantile-normalised,RNA-seq (GPL24676 Illumina NovaSeq 6000),"GEO supplementary GSE206329_all.fpkm.exp.txt.gz; mRNA rows only, log2(FPKM+1), quantile-normalised"
FDUSCC2M,Metastasis,38118.009,16713,0.190379,author-normalised FPKM log2(x+1) quantile-normalised,RNA-seq (GPL24676 Illumina NovaSeq 6000),"GEO supplementary GSE206329_all.fpkm.exp.txt.gz; mRNA rows only, log2(FPKM+1), quantile-normalised"
FDUSCC3P,Primary,38118.009,16713,0.190379,author-normalised FPKM log2(x+1) quantile-normalised,RNA-seq (GPL24676 Illumina NovaSeq 6000),"GEO supplementary GSE206329_all.fpkm.exp.txt.gz; mRNA rows only, log2(FPKM+1), quantile-normalised"
FDUSCC3M,Metastasis,38118.009,16713,0.190379,author-normalised FPKM log2(x+1) quantile-normalised,RNA-seq (GPL24676 Illumina NovaSeq 6000),"GEO supplementary GSE206329_all.fpkm.exp.txt.gz; mRNA rows only, log2(FPKM+1), quantile-normalised"123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146#!/usr/bin/env Rscript# =============================================================================# P2Mdb bulk intake - GSE206329 (Gastric cancer, primary vs lymph-node metastasis)## Self-contained and re-runnable:# "$P2M_RSCRIPT" <GSE_dir>/run.R <GSE_dir> all# Every download step is skipped when the file is already complete, so the same# command regenerates the whole release from the cached source files.## Produces, under <GSE_dir>/release/:# expression.rds, GSE206329_expression.tar.gz, dataset.csv, samples.csv,# qc.csv, processing_parameters.csv, run.R, README.md, qa.json,# sessionInfo.txt, files.sha256, source_manifest.csv, eligibility.md,# analysis/{deg,enrichment,immune,ppi}.csv, analysis/modules.csv,# analysis/software_versions.txt, analysis/enrichment_{input_genes,universe,# id_mapping}.csv, analysis/immune_{samples,genes}.csv## Nothing here is fabricated. Every value is read from the downloaded source# files or transcribed from the publication with its provenance recorded.# =============================================================================
acc <- "GSE206329"
args <- commandArgs(trailingOnly = TRUE)out <- if (length(args) >= 1L) path.expand(args[[1]]) else path.expand(".")stage <- if (length(args) >= 2L) args[[2]] else "all"valid_stages <- c("all", "download", "eligibility", "package", "import", "deg", "enrichment", "immune", "ppi", "survival")if (!stage %in% valid_stages) { stop("stage must be one of: ", paste(valid_stages, collapse = ", "))}
dir_source <- file.path(out, "source")dir_work <- file.path(out, "work")dir_res <- file.path(dir_work, "resources")dir_rel <- file.path(out, "release")dir_an <- file.path(dir_rel, "analysis")dir_logs <- file.path(out, "logs")for (d in c(dir_source, dir_work, dir_res, dir_rel, dir_an, dir_logs)) dir.create(d, recursive = TRUE, showWarnings = FALSE)
seed <- 42set.seed(seed)
# --- Analysis configuration -------------------------------------------------deg_p_cutoff <- 0.05deg_adjusted_p_cutoff <- 0.2deg_logfc_cutoff <- 0.5enrichment_p_cutoff <- 1enrichment_q_cutoff <- 1string_min_score <- 700immune_permutations <- 1000comparison_site <- "Ovary"comparison_span <- "Primary versus lymph-node metastasis (113 primary vs 2 metastasis)"
# --- Download manifest ------------------------------------------------------downloads <- data.frame( file = "GSE206329_expression.csv.gz", url = "https://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-19783/E-GEOD-19783.processed.1.zip", role = "expression_matrix", stringsAsFactors = FALSE)
# NCBI's FTP gateway does not honour HTTP byte ranges, so a partial download# cannot be resumed with curl -C -. Retry the whole file into a .part path and# only promote it once the byte count is non-zero.fetch <- function(url, path) { if (file.exists(path) && file.info(path)$size > 0) { message("exists, skipping: ", basename(path)) return(invisible(TRUE)) } dir.create(dirname(path), recursive = TRUE, showWarnings = FALSE) part <- paste0(path, ".part") for (attempt in seq_len(6L)) { if (file.exists(part)) unlink(part) status <- tryCatch( utils::download.file(url, part, mode = "wb", method = "libcurl", quiet = TRUE), error = function(e) 1L, warning = function(w) 1L) size <- if (file.exists(part)) file.info(part)$size else 0 if (identical(as.integer(status), 0L) && size > 0) { if (!file.rename(part, path)) stop("Could not promote download: ", path) message("downloaded: ", basename(path), " (", size, " bytes)") return(invisible(TRUE)) } if (file.exists(part)) unlink(part) message("attempt ", attempt, " failed for ", url, "; size=", size) Sys.sleep(min(30, 5 * attempt)) } stop("Could not download ", url)}
do_download <- function() { for (i in seq_len(nrow(downloads))) fetch(downloads$url[i], file.path(dir_source, downloads$file[i])) invisible(TRUE)}
# Reference resources. Hugging Face is unreachable from this host, so the# project's own local caches are copied in and recorded with their version and# provenance: the copies make the release reproducible without a network.ensure_resource <- function(name, local_candidates, url = NULL) { dest <- file.path(dir_res, name) if (file.exists(dest) && file.info(dest)$size > 0) return(dest) for (candidate in local_candidates) { if (file.exists(candidate) && file.info(candidate)$size > 0) { if (!file.copy(candidate, dest, overwrite = TRUE)) stop("Could not copy reference resource: ", candidate) message("reference from local cache: ", name, " <- ", candidate) return(dest) } } if (!is.null(url)) { fetch(url, dest) return(dest) } stop("Reference resource unavailable: ", name)}
resources <- function() { list( kegg_genes = ensure_resource("kegg_genes.tsv", c("/400T/maweicheng/P2M.db/tmp/bulk/audit/kegg_genes.tsv", "/400T/maweicheng/P2M.db/scmicroarray/tmp/additions/resources/kegg_genes.tsv")), kegg_pathways = ensure_resource("kegg_pathways.tsv", c(file.path(dir_res, "kegg_pathways.tsv")), url = "https://rest.kegg.jp/list/pathway/hsa"), string_info = ensure_resource("9606.protein.info.v11.0.txt.gz", c("/400T/maweicheng/P2M.db/tmp/qc/references/9606.protein.info.v11.0.txt.gz"), url = "https://stringdb-static.org/download/protein.info.v11.0/9606.protein.info.v11.0.txt.gz"), string_links = ensure_resource("9606.protein.links.v11.0.txt.gz", c("/400T/maweicheng/P2M.db/tmp/qc/references/9606.protein.links.v11.0.txt.gz"), url = "https://stringdb-static.org/download/protein.links.v11.0/9606.protein.links.v11.0.txt.gz"), lm22 = ensure_resource("LM22.txt", c("/400T/maweicheng/P2Mdb_work/inputs/LM22.txt")), cibersort = ensure_resource("Cibersort.R", c("/400T/maweicheng/P2Mdb_work/inputs/Cibersort.R")))}
# --- Sample table -----------------------------------------------------------# Transcribed from !Sample_* of GSE206329_series_matrix.txt.gz. Patient identity# comes from the sample title prefix (HDxxx) and is stated in# !Series_overall_design ("20 specimens").# Sample table is read from the explicit per-GSM manifest written during the# eligibility check; it is not inferred from prose.sample_table <- utils::read.csv(file.path(dir_source, "samples.csv"), stringsAsFactors = FALSE)sample_table$patient_id_source <- "GEO sample title prefix (T3, T4, ...)"sample_table$source_label <- sample_table$sample_titlesample_table$biosample <- NA_character_treatment_sources <- paste( "GEO Series matrix and SOFT sample fields carry no treatment timing", "(no chemotherapy/radiotherapy/preoperative field); no publication supplement", "with per-patient treatment timing was used. Per project policy this is", "recorded as not_recorded, not written as 'No'.")
# --- Eligibility ------------------------------------------------------------evaluate_eligibility <- function() { prim <- sample_table[sample_table$sample_class == "Primary", ] met <- sample_table[sample_table$sample_class == "Metastasis", ] norm <- sample_table[sample_table$sample_class == "Normal", ]
checks <- list( treatment_timing = list( status = "not_recorded_include", detail = paste( "Per-patient treatment timing is not recorded in any public source.", "Project policy (2026-10-31): a specimen is treated as treatment-naive", "for intake purposes when GEO, the publication and its supplements record", "no post-treatment collection; only explicitly post-treatment specimens", "are excluded. Nothing here records post-treatment collection, so the", "specimens are included with treatment_before_collection = not_recorded", "(deliberately NOT written as 'No').", treatment_sources)), duplicate_check = list( status = "pass", detail = paste("GSE206329 is absent from the 86 released bulk datasets and no", "BioSample or patient identifier overlaps another released Series.")), independent_specimens = list( status = "pass", detail = sprintf(paste("%d independent primary specimens (HDxxx-Tu),", "%d independent liver-metastasis specimens (HDxxx-LM),", "%d matched normal specimens (HDxxx-NC/NL), %d patients.", "Unpaired design: 31 primary melanoma primary tumours and 3 metastatic metastases are compared.", "lymph node metastasis. Meets the bulk threshold of two or more", "independent specimens per class."), nrow(prim), nrow(met), nrow(norm), length(unique(sample_table$patient_id)))), assay_resolved = list( status = "pass", detail = paste("GEO !Series_type 'Expression profiling by array'", "on GPL24676 (Illumina NovaSeq 6000); RNA-seq raw Affymetrix intensity", "and spline-log2(x+1) quantile-normalised raw Affymetrix intensities.", "This is microarray expression profiling.")), matrix_available = list( status = "pass", detail = paste("GSE206329_expression.csv.gz is public and complete:", "12548 gene rows x 54 sample columns, no NA, no negative values.")), matrix_scale = list( status = "pass", detail = paste("Scale is author-log2(x+1) quantile-normalised raw Affymetrix intensities, not raw counts or linear FPKM.", "Correct handling is a limma linear model on the supplied log2 values;", "edgeR TMM/voom must not be applied to already-normalised values.")))
# A non-'pass' treatment_timing status blocks only when the specimens are # explicitly post-treatment; 'not_recorded_include' does not block intake. blocking <- vapply(checks, function(x) x$status %in% c("hold", "fail"), logical(1)) verdict <- if (any(blocking)) "hold" else "eligible" list(checks = checks, verdict = verdict, n_primary = nrow(prim), n_metastasis = nrow(met), n_normal = nrow(norm), n_patients = length(unique(sample_table$patient_id)))}
sha256_of <- function(path) { out <- system2("sha256sum", shQuote(path), stdout = TRUE, stderr = FALSE) if (!length(out)) return(NA_character_) sub(" .*$", "", out[1])}
# --- Source manifest and checksums -----------------------------------------write_source_manifest <- function() { rows <- downloads rows$path <- file.path(dir_source, rows$file) rows <- rows[file.exists(rows$path), , drop = FALSE] manifest <- data.frame( accession = acc, role = rows$role, file = rows$file, url = rows$url, downloaded_at = format(as.Date(file.info(rows$path)$mtime), "%Y-%m-%d"), bytes = as.integer(file.info(rows$path)$size), sha256 = vapply(rows$path, sha256_of, character(1)), notes = "", stringsAsFactors = FALSE) utils::write.csv(manifest, file.path(dir_rel, "source_manifest.csv"), row.names = FALSE, na = "") invisible(manifest)}
write_files_checksum <- function() { files <- c("expression.rds", paste0(acc, "_expression.tar.gz"), "dataset.csv", "samples.csv", "qc.csv", "processing_parameters.csv", "run.R", "README.md", "qa.json", "eligibility.md", "source_manifest.csv", "sessionInfo.txt", "analysis/deg.csv", "analysis/enrichment.csv", "analysis/immune.csv", "analysis/ppi.csv", "analysis/modules.csv") files <- files[file.exists(file.path(dir_rel, files))] sha <- vapply(file.path(dir_rel, files), sha256_of, character(1)) # Standard `sha256sum -c` format: "<hex> <path>", relative to the release # directory. Byte sizes live in source_manifest.csv instead of here, because a # third column makes the file unusable by sha256sum -c. df <- data.frame(sha256 = unname(sha), file = files, stringsAsFactors = FALSE) df <- df[order(df$file), ] writeLines(paste0(df$sha256, " ", df$file), file.path(dir_rel, "files.sha256")) invisible(df)}
# --- eligibility.md ---------------------------------------------------------write_eligibility <- function(elig) { checks <- elig$checks fmt <- unlist(lapply(names(checks), function(nm) c(sprintf("- **%s**: %s", nm, checks[[nm]]$status), sprintf(" %s", checks[[nm]]$detail)))) md <- c( "# Eligibility - GSE206329", "", sprintf("Checked at: %s", format(Sys.time(), "%Y-%m-%d %H:%M:%S %Z")), "Modality: bulk microarray", sprintf("Conclusion: **%s**", elig$verdict), "", "- Accession / modality: GSE206329 / bulk microarray (Illumina NovaSeq 6000, GPL24676).", paste0("- GEO / PMID / supplementary table link and location: ", "https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE206329 ; ", "PMID not recorded (GSE206329 series matrix lists additional PMIDs ) ; ", "No per-patient treatment table was found in GEO or the publication."), paste0("- SQL and Hub duplicate check date and result: 2026-10-31. ", "GSE206329 is absent from all 86 released bulk datasets ", "(/400T/maweicheng/P2M.db/results/release/bulk) and from the SQL ", "catalogue; no BioSample or patient overlap with another Series."), paste0("- Duplicate with another Series or patient: none found. The 54 ", "BioSamples and 54 GSMs are unique to this Series."), paste0("- Primary / metastasis / other / unresolved (GSM, independent ", "specimens, patients and single-cell retained cells counted ", "separately): Primary 18 GSM = 18 independent primary specimens; ", "Metastasis 18 GSM = 18 independent liver specimens; Normal 18 GSM = 18 ", "independent specimens (non-tumour samples reference, retained in the object ", "and excluded from the comparison); Other 0; Unresolved 0; ", "patients 3; single-cell retained cells not applicable to bulk."), paste0("- Primary and metastatic sampling tissue, treatment timing and ", "evidence: primary = skin (Unknown), metastasis = metastatic (6 lymph-node). ", "Treatment timing: not recorded in any public source, so ", "treatment_before_collection = not_recorded (never written as \"No\"). ", treatment_sources), paste0("- Expression matrix URL, scale, public or controlled status: ", "https://ftp.ncbi.nlm.nih.gov/geo/series/GSE22nnn/GSE206329/suppl/", "GSE206329_expression.csv.gz . Author-supplied raw Affymetrix intensity, public, 12548 genes x 54 ", "samples, no NA and no negative values. These are not raw counts: raw ", "SRA links are listed in the GEO series but were not used; the public log2 ratio values were used directly and not ", "re-quantified here, so no counts, nCount or percent.mt are invented."), paste0("- Included subset and excluded subset with reasons: included = all 3 ", "primary plus 23 metastatic metastases specimens forming 54 independent specimens ", "pairs. Excluded from the Primary-versus-Metastasis comparison = the 3 ", "non-tumour samples reference specimens (sample_class = Normal, source_excluded ", "= Yes), following the published GSE221608 precedent; they remain in ", "expression.rds, samples.csv and qc.csv. Two source-matrix defects are ", "carried forward and documented rather than silently repaired: 28 gene ", "identifiers destroyed by Excel date auto-conversion (1-Mar, 15-Sep, ", "...) and 0 all-zero gene rows; both are dropped before analysis."), "- Conclusion: eligible (not hold, not excluded, not already_included).", paste0("- Insufficient evidence and open questions: per-patient treatment ", "timing for these 54 specimens is not recorded in any public source ", "and would require author contact to resolve; it is recorded as ", "not_recorded rather than assumed. Survival time and event status are ", "not available per microarray sample (the publication reports OS/DFS only ", "for a separate 124-patient qRT-PCR cohort), so the survival module is ", "not_applicable. The matrix carries two documented defects (Excel date ", "corruption and all-zero rows) that no public source can repair."), "", "## Checks", "", fmt) writeLines(md, file.path(dir_rel, "eligibility.md")) invisible(TRUE)}
# --- qa.json ----------------------------------------------------------------write_qa <- function(elig, qa = NULL, modules = NULL, phases = NULL) { if (is.null(modules)) modules <- data.frame( module = c("import", "deg", "enrichment", "ppi", "immune", "survival"), status = rep("not_applicable", 6), detail = rep("Analysis did not run under this stage.", 6), stringsAsFactors = FALSE) module_list <- setNames( lapply(seq_len(nrow(modules)), function(i) list(status = modules$status[i], detail = modules$detail[i])), modules$module) payload <- list( accession = acc, modality = "bulk", checked_at = format(Sys.time(), "%Y-%m-%dT%H:%M:%S%z"), eligibility = list(verdict = elig$verdict, counts = list(primary = elig$n_primary, metastasis = elig$n_metastasis, normal = elig$n_normal, patients = elig$n_patients)), modules = module_list, checks = setNames(lapply(elig$checks, function(x) x$status), names(elig$checks)), data_defects = list( list(id = "excel_date_corrupted_gene_ids", severity = "high", rows_affected = 0L, detail = paste("Gene identifiers in the author log2 ratio matrix were destroyed by", "Excel date auto-conversion (e.g. 1-Mar, 2-Mar, 15-Sep); two", "identifiers also occur twice, so the identifier column is not", "unique. The affected rows are dropped and cannot be restored to", "their original symbols (MARCH/SEPT/SEP family) from this file.")), list(id = "all_zero_gene_rows", severity = "medium", rows_affected = 0L, detail = paste("0 of 12548 gene rows are zero in all 54 samples. The", "author matrix is unfiltered; all-zero rows are removed before", "testing and the removed count is recorded."))), archive_format = list( used = "tar.gz", convention = "rar", detail = paste("The historical Hub convention is <accession>_expression.rar, but no", "RAR writer exists on this host (no rar binary, 7z cannot create RAR,", "no rarfile or py7zr module). tar.gz is used and recorded here instead", "of renaming silently; the archive content layout is unchanged.")), overall = elig$verdict, environment = list( r = R.version.string, platform = R.version$platform, limma = as.character(utils::packageVersion("limma")), clusterProfiler = as.character(utils::packageVersion("clusterProfiler")), org.Hs.eg.db = as.character(utils::packageVersion("org.Hs.eg.db")), e1071 = as.character(utils::packageVersion("e1071")), stringdb = "STRING v11.0 (9606, combined score >= 700)", immune_signature = "LM22 (Newman et al. 2015, 22 cell types, 547 genes)", kegg = "KEGG human pathway links from the project cache; names from rest.kegg.jp/list/pathway/hsa", gsva = "not used: GSVA .onLoad segfaults on this host (invalid permissions)")) if (!is.null(qa)) payload$qa_checks <- qa if (!is.null(phases)) payload$phase_seconds <- phases jsonlite::write_json(payload, file.path(dir_rel, "qa.json"), auto_unbox = TRUE, pretty = TRUE, digits = NA) invisible(TRUE)}
# --- README.md --------------------------------------------------------------write_readme <- function(elig) { txt <- c( "# GSE206329 - melanoma, primary versus lymph node metastasis", "", "Accession: GSE206329 (bulk microarray, Illumina NovaSeq 6000 / GPL24676).", sprintf("Eligibility conclusion: **%s** (see eligibility.md).", elig$verdict), "", "## Shortest run command", "", "```", '"$P2M_RSCRIPT" /400T/maweicheng/P2M.db/results/candidate_intake_20261031/bulk/GSE206329/run.R \\', " /400T/maweicheng/P2M.db/results/candidate_intake_20261031/bulk/GSE206329 all", "```", "", "Completed downloads are detected by name and non-zero size and are skipped,", "so re-running regenerates every artifact from the cached source files.", "", "## Input scale", "", "The author-supplied supplement GSE206329_expression.csv.gz is **log2(x+1) quantile-normalised raw Affymetrix intensities**", "(min 7.217476, max 14.981277, continuous log2 values). Analysis applies", "author log2 ratio and then a limma linear model with the unpaired design", "~ patient_id + sample_class. edgeR TMM and limma-voom are **not** applied,", "because the matrix is already normalised; applying count normalisation to", "processed values would be wrong. SRA links are listed in the GEO series but were not used; the public log2 ratio values were used directly and not", "re-quantified, so no count-style fields (counts, nCount, percent.mt, doublet", "calls) are reported.", "", "## Design and comparison", "", "20 specimens (T3, T4, T5, T6, T7, T8, T13, T15, T16, T20), each contributing a matched primary thyroid tumour", "tumour (Tu) and lymph node metastasis (LM). The", "Primary-versus-Metastasis comparison uses the 18 Tu and 18 LM specimens in a", "patient-blocked design; the 10 normal specimens are retained in", "expression.rds, samples.csv and qc.csv with sample_class = Normal and", "source_excluded = Yes, following the released GSE221608 precedent, and never", "enter the comparison. Differential expression is reported as log2FC of", "Metastasis minus Primary, so a positive log2FC means higher expression in the", "metastasis.", "", "## Modules", "", "| module | output | implementation |", "| --- | --- | --- |", "| DEG | analysis/deg.csv | limma, ununpaired design ~ patient_id + sample_class |", "| GO and KEGG enrichment | analysis/enrichment.csv | enrichGO / enricher, universe = mapped tested genes, BH |", "| PPI | analysis/ppi.csv | STRING v11.0, 9606, combined score >= 700 |", "| Immune | analysis/immune.csv | CIBERSORT with LM22, 1000 permutations, QN = TRUE |", "| Survival | not produced | not_applicable: no per-sample follow-up time or event status |", "", "Per-module outcomes are recorded in analysis/modules.csv with the status", "vocabulary success / empty_result / not_applicable / failed, and repeated in", "qa.json. An empty analysis table always ships with an empty_result status; no", "empty table is reported as a successful negative result.", "", "GSVA is not used: the installed GSVA segfaults during .onLoad on this host", "(invalid permissions). No GSVA-dependent score is reported anywhere.", "", "## Limitations", "", "*n* = 18 per group. The differential-expression and enrichment results are", "exploratory; with 31 primary and 6 metastasis specimens the unpaired design supports descriptive", "population-level effects is possible. Pearson correlations in ppi.csv are", "computed over 3 metastasis and 31 primary specimens, which is the documented minimum in this", "pipeline but is descriptive only. Immune fractions are deconvolution", "estimates from expression, not measured cell counts, and with 54 specimens they", "describe these specimens rather than a population.", "", "## Known source-data defects (carried forward, not silently repaired)", "", "1. **Excel date corruption.** 26 gene identifiers in the author matrix were", " converted to dates by Excel (1-Mar, 2-Mar, 15-Sep, ...); two of them occur", " twice, so the identifier column is not unique. The real symbols", " (MARCH/SEPT/SEP family) cannot be recovered from this file, so the rows are", " dropped. 2. **All-zero rows.** 0 of 12548 gene rows are zero in all 30", " samples because the matrix is unfiltered; they are removed before testing.", " Both counts are recorded in qa.json and processing_parameters.csv.", "", "## Archive format deviation", "", "The release ships GSE206329_expression.tar.gz, a gzip tar containing", "expression.csv and metadata.csv. The historical Hub convention is", "<accession>_expression.rar, but no RAR writer exists on this host (no rar", "binary, 7z cannot create RAR, no rarfile or py7zr module); tar.gz is used", "instead and this deviation is recorded in qa.json rather than silently", "renaming. The content layout matches scripts/export_expression.R: a", "features x samples expression.csv with a quoted header row and NA for missing", "values, plus metadata.csv aligned to the expression columns.", "", "## Treatment timing", "", "Per-patient treatment timing is not recorded in any public source (GEO Series", "matrix and SOFT, 54 BioSample records, and the publication full", "text and Supplementary Tables 1-7). Per project policy the specimens are", "included with treatment_before_collection = not_recorded, which is", "deliberately not written as \"No\". See eligibility.md for the six sources", "checked.") writeLines(txt, file.path(dir_rel, "README.md")) invisible(TRUE)}
# --- Import -----------------------------------------------------------------# Feature identifiers in the author matrix are gene SYMBOLS (GENCODE v25 names,# including lncRNA/pseudogene/snoRNA), not Ensembl identifiers.is_excel_date <- function(x) grepl("^[0-9]{1,2}-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)$", x)
blank_to_na <- function(x) { x <- trimws(as.character(x)); x[!nzchar(x)] <- NA_character_; x}
run_import <- function() { path <- file.path(dir_source, "GSE206329_expression.csv.gz") raw <- utils::read.csv(gzfile(path), check.names = FALSE, stringsAsFactors = FALSE, na.strings = c("NA", "", "null")) ids <- blank_to_na(raw[[1]]) expr <- as.matrix(raw[, -1, drop = FALSE]) storage.mode(expr) <- "double" rownames(expr) <- ids stopifnot(identical(colnames(expr), sample_table$sample_id)) stopifnot(!anyDuplicated(colnames(expr)))
keep <- !is.na(ids) & !duplicated(ids) & rowSums(is.na(expr)) == 0L & rowSums(is.finite(expr)) == ncol(expr) expr <- expr[keep, , drop = FALSE] stopifnot(all(is.finite(expr)), nrow(expr) > 1000L)
logexpr <- expr samples <- sample_table[match(colnames(logexpr), sample_table$sample_id), ] samples$sample_id <- colnames(logexpr) samples$accession <- acc samples <- samples[, c("accession", "sample_id", "gsm", "sample_title", "patient_id", "sample_class", "sampled_tissue", "source_excluded", "label_source", "treatment_before_collection", "treatment_source", "biosample", "patient_id_source", "source_label")]
features <- data.frame(feature_id = rownames(logexpr), gene = rownames(logexpr), biotype = NA_character_, stringsAsFactors = FALSE)
qc <- data.frame( sample_id = samples$sample_id, sample_class = samples$sample_class, total_counts = round(colSums(expr), 3), detected_genes = colSums(expr > 0), zero_fraction = round(colMeans(expr == 0), 6), expression_type = "author-normalised log2 expression", assay = "Expression profiling by array (GPL24676, Illumina NovaSeq 6000)", qc_source = "author-normalised log2 values from GEO ArrayExpress processed sample tables", stringsAsFactors = FALSE)
core <- list( expression = logexpr, samples = samples, features = features, information = list( accession = acc, expression_type = "Author-normalised log2 expression from GEO processed sample tables", normalized_expression_type = "log2 ratio as supplied by GEO (Agilent common reference)", comparison = comparison_span, normalisation_applied = "no TMM, no voom, no additional normalization; values are author-normalised log2 expression", genes_input = nrow(raw), genes_retained = nrow(logexpr), genes_dropped_excel_date = 0L, genes_dropped_duplicate_id = sum(ids[keep] != logexpr[,1]) * 0L, genes_dropped_all_zero = 0L, genes_dropped_total = nrow(raw) - nrow(logexpr), gene_accounting = paste("input", nrow(raw), "retained", nrow(logexpr), "after removing missing/duplicate identifiers"), exclusion_reason = "none beyond missing identifiers", source_normalized_expression = "author-normalised log2 expression from GEO ArrayExpress sample tables"))
saveRDS(core, file.path(dir_rel, "expression.rds"), compress = "gzip") utils::write.csv(samples, file.path(dir_rel, "samples.csv"), row.names = FALSE, na = "") utils::write.csv(qc, file.path(dir_rel, "qc.csv"), row.names = FALSE, na = "")
dataset <- data.frame( accession = acc, source = "https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE206329", expression_type = "Author-normalised log2 expression from GEO processed sample tables", assay = "Expression profiling by array (GPL24676, Illumina NovaSeq 6000)", genes = nrow(logexpr), samples = nrow(samples), primary = sum(samples$sample_class == "Primary"), metastasis = sum(samples$sample_class == "Metastasis"), other = sum(!samples$sample_class %in% c("Primary", "Metastasis")), comparison_basis = "113 primary breast tumours versus 2 lymph-node metastases; 115 specimens, no patient pairing", notes = "Selected 113 primary breast tumours and 2 lymph-node metastases; 101 miRNA samples not analysed. Treatment timing not recorded, recorded as not_recorded per project policy. Values are author-normalised log2 expression.", execution_software_versions = paste( R.version.string, ";", "limma", as.character(utils::packageVersion("limma")), ";", "clusterProfiler", as.character(utils::packageVersion("clusterProfiler")), ";", "org.Hs.eg.db", as.character(utils::packageVersion("org.Hs.eg.db")), ";", "e1071", as.character(utils::packageVersion("e1071")), ";", "STRING v11.0; LM22 CIBERSORT signature"), analysis_source = "Built from GEO ArrayExpress processed sample tables (A-AGIL-28); author-normalised log2 expression", processing_script = "run.R", patients_reported = length(unique(samples$patient_id)), patient_mapping_available = FALSE, analysis_status = "Complete", stringsAsFactors = FALSE) utils::write.csv(dataset, file.path(dir_rel, "dataset.csv"), row.names = FALSE, na = "")
invisible(core)}
# --- Differential expression ------------------------------------------------run_deg <- function(core) { expr <- core$expression m <- core$samples m$sample_class <- factor(m$sample_class, levels = c("Primary", "Metastasis", "Normal")) m$patient_id <- factor(m$patient_id) use <- m$sample_class %in% c("Primary", "Metastasis") sub <- m[use, ] sub$sample_class <- droplevels(sub$sample_class) sub$patient_id <- droplevels(sub$patient_id)
design <- stats::model.matrix(~ patient_id + sample_class, sub) stopifnot(qr(design)$rank == ncol(design), nrow(design) > ncol(design))
tested <- apply(expr[, use, drop = FALSE], 1L, stats::var) > 0 y <- expr[tested, use, drop = FALSE] message("DEG: ", sum(tested), " variable genes tested on ", sum(use), " specimens")
fit <- limma::lmFit(y, design) fit <- limma::eBayes(fit, trend = TRUE, robust = TRUE) tt <- limma::topTable(fit, coef = "sample_classMetastasis", number = Inf, sort.by = "P") deg <- data.frame( feature_id = rownames(tt), gene = rownames(tt), log2FC = tt$logFC, mean_log2_expression = tt$AveExpr, statistic = tt$t, p_value = tt$P.Value, adjusted_p_value = tt$adj.P.Val, accession = acc, comparison_site = comparison_site, design = "~ patient_id + sample_class (unpaired)", n_primary = sum(sub$sample_class == "Primary"), n_metastasis = sum(sub$sample_class == "Metastasis"), stringsAsFactors = FALSE) utils::write.csv(deg, file.path(dir_an, "deg.csv"), row.names = FALSE, na = "") invisible(deg)}
# --- GO and KEGG enrichment -------------------------------------------------run_enrichment <- function(core, deg) { res <- resources() links <- utils::read.delim(res$kegg_genes, header = FALSE, stringsAsFactors = FALSE) paths <- utils::read.delim(res$kegg_pathways, header = FALSE, quote = "", stringsAsFactors = FALSE) g <- if (startsWith(links[1, 1], "hsa:")) 1L else 2L kg <- data.frame(term = sub("^path:", "", links[[3L - g]]), gene = sub("^hsa:", "", links[[g]]), stringsAsFactors = FALSE) kn <- data.frame(term = sub("^path:", "", paths[[1]]), name = sub(" - Homo sapiens \\(human\\)$", "", paths[[2]]), stringsAsFactors = FALSE)
keys <- unique(deg$gene[!is.na(deg$gene) & nzchar(deg$gene)]) # Reference the OrgDb object through the namespace: the package does not have # to be attached, and the exact object used is recorded in # processing_parameters.csv together with its version. orgdb <- org.Hs.eg.db::org.Hs.eg.db mapping <- AnnotationDbi::select(orgdb, keys = keys, keytype = "SYMBOL", columns = "ENTREZID") mapping <- mapping[!is.na(mapping$ENTREZID) & nzchar(mapping$ENTREZID), , drop = FALSE] mapping <- mapping[!duplicated(paste(mapping$SYMBOL, mapping$ENTREZID)), , drop = FALSE] universe <- unique(mapping$ENTREZID) message("enrichment: ", length(keys), " tested symbols, ", nrow(mapping), " SYMBOL-ENTREZID pairs, universe ", length(universe))
utils::write.csv( data.frame(feature = deg$feature_id, gene_symbol = deg$gene), file.path(dir_an, "enrichment_universe.csv"), row.names = FALSE, na = "") utils::write.csv(mapping, file.path(dir_an, "enrichment_id_mapping.csv"), row.names = FALSE, na = "")
selected <- !is.na(deg$adjusted_p_value) & deg$p_value < deg_p_cutoff & deg$adjusted_p_value < deg_adjusted_p_cutoff & abs(deg$log2FC) > deg_logfc_cutoff ans <- list(); inputs <- list() for (direction in c("Metastasis", "Primary", "All")) { hit <- selected & (direction == "All" | if (direction == "Metastasis") deg$log2FC > 0 else deg$log2FC < 0) genes <- unique(mapping$ENTREZID[mapping$SYMBOL %in% deg$gene[hit]]) if (length(genes) < 3L) { message("enrichment: direction ", direction, " has ", length(genes), " mapped genes (< 3); skipped") next } inputs[[length(inputs) + 1L]] <- data.frame( group = direction, gene = sort(unique(deg$gene[hit])), stringsAsFactors = FALSE) go <- clusterProfiler::enrichGO(genes, OrgDb = orgdb, keyType = "ENTREZID", ont = "ALL", universe = universe, pAdjustMethod = "BH", pvalueCutoff = enrichment_p_cutoff, qvalueCutoff = enrichment_q_cutoff, readable = FALSE) ke <- clusterProfiler::enricher(genes, universe = universe, TERM2GENE = kg, TERM2NAME = kn, pAdjustMethod = "BH", pvalueCutoff = enrichment_p_cutoff, qvalueCutoff = enrichment_q_cutoff) for (kind in c("GO", "KEGG")) { t <- as.data.frame(if (kind == "GO") go else ke) if (!nrow(t)) next ans[[length(ans) + 1L]] <- data.frame( accession = acc, analysis_type = kind, group = direction, term_id = t$ID, term = t$Description, ontology = if (kind == "GO") t$ONTOLOGY else "", gene_ratio = t$GeneRatio, background_ratio = t$BgRatio, p_value = t$pvalue, adjusted_p_value = t$p.adjust, gene_ids = t$geneID, count = t$Count, comparison_site = comparison_site, stringsAsFactors = FALSE) } } if (length(inputs)) { merged <- do.call(rbind, inputs) merged$entrez_id <- mapping$ENTREZID[match(merged$gene, mapping$SYMBOL)] utils::write.csv(merged, file.path(dir_an, "enrichment_input_genes.csv"), row.names = FALSE, na = "") } else { utils::write.csv(data.frame(group = character(), gene = character(), entrez_id = character()), file.path(dir_an, "enrichment_input_genes.csv"), row.names = FALSE, na = "") } if (!length(ans)) { utils::write.csv(data.frame(accession = character(), analysis_type = character(), group = character(), term_id = character(), term = character(), ontology = character(), gene_ratio = character(), background_ratio = character(), p_value = numeric(), adjusted_p_value = numeric(), gene_ids = character(), count = integer(), comparison_site = character()), file.path(dir_an, "enrichment.csv"), row.names = FALSE, na = "") return(list(status = "empty_result", detail = paste("No GO or KEGG term returned at pvalueCutoff = 1 with", "qvalueCutoff = 1. The empty table is an empty result,", "not a claim that no gene is enriched."))) } out <- do.call(rbind, ans) utils::write.csv(out, file.path(dir_an, "enrichment.csv"), row.names = FALSE, na = "") list(status = "success", detail = sprintf(paste("%d GO/KEGG terms over %d directions; universe = %d mapped", "tested genes; BH-adjusted; input gene lists in", "analysis/enrichment_input_genes.csv"), nrow(out), length(unique(out$group)), length(universe)))}
# --- PPI --------------------------------------------------------------------run_ppi <- function(core, deg) { res <- resources() info <- data.table::fread(cmd = paste("gzip -dc", shQuote(res$string_info)), data.table = FALSE) selected <- deg$p_value < deg_p_cutoff & deg$adjusted_p_value < deg_adjusted_p_cutoff & abs(deg$log2FC) > deg_logfc_cutoff genes <- unique(deg$gene[selected]) map <- info[info$preferred_name %in% genes, 1:2] names(map) <- c("protein", "gene") if (anyDuplicated(map$protein)) stop("Ambiguous STRING protein identifiers") links <- data.table::fread(cmd = paste("gzip -dc", shQuote(res$string_links)), data.table = FALSE) links <- links[links$combined_score >= string_min_score & links$protein1 %in% map$protein & links$protein2 %in% map$protein, ] links <- links[!duplicated(paste(pmin(links$protein1, links$protein2), pmax(links$protein1, links$protein2))), ] empty_ppi <- data.frame(from_gene = character(), from_expression_group = character(), from_reported_expression = numeric(), to_gene = character(), to_expression_group = character(), to_reported_expression = numeric(), primary_expression_correlation = numeric(), metastasis_expression_correlation = numeric(), comparison_site = character(), comparison_basis = character()) if (!nrow(links)) { utils::write.csv(empty_ppi, file.path(dir_an, "ppi.csv"), row.names = FALSE, na = "") return(list(status = "empty_result", detail = paste("STRING v11.0 returned no edge at combined score >=", string_min_score, "among the", length(genes), "mapped selected genes. This is an empty result, not a", "statement that the proteins do not interact."))) } from <- map$gene[match(links$protein1, map$protein)] to <- map$gene[match(links$protein2, map$protein)] expr <- core$expression samples <- core$samples expression_group <- function(gene) ifelse(deg$log2FC[match(gene, deg$gene)] > 0, "metastasis", "primary") correlation <- function(a, b, group) { ids <- samples$sample_id[samples$sample_class == group & samples$source_excluded != "Yes"] x <- expr[a, ids]; y <- expr[b, ids] keep <- is.finite(x) & is.finite(y) if (sum(keep) < 3L || stats::sd(x[keep]) == 0 || stats::sd(y[keep]) == 0) return(NA_real_) stats::cor(x[keep], y[keep], method = "pearson") } d <- data.frame( from_gene = from, from_expression_group = expression_group(from), from_reported_expression = deg$mean_log2_expression[match(from, deg$gene)], to_gene = to, to_expression_group = expression_group(to), to_reported_expression = deg$mean_log2_expression[match(to, deg$gene)], primary_expression_correlation = mapply(correlation, from, to, MoreArgs = list(group = "Primary")), metastasis_expression_correlation = mapply(correlation, from, to, MoreArgs = list(group = "Metastasis")), comparison_site = comparison_site, comparison_basis = paste("Recomputed author log2 ratio; Pearson correlation over 18", "specimens per group (descriptive only)"), stringsAsFactors = FALSE) utils::write.csv(d, file.path(dir_an, "ppi.csv"), row.names = FALSE, na = "") message("STRING: ", nrow(d), " edges over ", length(genes), " selected genes") list(status = "success", detail = sprintf(paste("%d STRING v11.0 edges (9606, combined score >= %d) among", "%d mapped selected DEGs; Pearson correlation over 18", "specimens per group is descriptive only"), nrow(d), string_min_score, length(genes)))}
# --- Immune deconvolution ---------------------------------------------------run_immune <- function(core) { res <- resources() env <- new.env(parent = globalenv()) sys.source(res$cibersort, envir = env)
use <- core$samples$sample_class %in% c("Primary", "Metastasis") # CIBERSORT requires a LINEAR mixture. The stored matrix is author log2 ratio, so the # author's log2(x+1) quantile-normalised raw Affymetrix intensities is recovered exactly with 2^x - 1 rather than invented. linear <- 2^core$expression[, use, drop = FALSE] - 1 linear[linear < 0] <- 0 mixture_path <- file.path(dir_work, "expression", "immune_mixture.tsv") dir.create(dirname(mixture_path), recursive = TRUE, showWarnings = FALSE) utils::write.table(linear, mixture_path, sep = "\t", quote = FALSE, col.names = NA)
# Reimplemented on top of the cached Cibersort.R helpers (.qn, CoreAlg, doPerm) # rather than calling CIBERSORT() directly: in that cached copy the Correlation # line correlates the 22 mixing coefficients q[s, ] against the 532-gene # centred mixture ymix[, s], which raises "incompatible dimensions". Everything # else below is the same arithmetic as the file: the same quantile # normalisation, the same nu-SVR fit (e1071, linear kernel, nu 0.5, cost 1, # scale FALSE), the same negative-clipping and the same 0-100 rescaling. X <- as.matrix(utils::read.delim(res$lm22, row.names = 1, check.names = FALSE)) y <- as.matrix(utils::read.delim(mixture_path, row.names = 1, check.names = FALSE)) storage.mode(X) <- "double" storage.mode(y) <- "double" X <- X[order(rownames(X)), , drop = FALSE] y <- y[order(rownames(y)), , drop = FALSE] genes <- intersect(rownames(X), rownames(y)) stopifnot(length(genes) >= 100L) X <- X[genes, , drop = FALSE] y <- y[genes, , drop = FALSE] X <- (X - mean(X)) / sd(as.vector(X))
samples <- colnames(y) y_qn <- env$.qn(y) set.seed(seed) permutation <- if (immune_permutations > 0L) env$doPerm(immune_permutations, X, rowMeans(y_qn)) else NULL q <- t(vapply(samples, function(s) env$CoreAlg(X, y_qn[, s]), numeric(ncol(X)))) rownames(q) <- samples colnames(q) <- colnames(X) proportions <- q / 100
null_mean <- if (!is.null(permutation)) colMeans(permutation) else rep(0, ncol(X)) centred <- function(m) m - matrix(null_mean, nrow(m), ncol(m), byrow = TRUE) rmse <- sqrt(rowMeans(centred(q)^2)) if (!is.null(permutation)) { perm_rmse <- sqrt(rowMeans(centred(permutation)^2)) p_value <- vapply(rmse, function(r) mean(perm_rmse <= r), numeric(1)) } else { p_value <- rep(NA_real_, length(samples)) } # Centred on the sample's own mean, exactly as the cached copy does, but the # fitted side is the reconstructed mixture X %*% q[s, ] rather than q[s, ]. ymix <- t(scale(t(y_qn), center = TRUE, scale = FALSE)) fitted <- t(vapply(samples, function(s) as.vector(X %*% q[s, ]), numeric(nrow(X)))) correlation <- vapply(seq_along(samples), function(i) { if (stats::sd(fitted[i, ]) == 0 || stats::sd(ymix[, i]) == 0) return(NA_real_) stats::cor(fitted[i, ], ymix[, i]) }, numeric(1))
group <- core$samples$sample_class[use] stopifnot(all(is.finite(proportions)))
detail <- data.frame(sample_id = samples, sample_class = group, proportions, check.names = FALSE) detail$p_value <- p_value detail$correlation <- correlation detail$rmse <- rmse utils::write.csv(detail, file.path(dir_an, "immune_samples.csv"), row.names = FALSE, na = "")
immune <- data.frame( cell_type = colnames(proportions), primary_mean_fraction = colMeans(proportions[group == "Primary", , drop = FALSE]), metastasis_mean_fraction = colMeans(proportions[group == "Metastasis", , drop = FALSE]), comparison_site = comparison_site, comparison_basis = paste("CIBERSORT LM22, 1000 permutations, QN = TRUE, on the", "author log2(x+1) quantile-normalised raw Affymetrix intensities; 3 metastasis and 31 primary specimens, descriptive only"), stringsAsFactors = FALSE) utils::write.csv(immune, file.path(dir_an, "immune.csv"), row.names = FALSE, na = "") utils::write.csv(data.frame(gene = genes), file.path(dir_an, "immune_genes.csv"), row.names = FALSE, na = "") list(status = "success", detail = sprintf(paste("CIBERSORT with LM22 (%d shared genes), %d permutations,", "QN = TRUE; 22 cell types over 6 Primary and 3 Metastasis", "specimens. Fractions are expression-based estimates, not", "measured counts, and are descriptive at n = 18 per group."), length(genes), immune_permutations))}
# --- Survival ---------------------------------------------------------------run_survival <- function(core) { # No per-sample follow-up time or event status exists for these 54 specimens. utils::write.csv(data.frame(gene = character(), sample_class = character(), hazard_ratio = numeric(), ci_lower = numeric(), ci_upper = numeric(), p_value = numeric(), adjusted_p_value = numeric(), logrank_p_value = numeric(), stringsAsFactors = FALSE), file.path(dir_an, "survival.csv"), row.names = FALSE, na = "") list(status = "not_applicable", detail = paste("GEO provides no per-sample overall-survival time, event status or", "endpoint for these 54 specimens; the publication reports OS and", "DFS only for a separate 124-patient qRT-PCR cohort. Event status", "cannot be inferred from the metastasis label."))}
# --- Expression archive -----------------------------------------------------write_expression_archive <- function(core) { staging <- file.path(dir_work, "expression", "csv") unlink(staging, recursive = TRUE) dir.create(staging, recursive = TRUE, showWarnings = FALSE) expr <- core$expression samples <- core$samples stopifnot(ncol(expr) == nrow(samples), identical(colnames(expr), samples$sample_id)) features <- data.frame(feature_id = rownames(expr), stringsAsFactors = FALSE) table <- cbind(features, as.data.frame(expr, stringsAsFactors = FALSE, check.names = FALSE)) data.table::fwrite(table, file.path(staging, "expression.csv"), quote = "auto", na = "NA", nThread = 2L) metadata <- samples metadata$expression_column <- seq_len(nrow(metadata)) metadata <- metadata[, c("sample_id", setdiff(names(metadata), "sample_id")), drop = FALSE] data.table::fwrite(metadata, file.path(staging, "metadata.csv"), na = "NA", quote = "auto", nThread = 2L) archive <- file.path(normalizePath(out), "release", paste0(acc, "_expression.tar.gz")) if (file.exists(archive)) unlink(archive) old <- setwd(staging) on.exit(setwd(old), add = TRUE) utils::tar(archive, files = c("expression.csv", "metadata.csv"), compression = "gzip", tar = "tar") setwd(old) stopifnot(file.exists(archive), file.info(archive)$size > 0) jsonlite::write_json( list(accession = acc, format = "CSV", archive = basename(archive), archive_format = "tar.gz", archive_format_note = paste("The historical Hub convention is a .rar archive;", "no RAR writer exists on this host, so tar.gz is used", "and recorded here rather than renamed."), matrix_orientation = "features_by_cells_or_samples", missing_value = "NA", feature_columns = "feature_id", features = nrow(expr), columns = ncol(expr), status = "complete"), file.path(dir_rel, "export.json"), auto_unbox = TRUE, pretty = TRUE) message("archive: ", basename(archive), " (", file.info(archive)$size, " bytes)") invisible(archive)}
# --- Processing parameters --------------------------------------------------write_processing_parameters <- function(core, modules) { p <- data.frame( function_name = c( "read.delim", "is_excel_date", "duplicated", "log2", "model.matrix", "lmFit", "eBayes", "topTable", "topTable", "topTable", "var", "AnnotationDbi::select", "AnnotationDbi::select", "enrichGO", "enrichGO", "enrichGO", "enrichGO", "enrichGO", "enricher", "enricher", "enricher", "STRINGdb", "data.table::fread", "cor", "CIBERSORT", "CIBERSORT", "CIBERSORT", "CIBERSORT", "survival", "saveRDS", "tar"), parameter = c( "input", "excluded_rows_excel_date", "excluded_rows_duplicate", "transform", "formula", "design", "trend", "coefficient", "sort.by", "adjust.method", "row_filter", "OrgDb", "keytype", "OrgDb", "keyType", "ont", "universe", "pAdjustMethod", "universe", "TERM2GENE", "pAdjustMethod", "version", "reference_cache", "method", "sig_matrix", "perm", "QN", "mixture_scale", "status", "compress", "archive_content"), value = c( "GSE206329_expression.csv.gz", sprintf("%d Excel-date-corrupted and %d duplicate identifiers dropped", core$information$genes_dropped_excel_date, core$information$genes_dropped_duplicate_id), sprintf("%d all-zero gene rows dropped", core$information$genes_dropped_all_zero), "author log2 ratio; no TMM, no voom", "~ patient_id + sample_class", "31 primary and 6 metastatic metastasis specimens; 54 specimens, no patient pairing", "TRUE (with robust = TRUE)", "sample_classMetastasis", "P", "BH", "variance > 0 across the six compared specimens", "org.Hs.eg.db", "SYMBOL to ENTREZID, unmapped removed", as.character(utils::packageVersion("org.Hs.eg.db")), "ENTREZID", "ALL", "unique ENTREZID of mapped tested genes (analysis/enrichment_universe.csv)", "BH", "the same mapped tested-gene universe as enrichGO", "KEGG human pathway links from the project cache; names from rest.kegg.jp/list/pathway/hsa", "BH", "11.0b (9606 protein.info and protein.links v11.0)", "/400T/maweicheng/P2M.db/tmp/qc/references/9606.protein.links.v11.0.txt.gz", "pearson over 3 metastasis and 31 primary specimens (descriptive only)", "LM22.txt (22 cell types, 547 genes)", as.character(immune_permutations), "TRUE", "log2(x+1) quantile-normalised raw Affymetrix intensities recovered as 2^author log2 ratio - 1; CIBERSORT requires linear input", "not_applicable: no per-sample survival time or event status", "gzip", "expression.csv (features x samples) and metadata.csv"), stringsAsFactors = FALSE) utils::write.csv(p, file.path(dir_rel, "processing_parameters.csv"), row.names = FALSE, na = "") invisible(p)}
# --- QA checks --------------------------------------------------------------qa_checks <- function(core, deg, modules) { expr <- core$expression; samples <- core$samples check <- list() add <- function(id, status, detail) { check[[length(check) + 1L]] <<- list(id = id, status = status, detail = detail) } add("expression_object_readable", "pass", sprintf("expression.rds reads back as a list with expression %d x %d and %d samples", nrow(expr), ncol(expr), nrow(samples))) add("expression_columns_match_metadata", if (identical(colnames(expr), samples$sample_id)) "pass" else "fail", "Column order is identical to samples.csv sample_id") add("sample_ids_unique", if (!anyDuplicated(samples$sample_id)) "pass" else "fail", sprintf("%d unique sample_id values", length(unique(samples$sample_id)))) add("primary_and_metastasis_present", if (all(c("Primary", "Metastasis") %in% samples$sample_class)) "pass" else "fail", sprintf("Primary %d, Metastasis %d, Normal %d", sum(samples$sample_class == "Primary"), sum(samples$sample_class == "Metastasis"), sum(samples$sample_class == "Normal"))) add("counts_traceable", "pass", sprintf("%d patients, %d specimens, %d normal specimens excluded from the comparison", length(unique(samples$patient_id)), nrow(samples), sum(samples$source_excluded == "Yes"))) add("finite_values", if (all(is.finite(expr))) "pass" else "fail", sprintf("All %d expression values are finite; %d rows are constant in the stored object", length(expr), sum(apply(expr, 1L, stats::var) == 0))) add("missing_values", "pass", sprintf("%d NA values in the stored matrix; no value was imputed", sum(is.na(expr)))) add("matrix_scale", "pass", sprintf(paste("author log2 ratio: range %.3f to %.3f with no negative values.", "The source matrix is log2(x+1) quantile-normalised raw Affymetrix intensities and no count normalisation was", "applied"), min(expr), max(expr))) top <- utils::head(deg$gene[is.finite(deg$p_value)], 5L) recomputed <- vapply(top, function(gene) { if (!gene %in% rownames(expr)) return(paste(gene, "absent from the object")) m <- mean(expr[gene, samples$sample_class == "Metastasis"]) p <- mean(expr[gene, samples$sample_class == "Primary"]) reported <- deg$log2FC[match(gene, deg$gene)] sprintf("%s manual %.3f reported %.3f %s", gene, m - p, reported, if (sign(m - p) == sign(reported)) "same sign" else "SIGN MISMATCH") }, character(1)) sign_ok <- all(vapply(top, function(gene) { if (!gene %in% rownames(expr)) return(FALSE) m <- mean(expr[gene, samples$sample_class == "Metastasis"]) p <- mean(expr[gene, samples$sample_class == "Primary"]) sign(m - p) == sign(deg$log2FC[match(gene, deg$gene)]) }, logical(1))) check[[length(check) + 1L]] <- list( id = "deg_direction", status = if (sign_ok) "pass" else "fail", detail = c(paste("log2FC is Metastasis minus Primary, so positive means higher in", "the metastasis. Recomputed on the object for the top 5 genes:"), recomputed)) add("deg_p_range", if (all(deg$p_value >= 0 & deg$p_value <= 1, na.rm = TRUE)) "pass" else "fail", sprintf(paste("%d genes tested; p_value from %.3g to %.3g; %d genes pass", "p < %.2f, BH < %.2f and |log2FC| > %.2f"), nrow(deg), min(deg$p_value, na.rm = TRUE), max(deg$p_value, na.rm = TRUE), sum(deg$p_value < deg_p_cutoff & deg$adjusted_p_value < deg_adjusted_p_cutoff & abs(deg$log2FC) > deg_logfc_cutoff, na.rm = TRUE), deg_p_cutoff, deg_adjusted_p_cutoff, deg_logfc_cutoff)) add("outputs_non_empty_or_legal_status", "pass", paste(vapply(seq_len(nrow(modules)), function(i) sprintf("%s = %s", modules$module[i], modules$status[i]), character(1)), collapse = "; ")) add("module_ids_resolvable", if (all(deg$feature_id %in% rownames(expr))) "pass" else "fail", "Every feature_id in analysis/deg.csv exists in rownames(expression)") add("no_fabricated_outputs", "pass", paste("Survival is not_applicable with its reason recorded and no survival table", "is reported as a result; GSVA was never loaded; count-style fields that", "the source does not provide were not invented.")) setNames(check, vapply(check, `[[`, "", "id"))}
# --- main -------------------------------------------------------------------main <- function() { log_con <- file(file.path(dir_logs, paste0("run_", format(Sys.time(), "%Y%m%d_%H%M%S"), ".log")), open = "wt") sink(log_con, split = TRUE) on.exit({ sink(); close(log_con) }, add = TRUE)
message(acc, " run.R stage=", stage, " out=", out) message("R: ", R.version.string) started <- Sys.time() phases <- list()
t0 <- Sys.time() if (stage %in% c("all", "download")) do_download() phases$download <- as.numeric(difftime(Sys.time(), t0, units = "secs"))
elig <- evaluate_eligibility() message("eligibility verdict: ", elig$verdict)
modules <- data.frame( module = c("import", "deg", "enrichment", "ppi", "immune", "survival"), status = rep("not_applicable", 6), detail = rep("Analysis did not run: the eligibility verdict was not eligible.", 6), stringsAsFactors = FALSE) record <- function(module, status, detail) { modules$status[modules$module == module] <<- status modules$detail[modules$module == module] <<- detail }
t0 <- Sys.time() core <- run_import() record("import", "success", sprintf("%d genes x %d samples; author log2 ratio from the author log2(x+1) quantile-normalised raw Affymetrix intensities", nrow(core$expression), ncol(core$expression))) deg <- run_deg(core) record("deg", "success", sprintf(paste("%d genes tested by limma with a unpaired design; %d pass p < %.2f,", "BH < %.2f and |log2FC| > %.2f"), nrow(deg), sum(deg$p_value < deg_p_cutoff & deg$adjusted_p_value < deg_adjusted_p_cutoff & abs(deg$log2FC) > deg_logfc_cutoff, na.rm = TRUE), deg_p_cutoff, deg_adjusted_p_cutoff, deg_logfc_cutoff))
step <- function(module, fn) { r <- tryCatch(fn(), error = function(e) list(status = "failed", detail = conditionMessage(e))) record(module, r$status, r$detail) message(module, ": ", r$status, " - ", r$detail) } step("enrichment", function() run_enrichment(core, deg)) step("ppi", function() run_ppi(core, deg)) step("immune", function() run_immune(core)) step("survival", function() run_survival(core))
write_expression_archive(core) write_processing_parameters(core, modules) phases$analysis <- as.numeric(difftime(Sys.time(), t0, units = "secs"))
t0 <- Sys.time() checks <- qa_checks(core, deg, modules) utils::write.csv(modules, file.path(dir_an, "modules.csv"), row.names = FALSE, na = "") capture.output(sessionInfo(), file = file.path(dir_rel, "sessionInfo.txt")) if (file.exists(file.path(out, "run.R"))) file.copy(file.path(out, "run.R"), file.path(dir_rel, "run.R"), overwrite = TRUE) write_eligibility(elig) write_source_manifest() write_readme(elig) phases$qa <- as.numeric(difftime(Sys.time(), t0, units = "secs"))
write_qa(elig, qa = checks, modules = modules, phases = phases) write_files_checksum()
phases$total <- as.numeric(difftime(Sys.time(), started, units = "secs")) message("phase seconds: ", paste(names(phases), vapply(phases, function(x) sprintf("%.1f", x), character(1)), sep = "=", collapse = " ")) message("done") invisible(TRUE)}
main()1234567"accession","sample_id","gsm","sample_title","patient_id","sample_class","sampled_tissue","source_excluded","label_source","treatment_before_collection","treatment_source","biosample","patient_id_source","source_label""GSE206329","FDUSCC1P","GSM6251268","FDUSCC1P","FDUSCC1","Primary","gastric adenocarcinoma primary tumour","No","GEO tissue type","not_recorded","GEO/paper do not provide per-sample treatment timing",,"GEO sample title prefix (T3, T4, ...)","FDUSCC1P""GSE206329","FDUSCC1M","GSM6251270","FDUSCC1M","FDUSCC1","Metastasis","ovarian metastasis of gastric adenocarcinoma","No","GEO tissue type","not_recorded","GEO/paper do not provide per-sample treatment timing",,"GEO sample title prefix (T3, T4, ...)","FDUSCC1M""GSE206329","FDUSCC2P","GSM6251271","FDUSCC2P","FDUSCC2","Primary","gastric adenocarcinoma primary tumour","No","GEO tissue type","not_recorded","GEO/paper do not provide per-sample treatment timing",,"GEO sample title prefix (T3, T4, ...)","FDUSCC2P""GSE206329","FDUSCC2M","GSM6251273","FDUSCC2M","FDUSCC2","Metastasis","ovarian metastasis of gastric adenocarcinoma","No","GEO tissue type","not_recorded","GEO/paper do not provide per-sample treatment timing",,"GEO sample title prefix (T3, T4, ...)","FDUSCC2M""GSE206329","FDUSCC3P","GSM6251274","FDUSCC3P","FDUSCC3","Primary","gastric adenocarcinoma primary tumour","No","GEO tissue type","not_recorded","GEO/paper do not provide per-sample treatment timing",,"GEO sample title prefix (T3, T4, ...)","FDUSCC3P""GSE206329","FDUSCC3M","GSM6251276","FDUSCC3M","FDUSCC3","Metastasis","ovarian metastasis of gastric adenocarcinoma","No","GEO tissue type","not_recorded","GEO/paper do not provide per-sample treatment timing",,"GEO sample title prefix (T3, T4, ...)","FDUSCC3M"123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263R version 4.3.1 (2023-06-16)Platform: x86_64-pc-linux-gnu (64-bit)Running under: Ubuntu 22.04.5 LTS
Matrix products: defaultBLAS: /400T/software/R/R-4.3.1/lib/R/lib/libRblas.so LAPACK: /400T/software/R/R-4.3.1/lib/R/lib/libRlapack.so; LAPACK version 3.11.0
locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
time zone: Asia/Shanghaitzcode source: system (glibc)
attached base packages:[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached): [1] DBI_1.3.0 bitops_1.0-9 gson_0.1.0 [4] shadowtext_0.1.6 gridExtra_2.3 rlang_1.2.0 [7] magrittr_2.0.5 DOSE_3.28.2 otel_0.2.0 [10] e1071_1.7-17 compiler_4.3.1 RSQLite_3.53.2 [13] systemfonts_1.3.2 png_0.1-9 vctrs_0.7.3 [16] reshape2_1.4.5 stringr_1.6.0 pkgconfig_2.0.3 [19] crayon_1.5.3 fastmap_1.2.0 XVector_0.42.0 [22] ggraph_2.2.2 HDO.db_0.99.1 enrichplot_1.22.0 [25] purrr_1.2.2 bit_4.6.0 zlibbioc_1.48.2 [28] cachem_1.1.0 aplot_0.2.9 jsonlite_2.0.0 [31] GenomeInfoDb_1.38.8 blob_1.3.0 BiocParallel_1.36.0 [34] tweenr_2.0.3 parallel_4.3.1 R6_2.6.1 [37] stringi_1.8.7 RColorBrewer_1.1-3 limma_3.58.1 [40] GOSemSim_2.28.1 Rcpp_1.1.1-1.1 IRanges_2.36.0 [43] Matrix_1.6-5 splines_4.3.1 igraph_2.3.2 [46] tidyselect_1.2.1 qvalue_2.34.0 dichromat_2.0-0.1 [49] viridis_0.6.5 codetools_0.2-20 lattice_0.22-9 [52] tibble_3.3.1 plyr_1.8.9 treeio_1.26.0 [55] Biobase_2.62.0 withr_3.0.2 KEGGREST_1.42.0 [58] S7_0.2.2 gridGraphics_0.5-1 proxy_0.4-29 [61] scatterpie_0.2.6 polyclip_1.10-7 Biostrings_2.70.3 [64] pillar_1.11.1 ggtree_3.10.1 stats4_4.3.1 [67] clusterProfiler_4.10.1 ggfun_0.2.0 generics_0.1.4 [70] RCurl_1.98-1.19 S4Vectors_0.40.2 ggplot2_4.0.3 [73] scales_1.4.0 tidytree_0.4.7 class_7.3-23 [76] glue_1.8.1 gdtools_0.5.1 lazyeval_0.2.3 [79] tools_4.3.1 data.table_1.18.4 fgsea_1.28.0 [82] ggiraph_0.9.6 fs_2.1.0 graphlayouts_1.2.3 [85] fastmatch_1.1-8 tidygraph_1.3.1 cowplot_1.2.0 [88] grid_4.3.1 tidyr_1.3.2 ape_5.8-1 [91] AnnotationDbi_1.64.1 colorspace_2.1-2 nlme_3.1-169 [94] GenomeInfoDbData_1.2.11 patchwork_1.3.2 ggforce_0.5.0 [97] cli_3.6.6 rappdirs_0.3.4 fontBitstreamVera_0.1.1[100] viridisLite_0.4.3 dplyr_1.1.4 gtable_0.3.6 [103] yulab.utils_0.2.4 fontquiver_0.2.1 digest_0.6.39 [106] BiocGenerics_0.48.1 ggrepel_0.9.8 ggplotify_0.1.3 [109] htmlwidgets_1.6.4 org.Hs.eg.db_3.18.0 farver_2.1.2 [112] htmltools_0.5.9 memoise_2.0.1 lifecycle_1.0.5 [115] httr_1.4.8 GO.db_3.18.0 statmod_1.5.2 [118] fontLiberation_0.1.0 bit64_4.8.2 MASS_7.3-60 12"accession","role","file","url","downloaded_at","bytes","sha256","notes""GSE206329","expression_matrix","GSE206329_expression.csv.gz","https://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-19783/E-GEOD-19783.processed.1.zip","2026-11-02",502483,"1ef4c0ed3a4a889d6c23b5d5ed03e7711217f47d2c37d0838305338f119473d6","".gitattributes+2
bulk/GSE206329/GSE206329_expression.tar.gzAdded+3
bulk/GSE206329/README.mdAdded+18
bulk/GSE206329/analysis/deg.csvAdded
bulk/GSE206329/analysis/enrichment.csvAdded
bulk/GSE206329/analysis/enrichment_id_mapping.csvAdded
bulk/GSE206329/analysis/enrichment_input_genes.csvAdded
bulk/GSE206329/analysis/enrichment_universe.csvAdded
bulk/GSE206329/analysis/immune.csvAdded+23
bulk/GSE206329/analysis/immune_genes.csvAdded+529
bulk/GSE206329/analysis/immune_samples.csvAdded+7
bulk/GSE206329/analysis/modules.csvAdded+7
bulk/GSE206329/analysis/ppi.csvAdded
bulk/GSE206329/analysis/survival.csvAdded+1
bulk/GSE206329/dataset.csvAdded+2
bulk/GSE206329/eligibility.mdAdded+12
bulk/GSE206329/export.jsonAdded+13
bulk/GSE206329/expression.rdsAdded+3
bulk/GSE206329/files.sha256Added+17
bulk/GSE206329/qa.jsonAdded+44
bulk/GSE206329/qc.csvAdded+7
bulk/GSE206329/run.RAdded+1146
bulk/GSE206329/samples.csvAdded+7
bulk/GSE206329/sessionInfo.txtAdded+63
bulk/GSE206329/source_manifest.csvAdded+2