Skip to content

Commit

Permalink
Fixed mSigPortal APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronge-2020 committed Oct 27, 2023
1 parent fe5c2ac commit 6729a8a
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 8 deletions.
27 changes: 24 additions & 3 deletions bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -8360,7 +8360,13 @@ async function getMutationalSignatureLandscapeData(
signatureSetName = "COSMIC_v3_Signatures_GRCh37_SBS96",
numberOfResults = 10
) {
const url = `https://analysistools-dev.cancer.gov/mutational-signatures/api/signature_activity?study=${study}&strategy=${genomeDataType}&signatureSetName=${signatureSetName}&cancer=${cancerType}&limit=${numberOfResults}&offset=0`;
let url = '';
if (cancerType == "") {
url = `https://analysistools-dev.cancer.gov/mutational-signatures/api/signature_activity?study=${study}&strategy=${genomeDataType}&signatureSetName=${signatureSetName}&limit=${numberOfResults}&offset=0`;

}else {
url = `https://analysistools-dev.cancer.gov/mutational-signatures/api/signature_activity?study=${study}&strategy=${genomeDataType}&signatureSetName=${signatureSetName}&limit=${numberOfResults}&cancer=${cancerType}&offset=0`;
}
const cacheName = "getMutationalSignatureLandscapeData";
return await (await fetchURLAndCache(cacheName, url)).json();
}
Expand Down Expand Up @@ -8396,7 +8402,14 @@ async function getMutationalSignatureEtiologyOptions(
cancerType = "",
numberOfResults = 10
) {
const url = `https://analysistools-dev.cancer.gov/mutational-signatures/api/signature_etiology_options?study=${study}&strategy=${genomeDataType}&signatureName=${signatureName}&cancer=${cancerType}&limit=${numberOfResults}&offset=0`;
let url = '';

if (cancerType == "") {
url = `https://analysistools-dev.cancer.gov/mutational-signatures/api/signature_etiology_options?study=${study}&strategy=${genomeDataType}&signatureName=${signatureName}&limit=${numberOfResults}&offset=0`;
}else {
url = `https://analysistools-dev.cancer.gov/mutational-signatures/api/signature_etiology_options?study=${study}&strategy=${genomeDataType}&signatureName=${signatureName}&cancer=${cancerType}&limit=${numberOfResults}&offset=0`;
}

const cacheName = "getMutationalSignatureEtiologyOptions";
return await (await fetchURLAndCache(cacheName, url)).json();
}
Expand All @@ -8421,7 +8434,15 @@ async function getMutationalSignatureEtiologyData(
cancerType = "",
numberOfResults = 10
) {
const url = `https://analysistools-dev.cancer.gov/mutational-signatures/api/signature_etiology?study=${study}&strategy=${genomeDataType}&signatureName=${signatureName}&cancer=${cancerType}&limit=${numberOfResults}&offset=0`;
let url = '';

if (cancerType == "") {
url = `https://analysistools-dev.cancer.gov/mutational-signatures/api/signature_etiology?study=${study}&strategy=${genomeDataType}&signatureName=${signatureName}&limit=${numberOfResults}&offset=0`;
}
else {
url = `https://analysistools-dev.cancer.gov/mutational-signatures/api/signature_etiology?study=${study}&strategy=${genomeDataType}&signatureName=${signatureName}&cancer=${cancerType}&limit=${numberOfResults}&offset=0`;
}

const cacheName = "getMutationalSignatureEtiologyData";
return await (await fetchURLAndCache(cacheName, url)).json();
}
Expand Down
27 changes: 24 additions & 3 deletions mSigSDKScripts/mSigPortalAPIs.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,13 @@ export async function getMutationalSignatureLandscapeData(
signatureSetName = "COSMIC_v3_Signatures_GRCh37_SBS96",
numberOfResults = 10
) {
const url = `https://analysistools-dev.cancer.gov/mutational-signatures/api/signature_activity?study=${study}&strategy=${genomeDataType}&signatureSetName=${signatureSetName}&cancer=${cancerType}&limit=${numberOfResults}&offset=0`;
let url = '';
if (cancerType == "") {
url = `https://analysistools-dev.cancer.gov/mutational-signatures/api/signature_activity?study=${study}&strategy=${genomeDataType}&signatureSetName=${signatureSetName}&limit=${numberOfResults}&offset=0`;

}else{
url = `https://analysistools-dev.cancer.gov/mutational-signatures/api/signature_activity?study=${study}&strategy=${genomeDataType}&signatureSetName=${signatureSetName}&limit=${numberOfResults}&cancer=${cancerType}&offset=0`;
}
const cacheName = "getMutationalSignatureLandscapeData";
return await (await fetchURLAndCache(cacheName, url)).json();
}
Expand Down Expand Up @@ -369,7 +375,14 @@ export async function getMutationalSignatureEtiologyOptions(
cancerType = "",
numberOfResults = 10
) {
const url = `https://analysistools-dev.cancer.gov/mutational-signatures/api/signature_etiology_options?study=${study}&strategy=${genomeDataType}&signatureName=${signatureName}&cancer=${cancerType}&limit=${numberOfResults}&offset=0`;
let url = '';

if (cancerType == "") {
url = `https://analysistools-dev.cancer.gov/mutational-signatures/api/signature_etiology_options?study=${study}&strategy=${genomeDataType}&signatureName=${signatureName}&limit=${numberOfResults}&offset=0`;
}else{
url = `https://analysistools-dev.cancer.gov/mutational-signatures/api/signature_etiology_options?study=${study}&strategy=${genomeDataType}&signatureName=${signatureName}&cancer=${cancerType}&limit=${numberOfResults}&offset=0`;
}

const cacheName = "getMutationalSignatureEtiologyOptions";
return await (await fetchURLAndCache(cacheName, url)).json();
}
Expand All @@ -394,7 +407,15 @@ export async function getMutationalSignatureEtiologyData(
cancerType = "",
numberOfResults = 10
) {
const url = `https://analysistools-dev.cancer.gov/mutational-signatures/api/signature_etiology?study=${study}&strategy=${genomeDataType}&signatureName=${signatureName}&cancer=${cancerType}&limit=${numberOfResults}&offset=0`;
let url = '';

if (cancerType == "") {
url = `https://analysistools-dev.cancer.gov/mutational-signatures/api/signature_etiology?study=${study}&strategy=${genomeDataType}&signatureName=${signatureName}&limit=${numberOfResults}&offset=0`;
}
else{
url = `https://analysistools-dev.cancer.gov/mutational-signatures/api/signature_etiology?study=${study}&strategy=${genomeDataType}&signatureName=${signatureName}&cancer=${cancerType}&limit=${numberOfResults}&offset=0`;
}

const cacheName = "getMutationalSignatureEtiologyData";
return await (await fetchURLAndCache(cacheName, url)).json();
}
Expand Down
4 changes: 2 additions & 2 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ await fetch("https://api.gdc.cancer.gov/data/0b3d2db3-8ae3-4d39-bd9b-9d1e7a133b6

// Testing UMAP
mSigSDK = await (await import("./main.js")).mSigSDK;
cancerType = "Lung-AdenoCA"
data = await mSigSDK.mSigPortal.mSigPortalData.getMutationalSignatureActivityData('PCAWG','WGS','COSMIC_v3_Signatures_GRCh37_SBS96','',10)
// cancerType = "Lung-AdenoCA"
getMutationalSignatureEtiologyOptions = mSigSDK.mSigPortal.mSigPortalData.getMutationalSignatureEtiologyOptions()

0 comments on commit 6729a8a

Please sign in to comment.