-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
212 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
if [ -z "$1" ]; then | ||
MONGO_URL="mongodb://localhost:27017/MedBook" meteor --port 3003 --settings settings.json | ||
else | ||
MONGO_URL="mongodb://localhost:27017/MedBook" meteor $1 --port 3003 --settings settings.json | ||
fi | ||
export MONGO_URL="mongodb://localhost:27017/MedBook" | ||
export MEDBOOK_FILESTORE=/tmp/filestore | ||
|
||
meteor --port 3003 --settings ../config/rb/settings.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
{ | ||
"rscript": "Rscript", | ||
"python": "python", | ||
"limma_path": "/data/MedBook/External-Tools/limma/limma_ng.R", | ||
"apply_signature_path" : "/data/MedBook/External-Tools/signature/apply_signature.py", | ||
"viper_supervised_path": "/data/MedBook/UCSC_VIPER/bin/run-viper-supervised.R", | ||
"viper_unsupervised_path": "/data/MedBook/UCSC_VIPER/bin/run-viper-unsupervised.R", | ||
"viper_path": "/data/MedBook/UCSC_VIPER/bin/run-viper.R", | ||
"marina_path": "/data/MedBook/UCSC_VIPER/bin/run-marina.R", | ||
"gsea_path": "/data/MedBook/External-Tools/gsea/rgGSEA.py", | ||
"boxplot_new_path": "/data/MedBook/Tools/MedBook-Adapters/boxplot//boxplot.new.R", | ||
"boxplot_path": "/data/MedBook/Tools/MedBook-Adapters/boxplot//boxplot.R", | ||
"violinplot_path": "/data/MedBook/Tools/MedBook-Adapters/boxplot//violinplot.R", | ||
"sh": "/bin/sh", | ||
"rscript": "Rscript", | ||
"python": "python", | ||
"limma_path": "/data/MedBook/MedBook-JobRunner/external-tools/limma/limma_ng.R", | ||
"outlier_analysis": "/data/MedBook/MedBook-JobRunner/external-tools/OutlierAnalysis/outlier-analysis.sh", | ||
"calculate_outlier_genes": "/data/MedBook/MedBook-JobRunner/external-tools/OutlierAnalysis/calculate_outlier_genes.R", | ||
"genomic_expression_export": "/data/MedBook/MedBook-JobRunner/external-tools/exporters/genomic_expression_export.py", | ||
"gene_set_collection_export": "/data/MedBook/MedBook-JobRunner/external-tools/exporters/gene_set_collection_export.py", | ||
"limma_phenotype_export": "/data/MedBook/MedBook-JobRunner/external-tools/exporters/limma_phenotype_export.py", | ||
"apply_signature_path" : "/data/MedBook/External-Tools/signature/apply_signature.py", | ||
"viper_supervised_path": "/data/MedBook/UCSC_VIPER/bin/run-viper-supervised.R", | ||
"viper_unsupervised_path": "/data/MedBook/UCSC_VIPER/bin/run-viper-unsupervised.R", | ||
"viper_path": "/data/MedBook/UCSC_VIPER/bin/run-viper.R", | ||
"marina_path": "/data/MedBook/UCSC_VIPER/bin/run-marina.R", | ||
"gsea_path": "/data/MedBook/External-Tools/gsea/rgGSEA.py", | ||
"boxplot_new_path": "/data/MedBook/Tools/MedBook-Adapters/boxplot//boxplot.new.R", | ||
"boxplot_path": "/data/MedBook/Tools/MedBook-Adapters/boxplot//boxplot.R", | ||
"violinplot_path": "/data/MedBook/Tools/MedBook-Adapters/boxplot//violinplot.R" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
{ | ||
"sh": "/bin/sh", | ||
"rscript": "Rscript", | ||
"limma_path": "/Users/mokolodi1/work/medbook/next/MedBook-JobRunner/external-tools/limma/limma_ng.R", | ||
"outlier_analysis": "/Users/mokolodi1/work/medbook/next/MedBook-JobRunner/external-tools/OutlierAnalysis/outlier-analysis.sh", | ||
"calculate_outlier_genes": "/Users/mokolodi1/work/medbook/next/MedBook-JobRunner/external-tools/OutlierAnalysis/calculate_outlier_genes.R", | ||
"genomic_expression_export": "/Users/mokolodi1/work/medbook/next/MedBook-JobRunner/external-tools/exporters/genomic_expression_export.py", | ||
"gene_set_collection_export": "/Users/mokolodi1/work/medbook/next/MedBook-JobRunner/external-tools/exporters/gene_set_collection_export.py", | ||
"limma_phenotype_export": "/Users/mokolodi1/work/medbook/next/MedBook-JobRunner/external-tools/exporters/limma_phenotype_export.py", | ||
"gsea_path": "/Users/mokolodi1/work/medbook/next/MedBook-JobRunner/external-tools/gsea/rgGSEA.py", | ||
"gsea_jar_path": "/Users/mokolodi1/work/medbook/next/MedBook-JobRunner/external-tools/gsea/gsea2-2.2.2.jar" | ||
"limma_path": "/Users/mokolodi1/work/medbook/medbook/MedBook-JobRunner/external-tools/limma/limma_ng.R", | ||
"outlier_analysis": "/Users/mokolodi1/work/medbook/medbook/MedBook-JobRunner/external-tools/OutlierAnalysis/outlier-analysis.sh", | ||
"calculate_outlier_genes": "/Users/mokolodi1/work/medbook/medbook/MedBook-JobRunner/external-tools/OutlierAnalysis/calculate_outlier_genes.R", | ||
"genomic_expression_export": "/Users/mokolodi1/work/medbook/medbook/MedBook-JobRunner/external-tools/exporters/genomic_expression_export.py", | ||
"gene_set_collection_export": "/Users/mokolodi1/work/medbook/medbook/MedBook-JobRunner/external-tools/exporters/gene_set_collection_export.py", | ||
"limma_phenotype_export": "/Users/mokolodi1/work/medbook/medbook/MedBook-JobRunner/external-tools/exporters/limma_phenotype_export.py", | ||
"gsea_path": "/Users/mokolodi1/work/medbook/medbook/MedBook-JobRunner/external-tools/gsea/rgGSEA.py", | ||
"gsea_jar_path": "/Users/mokolodi1/work/medbook/medbook/MedBook-JobRunner/external-tools/gsea/gsea2-2.2.2.jar" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,4 @@ mokolodi1:[email protected] | |
medbook:adapters | ||
medbook:namespace | ||
medbook:blobs | ||
medbook:collaborations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,7 @@ [email protected] | |
[email protected] | ||
[email protected] | ||
[email protected] | ||
erasaur:[email protected] | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
|
@@ -47,6 +48,7 @@ [email protected] | |
matb33:[email protected] | ||
medbook:[email protected] | ||
medbook:[email protected] | ||
medbook:[email protected] | ||
medbook:[email protected] | ||
medbook:[email protected] | ||
medbook:[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,6 @@ | |
"q": "1.4.1", | ||
"xlsx": "0.8.0", | ||
"mime": "1.2.11", | ||
"docker-run": "2.4.0" | ||
"docker-run": "2.4.0", | ||
"mysql": "2.11.1" | ||
} |
Submodule collaborations
added at
a12fa8
28 changes: 28 additions & 0 deletions
28
webapp/packages/npm-container/.npm/package/npm-shrinkwrap.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
function UpdateCbioSecurity (job_id) { | ||
Job.call(this, job_id); | ||
} | ||
UpdateCbioSecurity.prototype = Object.create(Job.prototype); | ||
UpdateCbioSecurity.prototype.constructor = UpdateCbioSecurity; | ||
|
||
var mysql = Meteor.npmRequire('mysql'); | ||
|
||
UpdateCbioSecurity.prototype.run = function () { | ||
var connection = mysql.createConnection({ | ||
host : "mysql", | ||
user : "cbio", | ||
password : "P@ssword1", | ||
database : "cbioportal" | ||
}); | ||
|
||
connection.connect(); | ||
|
||
// Collect this information out here so that it runs in the Meteor | ||
// environment, which we'll lose in the promise code below | ||
var allNamesAndEmails = _.map(this.job.args.collab_names, function (name) { | ||
var collab = Collaborations.findOne({ name: name }); | ||
|
||
if (!collab) { | ||
throw new Error("collaboration name invalid: " + name); | ||
} | ||
|
||
return { | ||
name: name, | ||
emails: collab.getUserEmails(), | ||
}; | ||
}); | ||
|
||
var self = this; | ||
var jobDeferred = Q.defer(); | ||
|
||
// This 5 was chosen arbitrarily because I don't know how to start with a | ||
// .then. I like it better when all the logic code is in .thens because | ||
// I find it easier to read. | ||
Q.when(5) | ||
// NOTE: Q.nfcall doesn't work here for some reason | ||
.then(function () { | ||
var deferred = Q.defer(); | ||
|
||
connection.query("DELETE FROM users", function (error, result) { | ||
if (error) { deferred.reject(error); } | ||
else { deferred.resolve(result); } | ||
}); | ||
|
||
return deferred.promise; | ||
}) | ||
.then(function () { | ||
var deferred = Q.defer(); | ||
|
||
connection.query("DELETE FROM authorities", function (error, result) { | ||
if (error) { deferred.reject(error); } | ||
else { deferred.resolve(result); } | ||
}); | ||
|
||
return deferred.promise; | ||
}) | ||
.then(function () { | ||
var deferred = Q.defer(); | ||
var allPromises = []; | ||
|
||
// For each email insert into the users table and the authorities | ||
// table. Wait until every command is done running before continuing. | ||
_.each(allNamesAndEmails, function (nameAndEmails) { | ||
_.each(nameAndEmails.emails, function (email) { | ||
// insert into the users table | ||
var usersDeferred = Q.defer(); | ||
connection.query('INSERT INTO users SET ?', { | ||
name: email, | ||
email: email, | ||
enabled: 1 | ||
}, function (err, result) { | ||
if (err) { usersDeferred.reject(err); } | ||
else { usersDeferred.resolve(result); } | ||
}); | ||
allPromises.push(usersDeferred.promise); | ||
|
||
// insert into the authorities table | ||
var authoritiesDeferred = Q.defer(); | ||
connection.query('INSERT INTO authorities SET ?', { | ||
email: email, | ||
|
||
// TODO: change to `cbioportal:${nameAndEmails.name}` | ||
authority: 'cbioportal:ALL', | ||
}, function (err, result) { | ||
if (err) { authoritiesDeferred.reject(err); } | ||
else { authoritiesDeferred.resolve(result); } | ||
}); | ||
allPromises.push(authoritiesDeferred.promise); | ||
}); | ||
|
||
console.log("added " + nameAndEmails.emails.length + " users to " + | ||
"cbioportal:ALL"); | ||
}); | ||
|
||
// wait for all the promises to resolve and then continue | ||
Q.all(allPromises) | ||
.then(deferred.resolve) | ||
.catch(deferred.reject); | ||
|
||
return deferred.promise; | ||
}) | ||
.then(function () { | ||
connection.end(); | ||
|
||
jobDeferred.resolve(); | ||
}) | ||
.catch(function (error) { | ||
jobDeferred.reject(error); | ||
}); | ||
|
||
return jobDeferred.promise; | ||
} | ||
|
||
Meteor.startup(function () { | ||
var newJobBlueprint = { | ||
name: "UpdateCbioSecurity", | ||
user_id: "admin", | ||
args: { | ||
collab_names: [ "WCDT" ] | ||
} | ||
}; | ||
|
||
// set up a cron job to execute every so often | ||
SyncedCron.add({ | ||
name: "update-cbio-security", | ||
schedule: function(parser) { | ||
// parser is a later.parse object | ||
return parser.text('every 12 hours'); | ||
}, | ||
job: function () { | ||
Jobs.insert(newJobBlueprint); | ||
}, | ||
}); | ||
|
||
// also execute immediately | ||
Jobs.insert(newJobBlueprint); | ||
}); | ||
|
||
JobClasses.UpdateCbioSecurity = UpdateCbioSecurity; |