<commit_before>/*global define: false */
define(['underscore_ext',
		'jquery',
		'rx',
		'multi',
		'vgcanvas',
		'colorBar',
		'columnWidgets',
		'crosshairs',
		'heatmapColors',
		'partition',
		'tooltip',
		'util',
		'xenaQuery',
		'rx.jquery'
	], function (
		_,
		$,
		Rx,
		multi,
		vgcanvas,
		colorBar,
		widgets,
		crosshairs,
		heatmapColors,
		partition,
		tooltip,
		util,
		xenaQuery) {

	"use strict";

	var each = _.each,
		map = _.map,
		filter = _.filter,
		isUndefined = _.isUndefined,
		zip = _.zip,
		range = _.range,
		bind = _.bind,
		partial = _.partial,
		pluckPathsArray = _.pluckPathsArray,
		find = _.find,
		keys = _.keys,
		uniq = _.uniq,

		default_colors_map,
		color_schemes,
		scratch = vgcanvas(1, 1), // scratch buffer
		cmp,
		fetch,
		fetch_gene,
		fetch_gene_probes,
		fetch_feature,
		render;

	color_schemes = {
		blue_white_red: ['#0000ff', '#ffffff', '#ff0000'],
		green_black_red: ['#007f00', '#000000', '#ff0000'],
		green_black_yellow: ['#007f00', '#000000', '#ffff00']
		/* with clinical category palette:
		blue_white_red: ['#377eb8', '#ffffff', '#e41a1c'],
		green_black_red: ['#4daf4a', '#000000', '#e41a1c'],
		green_black_yellow: ['#4daf4a', '#000000', '#ffff33']
		*/
	};

	default_colors_map = {
		"common/dataSubType/geneRNAseq": color_schemes.green_black_red,
		"common/dataSubType/geneArray": color_schemes.green_black_red,
		"common/dataSubType/geneExp": color_schemes.green_black_red,
		"common/dataSubType/cna": color_schemes.blue_white_red,
		"common/dataSubType/cellViability": color_schemes.blue_white_red,
		"common/dataSubType/DNAMethylation": color_schemes.blue_white_red,
		"common/dataSubType/kinomeScreen": color_schemes.blue_white_red,
		"common/dataSubType/PARADIGM": color_schemes.blue_white_red,
		"common/dataSubType/phenotype": color_schemes.blue_white_red,
		"common/dataSubType/protein": color_schemes.blue_white_red,
		"common/dataSubType/somaticMutation": color_schemes.blue_white_red,
		phenotype: color_schemes.green_black_yellow
	};

	function meannan(values) {
		var count = 0, sum = 0, i, v;
		if (!values) {
			return NaN;
		}
		sum = _.reduce(values, function (sum, v) {
			if (!isNaN(v)) {
				count += 1;
				return sum + v;
			}
			return sum;
		}, 0);
		if (count > 0) {
			return sum / count;
		}
		return NaN;
	}

	function default_colors (dataSubType) {
		return default_colors_map[dataSubType] ||
			color_schemes.blue_white_red;
	}

	function secondNotUndefined(x) {
		return !isUndefined(x[1]);<commit_msg>fixed up colors for expression data<commit_after>/*global define: false */
define(['underscore_ext',
		'jquery',
		'rx',
		'multi',
		'vgcanvas',
		'colorBar',
		'columnWidgets',
		'crosshairs',
		'heatmapColors',
		'partition',
		'tooltip',
		'util',
		'xenaQuery',
		'rx.jquery'
	], function (
		_,
		$,
		Rx,
		multi,
		vgcanvas,
		colorBar,
		widgets,
		crosshairs,
		heatmapColors,
		partition,
		tooltip,
		util,
		xenaQuery) {

	"use strict";

	var each = _.each,
		map = _.map,
		filter = _.filter,
		isUndefined = _.isUndefined,
		zip = _.zip,
		range = _.range,
		bind = _.bind,
		partial = _.partial,
		pluckPathsArray = _.pluckPathsArray,
		find = _.find,
		keys = _.keys,
		uniq = _.uniq,

		default_colors_map,
		color_schemes,
		scratch = vgcanvas(1, 1), // scratch buffer
		cmp,
		fetch,
		fetch_gene,
		fetch_gene_probes,
		fetch_feature,
		render;

	color_schemes = {
		blue_white_red: ['#0000ff', '#ffffff', '#ff0000'],
		green_black_red: ['#007f00', '#000000', '#ff0000'],
		green_black_yellow: ['#007f00', '#000000', '#ffff00']
		/* with clinical category palette:
		blue_white_red: ['#377eb8', '#ffffff', '#e41a1c'],
		green_black_red: ['#4daf4a', '#000000', '#e41a1c'],
		green_black_yellow: ['#4daf4a', '#000000', '#ffff33']
		*/
	};

	default_colors_map = {
		"gene expression": color_schemes.green_black_red,
		"gene expression RNAseq": color_schemes.green_black_red,
		"gene expression array": color_schemes.green_black_red,
		"exon expression RNAseq": color_schemes.green_black_red,
		"copy number": color_schemes.blue_white_red,
		"DNA methylation": color_schemes.blue_white_red,
		"PARADIGM pathway activity": color_schemes.blue_white_red,
		"protein expression RPPA": color_schemes.blue_white_red,
		"somaticMutation": color_schemes.blue_white_red,
		"phenotype": color_schemes.green_black_yellow,

		"common/dataSubType/geneRNAseq": color_schemes.green_black_red,
		"common/dataSubType/geneArray": color_schemes.green_black_red,
		"common/dataSubType/geneExp": color_schemes.green_black_red,
		"common/dataSubType/cna": color_schemes.blue_white_red,
		"common/dataSubType/cellViability": color_schemes.blue_white_red,
		"common/dataSubType/DNAMethylation": color_schemes.blue_white_red,
		"common/dataSubType/kinomeScreen": color_schemes.blue_white_red,
		"common/dataSubType/PARADIGM": color_schemes.blue_white_red,
		"common/dataSubType/phenotype": color_schemes.blue_white_red,
		"common/dataSubType/protein": color_schemes.blue_white_red,
		"common/dataSubType/somaticMutation": color_schemes.blue_white_red
	};

	function meannan(values) {
		var count = 0, sum = 0, i, v;
		if (!values) {
			return NaN;
		}
		sum = _.reduce(values, function (sum, v) {
			if (!isNaN(v)) {
				count += 1;
				return sum + v;
			}
			return sum;
		}, 0);
		if (count > 0) {
			return sum / count;
		}
		return NaN;
	}

	function default_colors (dataSubType) {
		return default_colors_map[dataSubType] ||
			color_schemes.blue_white_red;
	}

	function secondNotUndefined(x) {
		return !isUndefined(x[1]);
{'fraction_non_alphanumeric': 0.14319333816075308, 'fraction_numerical': 0.02606806661839247, 'mean_word_length': 4.486593843098312, 'pattern_counts': {'":': 32, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '7110700', 'n_tokens_mistral': 2463, 'n_tokens_neox': 2100, 'n_words': 373}