function sortRowsByPlate(row1, row2) {
	var a = {}, b = {};
	a.id = row1[0].toLowerCase();
	b.id = row2[0].toLowerCase();
	// If plate ID is a number, convert from string to int/double:
	if(isNumber(a.id) && isNumber(b.id)) {
		a.id = parseNumber(a.id);
		b.id = parseNumber(b.id);
	}
	// Sort alphabetically/numerically on plate ID, then source well:
	if(a.id !== b.id) {
		return (a.id < b.id) ? -1 : (a.id > b.id ? 1 : 0);
	} else {
		a.coords = convertCoordsRegExp(row1[1]);
		b.coords = convertCoordsRegExp(row2[1]);
		return (a.coords[1] === b.coords[1]) ? a.coords[0] - b.coords[0] : a.coords[1] - b.coords[1];
	}
}
/*
 Sorts rows alphabetically or numerically column 1, then by well (col-then-row)
 in column 2
*/
Sorts rows alphabetically or numerically column 1, then by well (col-then-row)
in column 2
Sorts rows alphabetically or numerically column 1 then by well ( col - then - row ) in column 2
function sortRowsByPlate(row1, row2) {
	var a = {}, b = {};
	a.id = row1[0].toLowerCase();
	b.id = row2[0].toLowerCase();
	if(isNumber(a.id) && isNumber(b.id)) {
		a.id = parseNumber(a.id);
		b.id = parseNumber(b.id);
	}
	if(a.id !== b.id) {
		return (a.id < b.id) ? -1 : (a.id > b.id ? 1 : 0);
	} else {
		a.coords = convertCoordsRegExp(row1[1]);
		b.coords = convertCoordsRegExp(row2[1]);
		return (a.coords[1] === b.coords[1]) ? a.coords[0] - b.coords[0] : a.coords[1] - b.coords[1];
	}
}
function sortRowsByPlate ( row1 , row2 ) { var a = { } , b = { } ; a . id = row1 [ 0 ] . toLowerCase ( ) ; b . id = row2 [ 0 ] . toLowerCase ( ) ; if ( isNumber ( a . id ) && isNumber ( b . id ) ) { a . id = parseNumber ( a . id ) ; b . id = parseNumber ( b . id ) ; } if ( a . id !== b . id ) { return ( a . id < b . id ) ? - 1 : ( a . id > b . id ? 1 : 0 ) ; } else { a . coords = convertCoordsRegExp ( row1 [ 1 ] ) ; b . coords = convertCoordsRegExp ( row2 [ 1 ] ) ; return ( a . coords [ 1 ] === b . coords [ 1 ] ) ? a . coords [ 0 ] - b . coords [ 0 ] : a . coords [ 1 ] - b . coords [ 1 ] ; } }
Sorts rows alphabetically or numerically column 1, then by well (col-then-row)
in column 2
Sorts rows alphabetically or numerically column 1 then by well ( col - then - row ) in column 2
// If plate ID is a number, convert from string to int/double: // Sort alphabetically/numerically on plate ID, then source well: