<commit_before>var rest = function() {

    // Prefixes to use the REST API.
    // These are modified in the localREST setter
    // TODO: Encapsulate this information in an object
    var prefix = "http://beta.rest.ensembl.org";
    var prefix_region = prefix + "/feature/region/";
    var prefix_ensgene = prefix + "/lookup/";
    var prefix_gene = prefix + "/xrefs/symbol/";
    var prefix_homologues = prefix + "/homology/id/";
    var prefix_chr_info = prefix + "/assembly/info/";

    var eRest = function() {
    };

    /** <strong>localREST</strong> points the queries to a local REST service to debug.
	This method should be removed in "production"
    */
    eRest.localREST = function() {
	prefix = "http://127.0.0.1:3000";
	prefix_region = prefix + "/feature/region/";
	prefix_ensgene = prefix + "/lookup/id/";
	prefix_gene = prefix + "/xrefs/symbol/";
	prefix_homologues = prefix + "/homology/id/";

	return eRest;
    };

    eRest.call = function (obj) {
	var url = obj.url;
	var on_success = obj.success;
	var on_error   = obj.error;
	console.log("URL:" + url);
	d3.json (url, function (error, resp) {
	    console.log("RESP:");
	    console.log(resp);
	    if (resp !== undefined && error === null) {
		on_success(resp);
	    }
	    if (error !== null) {
		on_error();
	    }
	});
    };

    eRest.url = function (key, obj) {
	if (key === "region") {
	    return prefix_region + obj.species + "/" + obj.chr + ":" + obj.fromPos + "-" + obj.toPos + ".json?feature=gene";
	}
	if (key === "species_gene") {
	    return prefix_gene + obj.species + "/" + obj.gene_name + ".json?object=gene";	    
	}
	if (key === "homologues") {
	    return prefix_homologues + obj.gene_name + ".json?format=condensed;sequence=none;type=all";
	}
	if (key === "gene") {
	    return prefix_ensgene + obj.gene_name + ".json?format=full";
	}
	if (key === "chr_info") {
	    return prefix_chr_info + obj.species + "/" + obj.chr;
	}
    };

    return eRest;
};<commit_msg>ensembl rest api changed lookup/id object to object_type<commit_after>var rest = function() {

    // Prefixes to use the REST API.
    // These are modified in the localREST setter
    // TODO: Encapsulate this information in an object
    var prefix = "http://beta.rest.ensembl.org";
    var prefix_region = prefix + "/feature/region/";
    var prefix_ensgene = prefix + "/lookup/";
    var prefix_gene = prefix + "/xrefs/symbol/";
    var prefix_homologues = prefix + "/homology/id/";
    var prefix_chr_info = prefix + "/assembly/info/";

    var eRest = function() {
    };

    /** <strong>localREST</strong> points the queries to a local REST service to debug.
	This method should be removed in "production"
    */
    eRest.localREST = function() {
	prefix = "http://127.0.0.1:3000";
	prefix_region = prefix + "/feature/region/";
	prefix_ensgene = prefix + "/lookup/id/";
	prefix_gene = prefix + "/xrefs/symbol/";
	prefix_homologues = prefix + "/homology/id/";

	return eRest;
    };

    eRest.call = function (obj) {
	var url = obj.url;
	var on_success = obj.success;
	var on_error   = obj.error;
	console.log("URL:" + url);
	d3.json (url, function (error, resp) {
	    console.log("RESP:");
	    console.log(resp);
	    if (resp !== undefined && error === null) {
		on_success(resp);
	    }
	    if (error !== null) {
		on_error();
	    }
	});
    };

    eRest.url = function (key, obj) {
	if (key === "region") {
	    return prefix_region + obj.species + "/" + obj.chr + ":" + obj.fromPos + "-" + obj.toPos + ".json?feature=gene";
	}
	if (key === "species_gene") {
	    return prefix_gene + obj.species + "/" + obj.gene_name + ".json?object_type=gene";	    
	}
	if (key === "homologues") {
	    return prefix_homologues + obj.gene_name + ".json?format=condensed;sequence=none;type=all";
	}
	if (key === "gene") {
	    return prefix_ensgene + obj.gene_name + ".json?format=full";
	}
	if (key === "chr_info") {
	    return prefix_chr_info + obj.species + "/" + obj.chr;
	}
    };

    return eRest;
};
{'fraction_non_alphanumeric': 0.16775653923541248, 'fraction_numerical': 0.005533199195171026, 'mean_word_length': 2.910521140609636, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3159405', 'n_tokens_mistral': 1454, 'n_tokens_neox': 1355, 'n_words': 329}