<commit_before>Ext.namespace('Gemma');

/**
 * User interface for selecting experimental factors.
 * 
 * @class Gemma.ExperimentalFactorChooserPanel
 * @extends Ext.Window
 * 
 * @author keshav
 * @version $Id: ExperimentalFactorChooserPanel.js,v 1.2 2008/06/17 21:36:04
 *          keshav Exp $
 */
Gemma.ExperimentalFactorChooserPanel = Ext.extend(Ext.Window, {
	id : 'factor-chooser',
	layout : 'fit',
	width : 800,
	height : 500,
	closeAction : 'hide',
	constrainHeader : true,

	onCommit : function() {

		if (this.efGrid) {
			var eeFactorsSelModel = this.efGrid.selModel;

			var experiments = [];
			var factors = [];

			var i = 0;
			while (eeFactorsSelModel.hasSelection()) {

				eeFactorsSelModel.select(i, 0);
				var experiment = eeFactorsSelModel.selection.record.data.name;
				experiments[i] = experiment;

				eeFactorsSelModel.select(i, 1);
				var selectedFactor = eeFactorsSelModel.selection.record.data.value;
				factors[i] = selectedFactor;

				i++;
			}

		}

		var eeFactorsMap = {<commit_msg>updates to creating the chosen factors map after user selection.<commit_after>Ext.namespace('Gemma');

/**
 * User interface for selecting experimental factors.
 * 
 * @class Gemma.ExperimentalFactorChooserPanel
 * @extends Ext.Window
 * 
 * @author keshav
 * @version $Id: ExperimentalFactorChooserPanel.js,v 1.2 2008/06/17 21:36:04
 *          keshav Exp $
 */
Gemma.ExperimentalFactorChooserPanel = Ext.extend(Ext.Window, {
	id : 'factor-chooser',
	layout : 'fit',
	width : 800,
	height : 500,
	closeAction : 'hide',
	constrainHeader : true,

	onCommit : function() {

		var experiments = [];
		var factors = [];

		if (this.efGrid) {
			var eeFactorsSelModel = this.efGrid.selModel;

			eeFactorsSelModel.select(0, 0);

			var data = eeFactorsSelModel.grid.data;

			for (var i = 0; i < data.size(); i++) {

				var d = data[i];
				if (!d.expressionExperiment) {
					break;
				}

				eeFactorsSelModel.select(i, 0);

				var ee = data[i].expressionExperiment.name;
				if (ee == eeFactorsSelModel.selection.record.data.name) {
					experiments[i] = data[i].expressionExperiment.id;

					var efs = data[i].experimentalFactors;
					for (var j = 0; j < efs.size(); j++) {
						var ef = efs[j].name;
						if (ef == eeFactorsSelModel.selection.record.data.value) {
							factors[i] = efs[j].id;
							break;
						} else {
							// continue
						}
					}

				} else {
					// continue
				}
			}

		}

		var eeFactorsMap = {
{'fraction_non_alphanumeric': 0.13436482084690554, 'fraction_numerical': 0.021172638436482084, 'mean_word_length': 3.0611570247933884, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '20587', 'n_tokens_mistral': 1070, 'n_tokens_neox': 835, 'n_words': 176}