Public
Edited
Jan 3
Insert cell
Insert cell
Insert cell
module = import("https://episphere.github.io/msig/main.js")
// module = import("http://127.0.0.1:5500/main.js")
Insert cell
mSigSDK = module.mSigSDK
Insert cell
Insert cell
Insert cell
Insert cell
viewof WGS_data_tsv = Inputs.file({label: "Input MAF file here: ", accept: ".maf", required: true, multiple: true})
Insert cell
// Asynchronous computation for WGS_data
WGS_data = await Promise.all(WGS_data_tsv.map(file => file.tsv()));
Insert cell
Insert cell
Insert cell
viewof tsvfile = Inputs.file({label: "Input bed file here: ", accept: ".bed", required: true})
Insert cell
bed_file = tsvfile.tsv()
Insert cell
// viewof numberOfPanelPatients = Inputs.range([1, 11], {value: 2, step: 1, label: "Number of Patients to Downsample"})
Insert cell
msk_impact_panel_data = mSigSDK.userData.convertWGStoPanel(WGS_data, bed_file)
Insert cell
Insert cell
mutational_spectra_panel = mSigSDK.userData.convertMatrix(msk_impact_panel_data, "center")
Insert cell
Insert cell
Insert cell
Insert cell
viewof numberOfWGSPatients = Inputs.range([1, 11], {value: WGS_data.length, step: 1, label: "Number of WGS Patients"})
Insert cell
WGS_data_mutational_spectra = mSigSDK.userData.convertMatrix(WGS_data.slice(0,numberOfWGSPatients), "Center")
Insert cell
Insert cell
JSONData = mSigSDK.userData.convertMutationalSpectraIntoJSON(WGS_data.slice(0,numberOfWGSPatients), WGS_data_mutational_spectra, "Center")
Insert cell
mSigSDK.mSigPortal.mSigPortalPlots.plotPatientMutationalSpectrum(JSONData, "mutationalSpectrumMatrixWGSICGC");
Insert cell
Insert cell
Insert cell
cosSimilarityICGC = mSigSDK.mSigPortal.mSigPortalPlots.plotCosineSimilarityHeatMap(JSONData ,"ICGC", "WGS", "COAD-US", "cosineSimilarityHeatMapICGC", true, "RdBu", true);
Insert cell
Insert cell
Insert cell
mutationalSignatures = await mSigSDK.mSigPortal.mSigPortalData.getMutationalSignaturesData("WGS", "COSMIC_v3_Signatures_GRCh37_SBS96", "SBS", 96, 10000)
Insert cell
mutationalSignaturesExtracted = await mSigSDK.mSigPortal.mSigPortalData.extractMutationalSpectra(mutationalSignatures, "signatureName")
Insert cell
Insert cell
extractedPatientData = mSigSDK.mSigPortal.mSigPortalData.extractMutationalSpectra(JSONData)
Insert cell
nnlsExposures = mSigSDK.signatureFitting.fitMutationalSpectraToSignatures(mutationalSignaturesExtracted, extractedPatientData, { exposureThreshold: 0.02, exposureType: "absolute" })
Insert cell
Insert cell
mSigSDK.signatureFitting.plotPatientMutationalSignaturesExposure(nnlsExposures[Object.keys(nnlsExposures)[0]], "exposureGraph", Object.keys(nnlsExposures)[0])
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more