Skip to content

Commit

Permalink
feat: ✨ match spreadsheet id format with sds format
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobiClark committed Dec 4, 2023
1 parent af779e8 commit 526278e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions scripts/guided-mode/guided-curate-dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -11338,13 +11338,13 @@ ipcRenderer.on("selected-create-dataset-structure-spreadsheet-path", async (even
.getElementById("guided-button-spreadsheet-subjects-have-samples")
.classList.contains("selected");

const headers = ["Subject ID"];
const headers = ["subject id"];

if (datasetHasPools) {
headers.push("Pool ID");
headers.push("pool id");
}
if (datasetHasSamples) {
headers.push("Sample ID");
headers.push("sample id");
}

for (i = 0; i < headers.length; i++) {
Expand Down Expand Up @@ -11406,7 +11406,7 @@ const validateDatasetStructureSpreadsheet = async (sheetData) => {
}
// 1. Loop through the spreadsheet rows and find subs, pools, and sams that do not have valid names
for (const row of sheetData) {
const subjectName = lowercaseFirstLetter(row["Subject ID"]);
const subjectName = lowercaseFirstLetter(row["subject id"]);
if (!subjectName) {
continue;
}
Expand All @@ -11423,7 +11423,7 @@ const validateDatasetStructureSpreadsheet = async (sheetData) => {
continue;
}

const poolName = lowercaseFirstLetter(row["Pool ID"]);
const poolName = lowercaseFirstLetter(row["pool id"]);

if (poolName) {
if (!poolName.startsWith("pool-")) {
Expand All @@ -11450,7 +11450,7 @@ const validateDatasetStructureSpreadsheet = async (sheetData) => {
}
}

const sampleName = lowercaseFirstLetter(row["Sample ID"]);
const sampleName = lowercaseFirstLetter(row["sample id"]);
console.log("SAMPLENAME", sampleName);
if (sampleName) {
if (!sampleName.startsWith("sam-")) {
Expand Down Expand Up @@ -11553,9 +11553,9 @@ document
}

for (const row of sheetData) {
const subjectName = lowercaseFirstLetter(row["Subject ID"]);
const subjectsPool = lowercaseFirstLetter(row["Pool ID"]);
const sampleName = lowercaseFirstLetter(row["Sample ID"]);
const subjectName = lowercaseFirstLetter(row["subject id"]);
const subjectsPool = lowercaseFirstLetter(row["pool id"]);
const sampleName = lowercaseFirstLetter(row["sample id"]);

// Check to see if the subject already exists
const subjectAlreadyExists = getExistingSubjectNames().includes(subjectName);
Expand Down

0 comments on commit 526278e

Please sign in to comment.