cgds
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -10,3 +10,3 @@ module.exports = function (grunt) { | ||
options: { | ||
alias: "lib/<%= pkg.name %>.js:<%= pkg.name %>" | ||
alias: ["lib/<%= pkg.name %>.js:<%= pkg.name %>"] | ||
} | ||
@@ -13,0 +13,0 @@ } |
"use strict"; | ||
var http, url, get, toJSON, CGDS; | ||
var http, https, url, get, toJSON, CGDS; | ||
http = require("http"); | ||
https = require("https"); | ||
url = require("url"); | ||
get = function (uri, proxy, callback) { | ||
var options; | ||
var options, responseHandler, req; | ||
if (typeof proxy === "function") { | ||
@@ -19,6 +20,3 @@ callback = proxy; | ||
} | ||
// Browserify does not default to port 80 if the page | ||
// is served from a port other than 80. | ||
options.port = 80; | ||
http.get(options, function (res) { | ||
responseHandler = function (res) { | ||
var body; | ||
@@ -34,3 +32,17 @@ // Browserify does not seem to work well with buffers ("no method copy"), | ||
}); | ||
}); | ||
}; | ||
// Don't use http.get until https://github.com/substack/https-browserify/pull/1 | ||
// is fixed. | ||
options.method = "GET"; | ||
// Setting withCredentials to false is required until | ||
// https://github.com/substack/http-browserify/pull/47 is fixed. | ||
options.withCredentials = false; | ||
if (options.protocol === "https:") { | ||
options.port = 443; | ||
req = https.request(options, responseHandler); | ||
} else { | ||
options.port = 80; | ||
req = http.request(options, responseHandler); | ||
} | ||
req.end(); | ||
}; | ||
@@ -37,0 +49,0 @@ |
{ | ||
"name": "cgds", | ||
"version": "0.1.4", | ||
"description": "A module for querying the Cancer Genomics Data Server (CGDS).", | ||
"version": "0.1.3", | ||
"author": { | ||
"name": "Alexander Grüneberg", | ||
"email": "alexander.grueneberg@googlemail.com" | ||
}, | ||
"keywords": ["cbio", "cancer", "genomics", "tcga", "mskcc"], | ||
"bugs": "https://github.com/agrueneberg/CGDS-JS/issues", | ||
"license": "MIT", | ||
"author": "Alexander Grüneberg <alexander.grueneberg@googlemail.com>", | ||
"main": "./lib/cgds.js", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/agrueneberg/CGDS-JS" | ||
"url": "https://github.com/agrueneberg/CGDS-JS.git" | ||
}, | ||
"licenses": [{ | ||
"type": "The MIT License", | ||
"url": "http://www.opensource.org/licenses/mit-license.php" | ||
}], | ||
"main": "./lib/cgds.js", | ||
"scripts": { | ||
"test": "./node_modules/.bin/mocha" | ||
}, | ||
"devDependencies": { | ||
"grunt": "~0.4.1", | ||
"grunt-browserify": "~1.2.1", | ||
"grunt-contrib-uglify": "~0.2.2", | ||
"browserify": "~2.25.0", | ||
"mocha": "~1.12.0", | ||
"expect.js": "~0.2.0" | ||
"grunt": "~0.4.4", | ||
"grunt-browserify": "~2.0.7", | ||
"grunt-contrib-uglify": "~0.4.0", | ||
"browserify": "~3.41.0", | ||
"mocha": "~1.18.2", | ||
"expect.js": "~0.3.1" | ||
}, | ||
"engines": { | ||
"node": ">= 0.10.0" | ||
}, | ||
"scripts": { | ||
"test": "./node_modules/.bin/mocha" | ||
} | ||
} |
@@ -35,2 +35,4 @@ var expect, CGDS; | ||
this.timeout(5000); | ||
beforeEach(function () { | ||
@@ -254,3 +256,3 @@ cgds = new CGDS("http://www.cbioportal.org/public-portal/webservice.do"); | ||
expect(err).to.not.be(null); | ||
expect(err.message).to.be("No genetic profile available for genetic_profile_id: foo."); | ||
expect(err.message).to.be("Error: Problem when identifying a cancer study for the request."); | ||
expect(res).to.be(null); | ||
@@ -300,3 +302,3 @@ done(); | ||
expect(res.length).to.be.greaterThan(0); | ||
expect(Object.keys(res[0])).to.eql(["entrez_gene_id", "gene_symbol", "case_id", "sequencing_center", "mutation_status", "mutation_type", "validation_status", "amino_acid_change", "functional_impact_score", "xvar_link", "xvar_link_pdb", "xvar_link_msa", "chr", "start_position", "end_position", "reference_allele", "variant_allele", "genetic_profile_id"]); | ||
expect(Object.keys(res[0])).to.eql(["entrez_gene_id", "gene_symbol", "case_id", "sequencing_center", "mutation_status", "mutation_type", "validation_status", "amino_acid_change", "functional_impact_score", "xvar_link", "xvar_link_pdb", "xvar_link_msa", "chr", "start_position", "end_position", "reference_allele", "variant_allele", "reference_read_count_tumor", "variant_read_count_tumor", "reference_read_count_normal", "variant_read_count_normal", "genetic_profile_id"]); | ||
done(); | ||
@@ -310,3 +312,3 @@ }); | ||
expect(res.length).to.be.greaterThan(0); | ||
expect(Object.keys(res[0])).to.eql(["entrez_gene_id", "gene_symbol", "case_id", "sequencing_center", "mutation_status", "mutation_type", "validation_status", "amino_acid_change", "functional_impact_score", "xvar_link", "xvar_link_pdb", "xvar_link_msa", "chr", "start_position", "end_position", "reference_allele", "variant_allele", "genetic_profile_id"]); | ||
expect(Object.keys(res[0])).to.eql(["entrez_gene_id", "gene_symbol", "case_id", "sequencing_center", "mutation_status", "mutation_type", "validation_status", "amino_acid_change", "functional_impact_score", "xvar_link", "xvar_link_pdb", "xvar_link_msa", "chr", "start_position", "end_position", "reference_allele", "variant_allele", "reference_read_count_tumor", "variant_read_count_tumor", "reference_read_count_normal", "variant_read_count_normal", "genetic_profile_id"]); | ||
done(); | ||
@@ -320,3 +322,3 @@ }); | ||
expect(res.length).to.be.greaterThan(0); | ||
expect(Object.keys(res[0])).to.eql(["entrez_gene_id", "gene_symbol", "case_id", "sequencing_center", "mutation_status", "mutation_type", "validation_status", "amino_acid_change", "functional_impact_score", "xvar_link", "xvar_link_pdb", "xvar_link_msa", "chr", "start_position", "end_position", "reference_allele", "variant_allele", "genetic_profile_id"]); | ||
expect(Object.keys(res[0])).to.eql(["entrez_gene_id", "gene_symbol", "case_id", "sequencing_center", "mutation_status", "mutation_type", "validation_status", "amino_acid_change", "functional_impact_score", "xvar_link", "xvar_link_pdb", "xvar_link_msa", "chr", "start_position", "end_position", "reference_allele", "variant_allele", "reference_read_count_tumor", "variant_read_count_tumor", "reference_read_count_normal", "variant_read_count_normal", "genetic_profile_id"]); | ||
done(); | ||
@@ -330,3 +332,3 @@ }); | ||
expect(res.length).to.be.greaterThan(0); | ||
expect(Object.keys(res[0])).to.eql(["entrez_gene_id", "gene_symbol", "case_id", "sequencing_center", "mutation_status", "mutation_type", "validation_status", "amino_acid_change", "functional_impact_score", "xvar_link", "xvar_link_pdb", "xvar_link_msa", "chr", "start_position", "end_position", "reference_allele", "variant_allele", "genetic_profile_id"]); | ||
expect(Object.keys(res[0])).to.eql(["entrez_gene_id", "gene_symbol", "case_id", "sequencing_center", "mutation_status", "mutation_type", "validation_status", "amino_acid_change", "functional_impact_score", "xvar_link", "xvar_link_pdb", "xvar_link_msa", "chr", "start_position", "end_position", "reference_allele", "variant_allele", "reference_read_count_tumor", "variant_read_count_tumor", "reference_read_count_normal", "variant_read_count_normal", "genetic_profile_id"]); | ||
done(); | ||
@@ -340,3 +342,3 @@ }); | ||
expect(res.length).to.be.greaterThan(0); | ||
expect(Object.keys(res[0])).to.eql(["entrez_gene_id", "gene_symbol", "case_id", "sequencing_center", "mutation_status", "mutation_type", "validation_status", "amino_acid_change", "functional_impact_score", "xvar_link", "xvar_link_pdb", "xvar_link_msa", "chr", "start_position", "end_position", "reference_allele", "variant_allele", "genetic_profile_id"]); | ||
expect(Object.keys(res[0])).to.eql(["entrez_gene_id", "gene_symbol", "case_id", "sequencing_center", "mutation_status", "mutation_type", "validation_status", "amino_acid_change", "functional_impact_score", "xvar_link", "xvar_link_pdb", "xvar_link_msa", "chr", "start_position", "end_position", "reference_allele", "variant_allele", "reference_read_count_tumor", "variant_read_count_tumor", "reference_read_count_normal", "variant_read_count_normal", "genetic_profile_id"]); | ||
done(); | ||
@@ -384,3 +386,3 @@ }); | ||
expect(res.length).to.be.greaterThan(0); | ||
expect(Object.keys(res[0])).to.eql(["case_id", "overall_survival_months", "overall_survival_status", "disease_free_survival_months", "disease_free_survival_status", "age_at_diagnosis"]); | ||
expect(Object.keys(res[0])).to.eql(["CASE_ID", "DFS_MONTHS", "DFS_STATUS", "OS_MONTHS", "OS_STATUS"]); | ||
done(); | ||
@@ -387,0 +389,0 @@ }); |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
35624
8
614
2