------------------------------------------------------------
commit 2565cef6f1097894219e5700a555a67327e24441
Author: Breck Yunits <breck7@gmail.com> Date: Sun Sep 15 17:28:47 2024 -1000 diff --git a/pages/explore.scroll b/pages/explore.scroll index 21d8713b6..989e25550 100644 --- a/pages/explore.scroll +++ b/pages/explore.scroll @@ -7,7 +7,7 @@ printTitle endSnippet -table ../cancerdb.json +table ../cancerdb.tsv orderBy -measurements select id measurements type wikipedia website printTable ------------------------------------------------------------
commit 6c8c66db214ee28a91e5684ef701bf2ea9534159
Author: Breck Yunits <breck7@gmail.com> Date: Sun Sep 15 17:27:28 2024 -1000 diff --git a/code/measures.parsers b/code/measures.parsers index a47c44ad5..0a075bc6f 100644 --- a/code/measures.parsers +++ b/code/measures.parsers @@ -17,31 +17,31 @@ abstractHashMapMeasureParser abstractCountMeasureParser description A positive count of something. People, for example. Min is 0. - cells measureNameCell countCell + atoms measureNameAtom countAtom extends abstractIntegerMeasureParser abstractYearMeasureParser - cells measureNameCell yearCell + atoms measureNameAtom yearAtom extends abstractIntegerMeasureParser abstractAnnualPopulationCountParser - cells yearCell countCell - uniqueFirstWord + atoms yearAtom countAtom + uniqueFirstAtom abstractAnnualPopulationCountMapParser catchAllParser abstractAnnualPopulationCountParser description A map of counts, one per year. extends abstractHashMapMeasureParser -// todo: idCell +// todo: idAtom // Links between concepts abstractConceptIdsMeasureParser description Link one concept to other concepts. - catchAllCellType stringCell + catchAllAtomType stringAtom string typeForWebForms textarea extends abstractStringMeasureParser javascript get conceptIds() { - return this.getWordsFrom(1) + return this.getAtomsFrom(1) } // todo: re-add the method to update these foreign keys if an ID changes. @@ -61,7 +61,7 @@ amazonParser // annualDeathsReport annualDeathsReportParser - cells measureNameCell stringCell urlCell + atoms measureNameAtom stringAtom urlAtom description Data from an annual report on cancer deaths for a particular country. extends abstractAnnualPopulationCountMapParser @@ -78,13 +78,13 @@ cancerDotOrgParser description What is the URL for this cancer type on cancer.org? // cancerTypes - // cancerTypeCell + // cancerTypeAtom enum breast prostate cervical colon lung skin bladder kidney lymphoma multiplemyeloma ovarian thyroid endometrial neuroendocrine liver leukemia oral paint constant.language cancerTypesParser description Which cancer type(s) does this entity specialize in? - cells measureNameCell stringCell - catchAllCellType stringCell + atoms measureNameAtom stringAtom + catchAllAtomType stringAtom extends abstractEnumMeasureParser // charityRegistries @@ -110,7 +110,7 @@ greatNonProfitsParser // chemistry abstractChemicalGuidParser - extends abstractWordMeasureParser + extends abstractAtomMeasureParser float sortIndex 6 // company @@ -151,12 +151,12 @@ drugBankParser description What is the DrugBank ID of this drug? // drugs - // Todo: support custom cell types in Scroll? - routesOfAdministrationCell + // Todo: support custom atom types in Scroll? + routesOfAdministrationAtom enum oral topical intravenous subcutaneousInjection intramuscularInjection intravesical routesOfAdministrationParser - cells measureNameCell stringCell - catchAllCellType stringCell + atoms measureNameAtom stringAtom + catchAllAtomType stringAtom extends abstractEnumMeasureParser description What is the route of administration for this drug? @@ -219,7 +219,7 @@ instagramParser // irs einParser description What is their U.S. Employer Identification Number? - extends abstractWordMeasureParser + extends abstractAtomMeasureParser float sortIndex 60 // kegg @@ -238,21 +238,21 @@ linkedinParser // location // - countryCodeCell - extends stringCell - countryNameCell - extends stringCell - cityStateCell - extends stringCell + countryCodeAtom + extends stringAtom + countryNameAtom + extends stringAtom + cityStateAtom + extends stringAtom countryParser description In what country is this? - catchAllCellType stringCell + catchAllAtomType stringAtom // todo make country a wwc kind extends abstractStringMeasureParser float sortIndex 8 cityParser description What city and state is this in? - catchAllCellType stringCell + catchAllAtomType stringAtom extends abstractStringMeasureParser float sortIndex 8 @@ -327,7 +327,7 @@ usNewsRankParser nciCodeParser description What is the NCI code for this concept? - extends abstractWordMeasureParser + extends abstractAtomMeasureParser string sourceDomain ncithesaurus.nci.nih.gov float sortIndex 2 @@ -338,12 +338,12 @@ mainTypeParser string sourceDomain oncotree.mskcc.org oncoTreeIdParser description What is the OncoTree ID for this cancer type? - extends abstractWordMeasureParser + extends abstractAtomMeasureParser string sourceDomain oncotree.mskcc.org float sortIndex 2 parentOncoTreeIdParser description What is the OncoTree ID for the parent of this cancer type? - extends abstractWordMeasureParser + extends abstractAtomMeasureParser string sourceDomain oncotree.mskcc.org float sortIndex 2 oncoTreeLevelParser @@ -376,12 +376,12 @@ membersParser description How many members does this organization have? // periodicals - publicationFrequencyCell + publicationFrequencyAtom enum daily weekly biweekly monthly quarterly semiannually annually publicationFrequencyParser extends abstractEnumMeasureParser description How often does the publication come out? - cells measureNameCell stringCell + atoms measureNameAtom stringAtom // phoneNumber phoneNumberParser @@ -481,13 +481,13 @@ twitterParser extends abstractFollowersParser // type - // typeCell + // typeAtom enum cancerType book company publicCompany drug chemotherapyDrug journal nationalCancerInstitute intergovernmentalCancerOrganization nationalGovernmentAgency stateGovernmentOrganization researchCenter paper anthracycline alkylatingAgent taxane researchHospital nciCancerCenter registry website cancerNonProfit nonProfit breathTreatment exercise mentalTreatment vitamin touchTreatment surgery organTransplant documentary lifestyle diet hospital childrensHospital professionalOrganization app caregiverService software lotion device clothing prosthetic subreddit toxinAvoidance hospiceCareService immunotherapy ctScan ultrasound imagingProcedure herbal diagnosticTest onlineForum majorResearchEffort onlineDatabase organizationDivision internationalOrganization consortium governmentFundedNonProfit awarenessEvent recurringEvent routeOfAdministration magazine procedure onlineCourse ontology microscope ablationProcedure tyrosineKinaseInhibitor radiationTherapy chemotherapyProcedure treatmentCenter paint constant.language typeParser description What kind of concept is this? - cells measureNameCell stringCell - catchAllCellType stringCell + atoms measureNameAtom stringAtom + catchAllAtomType stringAtom extends abstractEnumMeasureParser required float sortIndex 1.123 @@ -495,7 +495,7 @@ typeParser // umls umlsParser description What is the Unified Medical Language System ID for this? - extends abstractWordMeasureParser + extends abstractAtomMeasureParser string sourceDomain www.nlm.nih.gov float sortIndex 2 @@ -506,7 +506,7 @@ uscsIdParser string sourceDomain cdc.gov float sortIndex 4 uscsTableParser - cells measureNameCell yearCell + atoms measureNameAtom yearAtom description What is the data for this year from https://www.cdc.gov/cancer/uscs/dataviz/download_data.htm? extends abstractDelimitedValuesBlobMeasureParser string sourceDomain cdc.gov @@ -542,7 +542,7 @@ eventsPageParser description What is the URL to this entity's events page? domainNameParser description What is the domain name owned by this entity, if any? - extends abstractWordMeasureParser + extends abstractAtomMeasureParser inScope registeredParser contentKey domain float sortIndex 110 diff --git a/package.json b/package.json index 6a725f177..ffe50d74e 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "homepage": "https://cancerdb.com", "devDependencies": { "lodash": "^4.17.21", - "scroll-cli": "^132.0.0", - "scrollsdk": "^86.0.0" + "scroll-cli": "^133.0.0", + "scrollsdk": "^87.0.0" } } ------------------------------------------------------------
commit 46f0cf5eca41d0e19030e221856de95cbd8aab24
Author: Breck Yunits <breck7@gmail.com> Date: Sat Sep 14 13:35:37 2024 -1000 diff --git a/package.json b/package.json index e85286543..6a725f177 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "homepage": "https://cancerdb.com", "devDependencies": { "lodash": "^4.17.21", - "scroll-cli": "^131.0.0", - "scrollsdk": "^84.0.0" + "scroll-cli": "^132.0.0", + "scrollsdk": "^86.0.0" } } ------------------------------------------------------------
commit 7afc45190651f23e3a4750f4104b90a67ab5305f
Author: Breck Yunits <breck7@gmail.com> Date: Sat Sep 14 11:29:58 2024 -1000 diff --git a/package.json b/package.json index 562ec6040..e85286543 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "homepage": "https://cancerdb.com", "devDependencies": { "lodash": "^4.17.21", - "scroll-cli": "^130.5.0", + "scroll-cli": "^131.0.0", "scrollsdk": "^84.0.0" } } ------------------------------------------------------------
commit 5064ec7c139422a016fa54f746423195038d1ec9
Author: Breck Yunits <breck7@gmail.com> Date: Fri Sep 13 17:10:33 2024 -1000 diff --git a/package.json b/package.json index ccfff4024..562ec6040 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "homepage": "https://cancerdb.com", "devDependencies": { "lodash": "^4.17.21", - "scroll-cli": "^130.3.5", + "scroll-cli": "^130.5.0", "scrollsdk": "^84.0.0" } } ------------------------------------------------------------
commit bfa4dc9f6651f3863234bf5e426026fa1183a5f1
Author: Breck Yunits <breck7@gmail.com> Date: Wed Sep 11 15:26:26 2024 -1000 diff --git a/cli.js b/cli.js index ff0840b8d..1727e75cf 100755 --- a/cli.js +++ b/cli.js @@ -5,6 +5,7 @@ const { Utils } = require("scrollsdk/products/Utils.js") const { ScrollSetCLI } = require("scroll-cli/ScrollSetCLI.js") class CancerDBCli extends ScrollSetCLI { + baseFolder = __dirname conceptsFolder = path.join(__dirname, "concepts") parsersFile = path.join(__dirname, "code", "measures.parsers") scrollSetName = "cancerdb" diff --git a/package.json b/package.json index 723df782d..ccfff4024 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "homepage": "https://cancerdb.com", "devDependencies": { "lodash": "^4.17.21", - "scroll-cli": "^130.3.4", + "scroll-cli": "^130.3.5", "scrollsdk": "^84.0.0" } } ------------------------------------------------------------
commit afbe4d309d01668635c11a66424cd2002ec90ffb
Author: Breck Yunits <breck7@gmail.com> Date: Tue Sep 10 16:29:19 2024 -1000 diff --git a/package.json b/package.json index 06997f161..723df782d 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "homepage": "https://cancerdb.com", "devDependencies": { "lodash": "^4.17.21", - "scroll-cli": "^130.3.3", + "scroll-cli": "^130.3.4", "scrollsdk": "^84.0.0" } } ------------------------------------------------------------
commit 9bc8ae26d0b5a841c3cc2c710adf6e00b425c3d1
Author: Breck Yunits <breck7@gmail.com> Date: Tue Sep 10 16:25:14 2024 -1000 diff --git a/cli.js b/cli.js index 1a278eb73..ff0840b8d 100755 --- a/cli.js +++ b/cli.js @@ -6,7 +6,7 @@ const { ScrollSetCLI } = require("scroll-cli/ScrollSetCLI.js") class CancerDBCli extends ScrollSetCLI { conceptsFolder = path.join(__dirname, "concepts") - parsersFile = "code/measures.parsers" + parsersFile = path.join(__dirname, "code", "measures.parsers") scrollSetName = "cancerdb" compiledConcepts = "./cancerdb.json" } diff --git a/package.json b/package.json index 1ef584d99..06997f161 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "homepage": "https://cancerdb.com", "devDependencies": { "lodash": "^4.17.21", - "scroll-cli": "^130.3.1", + "scroll-cli": "^130.3.3", "scrollsdk": "^84.0.0" } } ------------------------------------------------------------
commit 3e1db6e5d988e81ace39503b27eac1cab49f079e
Author: Breck Yunits <breck7@gmail.com> Date: Mon Sep 9 04:26:19 2024 -1000 diff --git a/ScrollSet.js b/ScrollSet.js deleted file mode 100644 index ccd42ecee..000000000 --- a/ScrollSet.js +++ /dev/null @@ -1,152 +0,0 @@ -const path = require("path") -const lodash = require("lodash") - -const { Particle } = require("scrollsdk/products/Particle.js") -const { Utils } = require("scrollsdk/products/Utils.js") -const { Disk } = require("scrollsdk/products/Disk.node.js") -const { ScrollFile, ScrollFileSystem } = require("scroll-cli") -const scrollFs = new ScrollFileSystem() - -class ScrollSetCLI { - constructor() { - this.quickCache = {} - } - - importCommand(filename) { - const extension = filename.split(".").pop() - - if (extension === "csv") - Particle.fromCsv(Disk.read(filename)).forEach((patch) => - this.patchAndSave(patch) - ) - - if (extension === "tsv") - Particle.fromTsv(Disk.read(filename)).forEach((patch) => - this.patchAndSave(patch) - ) - - if (extension === "particles") - Particle.fromDisk(filename).forEach((patch) => this.patchAndSave(patch)) - } - - get searchIndex() { - if (!this.quickCache.searchIndex) - this.quickCache.searchIndex = this.makeNameSearchIndex() - return this.quickCache.searchIndex - } - - makeFilePath(id) { - return path.join(this.conceptsFolder, id + ".scroll") - } - - getParticle(file) { - return new Particle(Disk.read(this.makeFilePath(file.id))) - } - - patchAndSave(patch) { - const id = patch.get("id") - patch.delete("id") - const target = this.makeFilePath(id) - if (!Disk.exists(target)) { - console.log(`Now match for ${id}`) - return - } - console.log(`Patching ${id}`) - return new ScrollFile( - new Particle(Disk.read(target)).patch(patch).toString(), - target, - scrollFs - ).formatAndSave() - } - - setAndSave(file, measurementPath, measurementValue) { - const particle = this.getParticle(file) - particle.set(measurementPath, measurementValue) - return this.formatAndSave(file, particle) - } - - formatAndSave(file, particle = this.getParticle(file)) { - const formatted = new ScrollFile( - particle.toString(), - this.makeFilePath(file.id), - scrollFs - ).formatted - // force a write - return scrollFs.write(this.makeFilePath(file.id), formatted) - } - - makeNameSearchIndex(files = this.concepts.slice(0).reverse()) { - const map = new Map() - files.forEach((parsedConcept) => - this.makeNames(parsedConcept).forEach((name) => - map.set(name.toLowerCase(), parsedConcept) - ) - ) - return map - } - - makeNames(concept) { - return [concept.id] - } - - searchForConcept(query) { - if (query === undefined || query === "" || !query.toLowerCase) return - const { searchIndex } = this - return ( - searchIndex.get(query) || - searchIndex.get(query.toLowerCase()) || - searchIndex.get(Utils.titleToPermalink(query)) - ) - } - - searchForConceptCommand(query) { - console.log(lodash.pickBy(this.searchForConcept(query), lodash.identity)) - } - - parsersFile = "" - scrollSetName = "myScrollSet" - - get concepts() { - return require(this.compiledConcepts) - } - - async updateIdsCommand() { - this.concepts.forEach((file) => { - const dest = path.join(this.conceptsFolder, file.filename) - const particle = new Particle(Disk.read(dest)) - const newParticle = particle.toString().replace( - `import ../code/conceptPage.scroll -id `, - `import ../code/conceptPage.scroll -id ${file.filename.replace(".scroll", "")} -name ` - ) - Disk.write(dest, newParticle.toString()) - }) - } - - buildParsersFileCommand() { - const code = `node_modules/scroll-cli/parsers/cellTypes.parsers -node_modules/scroll-cli/parsers/root.parsers -node_modules/scroll-cli/parsers/build.parsers -node_modules/scroll-cli/parsers/comments.parsers -node_modules/scroll-cli/parsers/blankLine.parsers -node_modules/scroll-cli/parsers/measures.parsers -node_modules/scroll-cli/parsers/import.parsers -node_modules/scroll-cli/parsers/errors.parsers -${this.parsersFile}` - .trim() - .split("\n") - .map((filepath) => Disk.read(path.join(__dirname, filepath))) - .join("\n\n") - .replace( - "catchAllParser catchAllParagraphParser", - "catchAllParser errorParser" - ) - .replace(/^importOnly\n/gm, "") - .replace(/^import .+/gm, "") - Disk.write(path.join(__dirname, `${this.scrollSetName}.parsers`), code) - } -} - -module.exports = { ScrollSetCLI } diff --git a/cli.js b/cli.js index cab776a62..1a278eb73 100755 --- a/cli.js +++ b/cli.js @@ -2,7 +2,7 @@ const path = require("path") const { Utils } = require("scrollsdk/products/Utils.js") -const { ScrollSetCLI } = require("./ScrollSet.js") +const { ScrollSetCLI } = require("scroll-cli/ScrollSetCLI.js") class CancerDBCli extends ScrollSetCLI { conceptsFolder = path.join(__dirname, "concepts") diff --git a/package.json b/package.json index 9c1032be8..1ef584d99 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "homepage": "https://cancerdb.com", "devDependencies": { "lodash": "^4.17.21", - "scroll-cli": "^130.2.1", + "scroll-cli": "^130.3.1", "scrollsdk": "^84.0.0" } } ------------------------------------------------------------
commit 2f8970bac04df91798186c741e912bbbd1ee5e3d
Author: Breck Yunits <breck7@gmail.com> Date: Mon Sep 9 04:14:54 2024 -1000 diff --git a/pages/explore.scroll b/pages/explore.scroll index af07f9543..21d8713b6 100644 --- a/pages/explore.scroll +++ b/pages/explore.scroll @@ -3,7 +3,6 @@ title Explore CancerDB header.scroll -<div class="singleColumn"> printTitle endSnippet @@ -13,7 +12,5 @@ table ../cancerdb.json select id measurements type wikipedia website printTable -</div> - ../footer.scroll tableSearch