Skip to content

Commit

Permalink
Merge pull request #32 from bcgsc/release/v6.0.0
Browse files Browse the repository at this point in the history
Release/v6.0.0
  • Loading branch information
creisle authored Nov 29, 2021
2 parents aef05b2 + 34844e7 commit 5effc0e
Show file tree
Hide file tree
Showing 46 changed files with 8,620 additions and 7,609 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
"sort-keys-fix"
],
"rules": {
"arrow-parens": "off",
"function-paren-newline": "off",
"indent": [
"error",
4,
Expand Down Expand Up @@ -60,6 +62,7 @@
],
"no-fallthrough": "off",
"no-mixed-spaces-and-tabs": "error",
"no-multiple-empty-lines": "off",
"no-multi-assign": "off",
"no-param-reassign": "warn",
"no-plusplus": "off",
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/npm-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [10, 12, 14]
node: ['12', '14']
name: node-${{ matrix.node }}
steps:
- uses: actions/checkout@v2
Expand All @@ -19,6 +19,7 @@ jobs:
- run: npm ci
- run: npm run lint -- --quiet # errors only, no warnings
name: eslint
- run: npm audit --production --audit-level high
- run: npm run test
- uses: EnricoMi/[email protected]
with:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:10
FROM node:12
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm ci --only=production
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# GraphKB Loader

![build](https://github.com/bcgsc/pori_graphkb_loader/workflows/build/badge.svg?branch=master) ![Docker Image Version (latest semver)](https://img.shields.io/docker/v/bcgsc/pori-graphkb-loader?label=docker%20image) ![node versions](https://img.shields.io/badge/node-10%20%7C%2012%20%7C%2014-blue)
![build](https://github.com/bcgsc/pori_graphkb_loader/workflows/build/badge.svg?branch=master) ![Docker Image Version (latest semver)](https://img.shields.io/docker/v/bcgsc/pori-graphkb-loader?label=docker%20image) ![node versions](https://img.shields.io/badge/node-12%20%7C%2014-blue)

This repository is part of the [platform for oncogenomic reporting and interpretation](https://github.com/bcgsc/pori).

Expand Down
41 changes: 28 additions & 13 deletions bin/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ const PMC4468049 = require('../src/PMC4468049');
const PMC4232638 = require('../src/PMC4232638');
const uberon = require('../src/uberon');
const variants = require('../src/variants');
const asco = require('../src/asco');

const clinicaltrialsgov = require('../src/clinicaltrialsgov');

const cosmicResistance = require('../src/cosmic/resistance');
const cosmicFusions = require('../src/cosmic/fusions');

const API_MODULES = {
civic, clinicaltrialsgov, dgidb, docm, fdaApprovals, oncotree,
asco, clinicaltrialsgov, dgidb, docm, fdaApprovals, oncotree,
};

const FILE_MODULES = {
Expand Down Expand Up @@ -65,6 +66,7 @@ const ALL_MODULES = {
...API_MODULES,
...FILE_MODULES,
...COSMIC_MODULES,
civic,
};

const parser = createOptionsMenu();
Expand All @@ -85,6 +87,19 @@ fileParser.add_argument('input', {
help: 'path to the file/dir to be loaded',
type: fileExists,
});
fileParser.add_argument('--ignoreCache', {
action: 'store_true',
default: false,
help: 'Load the full content, to not check for previously loaded records already in the GraphKB instance',
});

const civicParser = subparsers.add_parser('civic');
civicParser.add_argument('--trustedCurators', {
default: [],
help: 'CIViC User IDs of curators whose statements should be imported even if they have not yet been reviewed (evidence is submitted but not accepted)',
nargs: '+',
});


const cosmicParser = subparsers.add_parser('cosmic');
cosmicParser.add_argument('module', {
Expand All @@ -100,29 +115,29 @@ cosmicParser.add_argument('classification', {
type: fileExists,
});

const options = parser.parse_args();
const { module: moduleName, input, ...options } = parser.parse_args();

let loaderFunction;

if (options.input) {
loaderFunction = ALL_MODULES[options.module].uploadFile;
if (input) {
loaderFunction = ALL_MODULES[moduleName || 'civic'].uploadFile;
} else {
loaderFunction = ALL_MODULES[options.module].upload;
loaderFunction = ALL_MODULES[moduleName || 'civic'].upload;
}

const loaderOptions = {};
const loaderOptions = { ...options };

if (options.input) {
if (options.module === 'clinicaltrialsgov') {
if (fs.lstatSync(options.input).isDirectory()) {
const files = fs.readdirSync(options.input)
.map(filename => path.join(options.input, filename));
if (input) {
if (moduleName === 'clinicaltrialsgov') {
if (fs.lstatSync(input).isDirectory()) {
const files = fs.readdirSync(input)
.map(filename => path.join(input, filename));
loaderOptions.files = files;
} else {
loaderOptions.files = [options.input];
loaderOptions.files = [input];
}
} else {
loaderOptions.filename = options.input;
loaderOptions.filename = input;

if (options.module === 'cosmic') {
loaderOptions.mappingFilename = options.mappingFilename;
Expand Down
Loading

0 comments on commit 5effc0e

Please sign in to comment.