function parseDilutionTransfersLims(str) {
	var rowArray = parseCsv(str, ",");
	var diluentTransferArray = [];
	var sampleTransferArray = [];
	var firstDataRow;
	// Find the header row:
	for(var i=0, n=rowArray.length; i<n; i++) {
		if(rowArray[i][0] === "Sample Name") {
			firstDataRow = i + 1;
			break;
		}
	}
	for(var i=firstDataRow, n=rowArray.length; i<n; i++) {
		var row = rowArray[i];
		var sourceWell, sourceVolume, destinationWell, diluentVolume;
		try {
			sourceWell = convertCoordsRegExp(row[2]);
			destinationWell = convertCoordsRegExp(row[7]);
			diluentWell = convertCoords("A1");
			// A missing value should be treated as 0 volume:
			try {
				sourceVolume = readNumeral(row[5], 3);
			} catch(e) {
				if(row[5] === "") {
					sourceVolume = 0;
				} else {
					throw e;
				}
			}
			try {
				diluentVolume = readNumeral(row[11], 3);
			} catch(e) {
				if(row[11] === "") {
					diluentVolume = 0;
				} else {
					throw e;
				}
			}
		} catch(e) {
			throw "UnableToParseTransferTableException:" + e;
		}
		var newTip;
		if(sourceVolume > 0) {
			newTip = (sampleTransferArray.length != 0);
			sampleTransferArray.push(new Transfer("sample_plate", sourceWell,
				sourceVolume, destinationWell, newTip));
		}
		if(diluentVolume > 0) {
			newTip = (diluentTransferArray.length == 0);
			diluentTransferArray.push(new Transfer("diluent_reservoir",
				diluentWell, diluentVolume, destinationWell, newTip));
		}
	}
	return diluentTransferArray.concat(sampleTransferArray);
}
/*
 Creates an array of Transfer objects from a csv file with a format matching
 what the normalization process of the GenoLogics Clarity LIMS produces
*/
Creates an array of Transfer objects from a csv file with a format matching
what the normalization process of the GenoLogics Clarity LIMS produces
Creates an array of Transfer objects from a csv file with a format matching what the normalization process of the GenoLogics Clarity LIMS produces
function parseDilutionTransfersLims(str) {
	var rowArray = parseCsv(str, ",");
	var diluentTransferArray = [];
	var sampleTransferArray = [];
	var firstDataRow;
	for(var i=0, n=rowArray.length; i<n; i++) {
		if(rowArray[i][0] === "Sample Name") {
			firstDataRow = i + 1;
			break;
		}
	}
	for(var i=firstDataRow, n=rowArray.length; i<n; i++) {
		var row = rowArray[i];
		var sourceWell, sourceVolume, destinationWell, diluentVolume;
		try {
			sourceWell = convertCoordsRegExp(row[2]);
			destinationWell = convertCoordsRegExp(row[7]);
			diluentWell = convertCoords("A1");
			try {
				sourceVolume = readNumeral(row[5], 3);
			} catch(e) {
				if(row[5] === "") {
					sourceVolume = 0;
				} else {
					throw e;
				}
			}
			try {
				diluentVolume = readNumeral(row[11], 3);
			} catch(e) {
				if(row[11] === "") {
					diluentVolume = 0;
				} else {
					throw e;
				}
			}
		} catch(e) {
			throw "UnableToParseTransferTableException:" + e;
		}
		var newTip;
		if(sourceVolume > 0) {
			newTip = (sampleTransferArray.length != 0);
			sampleTransferArray.push(new Transfer("sample_plate", sourceWell,
				sourceVolume, destinationWell, newTip));
		}
		if(diluentVolume > 0) {
			newTip = (diluentTransferArray.length == 0);
			diluentTransferArray.push(new Transfer("diluent_reservoir",
				diluentWell, diluentVolume, destinationWell, newTip));
		}
	}
	return diluentTransferArray.concat(sampleTransferArray);
}
function parseDilutionTransfersLims ( str ) { var rowArray = parseCsv ( str , "," ) ; var diluentTransferArray = [ ] ; var sampleTransferArray = [ ] ; var firstDataRow ; for ( var i = 0 , n = rowArray . length ; i < n ; i ++ ) { if ( rowArray [ i ] [ 0 ] === "Sample Name" ) { firstDataRow = i + 1 ; break ; } } for ( var i = firstDataRow , n = rowArray . length ; i < n ; i ++ ) { var row = rowArray [ i ] ; var sourceWell , sourceVolume , destinationWell , diluentVolume ; try { sourceWell = convertCoordsRegExp ( row [ 2 ] ) ; destinationWell = convertCoordsRegExp ( row [ 7 ] ) ; diluentWell = convertCoords ( "A1" ) ; try { sourceVolume = readNumeral ( row [ 5 ] , 3 ) ; } catch ( e ) { if ( row [ 5 ] === "" ) { sourceVolume = 0 ; } else { throw e ; } } try { diluentVolume = readNumeral ( row [ 11 ] , 3 ) ; } catch ( e ) { if ( row [ 11 ] === "" ) { diluentVolume = 0 ; } else { throw e ; } } } catch ( e ) { throw "UnableToParseTransferTableException:" + e ; } var newTip ; if ( sourceVolume > 0 ) { newTip = ( sampleTransferArray . length != 0 ) ; sampleTransferArray . push ( new Transfer ( "sample_plate" , sourceWell , sourceVolume , destinationWell , newTip ) ) ; } if ( diluentVolume > 0 ) { newTip = ( diluentTransferArray . length == 0 ) ; diluentTransferArray . push ( new Transfer ( "diluent_reservoir" , diluentWell , diluentVolume , destinationWell , newTip ) ) ; } } return diluentTransferArray . concat ( sampleTransferArray ) ; }
Creates an array of Transfer objects from a csv file with a format matching
what the normalization process of the GenoLogics Clarity LIMS produces
Creates an array of Transfer objects from a csv file with a format matching what the normalization process of the GenoLogics Clarity LIMS produces
// Find the header row: // A missing value should be treated as 0 volume: