function parseDilutionTransfers(str) {
	var rowArray = parseCsv(str, ",");
	// Order the arrray on plate ID:
	rowArray.sort(transferSorter(0,1));
	var transferArrays = [];
	// Add the array that will hold the buffer transfers:
	transferArrays.push([]);
	var plateSet = {};
	var sourceIndex;
	var diluentWell = convertCoords("A1");
	for(var i=0, n=rowArray.length; i<n; i++) {
		var row = rowArray[i];
		var sourcePlate, sourceWell, sourceVolume;
		var destinationPlate, destinationWell, diluentVolume;
		try {
			sourcePlate = row[0].trim();
			sourceWell = convertCoordsRegExp(row[1]);
			sourceVolume = parseNumber(row[2], 3);
			// Temporary fix to also handle format with destination plate ID:
			try {
				destinationWell = convertCoordsRegExp(row[4]);
				destinationPlate = row[3].trim();
				// The substraction float may contain many dec so it is rounded:
				diluentVolume = +(parseNumber(row[5], 3) - sourceVolume).toFixed(3);
			} catch(e) {
				destinationPlate = "diluted_plate";
				destinationWell = convertCoordsRegExp(row[3]);
				// The substraction float may contain many dec so it is rounded:
				diluentVolume = +(parseNumber(row[4], 3) - sourceVolume).toFixed(3);
			}
		} catch(e) {
			throw "UnableToParseTransferTableException:" + e;
		}
		var newTip;
		if(diluentVolume > 0) {
			newTip = (transferArrays[0].length === 0);
			transferArrays[0].push(new Transfer("diluent_reservoir",
				diluentWell, diluentVolume, destinationWell, destinationPlate, newTip));
		}
		if(!(sourcePlate in plateSet)) {
			plateSet[sourcePlate] = sourcePlate;
			sourceIndex = transferArrays.push([]) - 1;
		}
		if(sourceVolume > 0) {
			newTip = (sourceIndex > 1 || transferArrays[sourceIndex].length > 0);
			transferArrays[sourceIndex].push(new Transfer(sourcePlate, sourceWell,
				sourceVolume, destinationWell, destinationPlate, newTip));
		}
	}
	return transferArrays;
}
/*
 Creates an array of Transfer objects from a csv file with format:
	sourcePlate,sourceWell,sourceVolume,destinationWell,finalVolume
 where sourceWell and destinationWell are given in plate coordinates, e.g. 'D4'
 Creates one Transfer object for the source transfer and one for the diluent.
*/
Creates an array of Transfer objects from a csv file with format:
sourcePlate,sourceWell,sourceVolume,destinationWell,finalVolume
where sourceWell and destinationWell are given in plate coordinates, e.g. 'D4'
Creates one Transfer object for the source transfer and one for the diluent.
Creates an array of Transfer objects from a csv file with format : sourcePlate sourceWell sourceVolume destinationWell finalVolume where sourceWell and destinationWell are given in plate coordinates e . g . ' D4 ' Creates one Transfer object for the source transfer and one for the diluent .
function parseDilutionTransfers(str) {
	var rowArray = parseCsv(str, ",");
	rowArray.sort(transferSorter(0,1));
	var transferArrays = [];
	transferArrays.push([]);
	var plateSet = {};
	var sourceIndex;
	var diluentWell = convertCoords("A1");
	for(var i=0, n=rowArray.length; i<n; i++) {
		var row = rowArray[i];
		var sourcePlate, sourceWell, sourceVolume;
		var destinationPlate, destinationWell, diluentVolume;
		try {
			sourcePlate = row[0].trim();
			sourceWell = convertCoordsRegExp(row[1]);
			sourceVolume = parseNumber(row[2], 3);
			try {
				destinationWell = convertCoordsRegExp(row[4]);
				destinationPlate = row[3].trim();
				diluentVolume = +(parseNumber(row[5], 3) - sourceVolume).toFixed(3);
			} catch(e) {
				destinationPlate = "diluted_plate";
				destinationWell = convertCoordsRegExp(row[3]);
				diluentVolume = +(parseNumber(row[4], 3) - sourceVolume).toFixed(3);
			}
		} catch(e) {
			throw "UnableToParseTransferTableException:" + e;
		}
		var newTip;
		if(diluentVolume > 0) {
			newTip = (transferArrays[0].length === 0);
			transferArrays[0].push(new Transfer("diluent_reservoir",
				diluentWell, diluentVolume, destinationWell, destinationPlate, newTip));
		}
		if(!(sourcePlate in plateSet)) {
			plateSet[sourcePlate] = sourcePlate;
			sourceIndex = transferArrays.push([]) - 1;
		}
		if(sourceVolume > 0) {
			newTip = (sourceIndex > 1 || transferArrays[sourceIndex].length > 0);
			transferArrays[sourceIndex].push(new Transfer(sourcePlate, sourceWell,
				sourceVolume, destinationWell, destinationPlate, newTip));
		}
	}
	return transferArrays;
}
function parseDilutionTransfers ( str ) { var rowArray = parseCsv ( str , "," ) ; rowArray . sort ( transferSorter ( 0 , 1 ) ) ; var transferArrays = [ ] ; transferArrays . push ( [ ] ) ; var plateSet = { } ; var sourceIndex ; var diluentWell = convertCoords ( "A1" ) ; for ( var i = 0 , n = rowArray . length ; i < n ; i ++ ) { var row = rowArray [ i ] ; var sourcePlate , sourceWell , sourceVolume ; var destinationPlate , destinationWell , diluentVolume ; try { sourcePlate = row [ 0 ] . trim ( ) ; sourceWell = convertCoordsRegExp ( row [ 1 ] ) ; sourceVolume = parseNumber ( row [ 2 ] , 3 ) ; try { destinationWell = convertCoordsRegExp ( row [ 4 ] ) ; destinationPlate = row [ 3 ] . trim ( ) ; diluentVolume = + ( parseNumber ( row [ 5 ] , 3 ) - sourceVolume ) . toFixed ( 3 ) ; } catch ( e ) { destinationPlate = "diluted_plate" ; destinationWell = convertCoordsRegExp ( row [ 3 ] ) ; diluentVolume = + ( parseNumber ( row [ 4 ] , 3 ) - sourceVolume ) . toFixed ( 3 ) ; } } catch ( e ) { throw "UnableToParseTransferTableException:" + e ; } var newTip ; if ( diluentVolume > 0 ) { newTip = ( transferArrays [ 0 ] . length === 0 ) ; transferArrays [ 0 ] . push ( new Transfer ( "diluent_reservoir" , diluentWell , diluentVolume , destinationWell , destinationPlate , newTip ) ) ; } if ( ! ( sourcePlate in plateSet ) ) { plateSet [ sourcePlate ] = sourcePlate ; sourceIndex = transferArrays . push ( [ ] ) - 1 ; } if ( sourceVolume > 0 ) { newTip = ( sourceIndex > 1 || transferArrays [ sourceIndex ] . length > 0 ) ; transferArrays [ sourceIndex ] . push ( new Transfer ( sourcePlate , sourceWell , sourceVolume , destinationWell , destinationPlate , newTip ) ) ; } } return transferArrays ; }
Creates an array of Transfer objects from a csv file with format:
sourcePlate,sourceWell,sourceVolume,destinationWell,finalVolume
where sourceWell and destinationWell are given in plate coordinates, e.g.
Creates an array of Transfer objects from a csv file with format : sourcePlate sourceWell sourceVolume destinationWell finalVolume where sourceWell and destinationWell are given in plate coordinates e . g .
// Order the arrray on plate ID: // Add the array that will hold the buffer transfers: // Temporary fix to also handle format with destination plate ID: // The substraction float may contain many dec so it is rounded: // The substraction float may contain many dec so it is rounded: