function parseTransfers(str) {
	var rowArray = parseCsv(str, ",");
	/*
	// Sort the array alphabetically by plate ID:
	rowArray.sort(function(row1, row2) {
		var a = row1[0].toLowerCase();
		var b = row2[0].toLowerCase();
		return a < b ? -1 : (a > b ? 1 : 0);
	});
	*/
	// Sort the array numerically by plate index:
	rowArray.sort(function(row1, row2) {
		var a = parseInt(row1[0], 10);
		var b = parseInt(row2[0], 10);
		return a - b;
	});
	var transferArray = [];
	var plateMap = {};
	for(var i = 0, n = rowArray.length; i < n; i++) {
		var row = rowArray[i];
		/*
		var sourcePlate = row[0];
		var sourcePlateIndex;
		// Assign an index to the plate ID:
		if(sourcePlate in plateMap) {
			sourcePlateIndex = plateMap[sourcePlate];
		} else {
			sourcePlateIndex = Object.keys(plateMap).length - 1;
			plateMap[sourcePlate] = sourcePlateIndex;
		}
		*/
		var sourcePlateIndex, sourceWell, volume, destinationWell;
		try {
			sourcePlateIndex = readNumeral(row[0]) - 1;
			sourceWell = convertCoords(row[1]);
			volume = readNumeral(row[2]);
			destinationWell = convertCoords(row[3]);
		} catch(e) {
			throw "UnableToParseTransferTableException:" + e;
		}
		if(volume) {
			transferArray.push(new Transfer(sourcePlateIndex, sourceWell,
				volume, destinationWell, true));
		}
	}
	return transferArray;
}
/*
 Creates an array of Transfer objects from a csv file with format:
		sourcePlate,sourceWell,volume,destinationWell
 where sourceWell and destination are given in well coordinates, e.g. 'D4'
 and sourcePlate is an index, starting from 1, identifying which plate to
 transfer from
*/
Creates an array of Transfer objects from a csv file with format:
sourcePlate,sourceWell,volume,destinationWell
where sourceWell and destination are given in well coordinates, e.g. 'D4'
and sourcePlate is an index, starting from 1, identifying which plate to
transfer from
Creates an array of Transfer objects from a csv file with format : sourcePlate sourceWell volume destinationWell where sourceWell and destination are given in well coordinates e . g . ' D4 ' and sourcePlate is an index starting from 1 identifying which plate to transfer from
function parseTransfers(str) {
	var rowArray = parseCsv(str, ",");
	rowArray.sort(function(row1, row2) {
		var a = parseInt(row1[0], 10);
		var b = parseInt(row2[0], 10);
		return a - b;
	});
	var transferArray = [];
	var plateMap = {};
	for(var i = 0, n = rowArray.length; i < n; i++) {
		var row = rowArray[i];
		var sourcePlateIndex, sourceWell, volume, destinationWell;
		try {
			sourcePlateIndex = readNumeral(row[0]) - 1;
			sourceWell = convertCoords(row[1]);
			volume = readNumeral(row[2]);
			destinationWell = convertCoords(row[3]);
		} catch(e) {
			throw "UnableToParseTransferTableException:" + e;
		}
		if(volume) {
			transferArray.push(new Transfer(sourcePlateIndex, sourceWell,
				volume, destinationWell, true));
		}
	}
	return transferArray;
}
function parseTransfers ( str ) { var rowArray = parseCsv ( str , "," ) ; rowArray . sort ( function ( row1 , row2 ) { var a = parseInt ( row1 [ 0 ] , 10 ) ; var b = parseInt ( row2 [ 0 ] , 10 ) ; return a - b ; } ) ; var transferArray = [ ] ; var plateMap = { } ; for ( var i = 0 , n = rowArray . length ; i < n ; i ++ ) { var row = rowArray [ i ] ; var sourcePlateIndex , sourceWell , volume , destinationWell ; try { sourcePlateIndex = readNumeral ( row [ 0 ] ) - 1 ; sourceWell = convertCoords ( row [ 1 ] ) ; volume = readNumeral ( row [ 2 ] ) ; destinationWell = convertCoords ( row [ 3 ] ) ; } catch ( e ) { throw "UnableToParseTransferTableException:" + e ; } if ( volume ) { transferArray . push ( new Transfer ( sourcePlateIndex , sourceWell , volume , destinationWell , true ) ) ; } } return transferArray ; }
Creates an array of Transfer objects from a csv file with format:
sourcePlate,sourceWell,volume,destinationWell
where sourceWell and destination are given in well coordinates, e.g.
Creates an array of Transfer objects from a csv file with format : sourcePlate sourceWell volume destinationWell where sourceWell and destination are given in well coordinates e . g .
/*
	// Sort the array alphabetically by plate ID:
	rowArray.sort(function(row1, row2) {
		var a = row1[0].toLowerCase();
		var b = row2[0].toLowerCase();
		return a < b ? -1 : (a > b ? 1 : 0);
	});
	*/ // Sort the array numerically by plate index: /*
		var sourcePlate = row[0];
		var sourcePlateIndex;
		// Assign an index to the plate ID:
		if(sourcePlate in plateMap) {
			sourcePlateIndex = plateMap[sourcePlate];
		} else {
			sourcePlateIndex = Object.keys(plateMap).length - 1;
			plateMap[sourcePlate] = sourcePlateIndex;
		}
		*/