function parseAdapterTransfers(str, indexSet) {
	// Tables mapping the plate positions of the different adapters: 
	var INDEX_SETS = {};
	
	INDEX_SETS["truseq"] = {1:"A1", 2:"B1", 3:"C1", 4:"D1", 5:"E1", 6:"F1",
							7:"G1", 8:"H1", 9:"A2", 10:"B2", 11:"C2", 12:"D2",
							13:"E2", 14:"F2", 15:"G2", 16:"H2", 18:"A3",
							19:"B3", 20:"C3", 21:"D3", 22:"E3", 23:"F3",
							25:"G3", 27:"H3"};
	
	INDEX_SETS["sureselect"] = {1:"A1", 2:"B1", 3:"C1", 4:"D1", 5:"E1", 6:"F1",
							7:"G1", 8:"H1", 9:"A2", 10:"B2", 11:"C2", 12:"D2",
							13:"E2"};
	var plateMap; 
	if(!indexSet) {
		plateMap = INDEX_SETS["truseq"];
	} else if(indexSet in INDEX_SETS) {
		plateMap = INDEX_SETS[indexSet];
	} else {
		throw "UnknownIndexSetIdException";
	}
	var rowArray = parseCsv(str, ",");
	// Sort the array by index:
	rowArray.sort(function(a, b) {
		// Assumes a, b is [(string) well, (int) index]
		return parseInt(a[1], 10) - parseInt(b[1], 10);
	});
	// Create transfer objects from sorted array:
	var transferArray = [];
	for(var i = 0, len = rowArray.length; i < len; i++) {
		var row = rowArray[i];
		var source, volume, destination;
		try {
			source = convertCoords(plateMap[row[1]]);
			volume = readNumeral(row[2]);
			destination = convertCoords(row[0]);
		} catch(e) {
			throw "UnableToParseTransferTableException:" + e;
		}
		// Keep tip between transfers of the same index:
		var newTip = (i == 0) || (row[1] != rowArray[i-1][1]);
		if(volume) {
			transferArray.push(new Transfer("adapter_plate", source, volume,
				destination, newTip));
		}
	}
	return transferArray;
}
/*
 Creates an array of Transfer objects from a csv file with format:
		destination,index,volume
 where well is given in well coordinates, e.g. 'D4'
*/
Creates an array of Transfer objects from a csv file with format:
destination,index,volume
where well is given in well coordinates, e.g. 'D4'
Creates an array of Transfer objects from a csv file with format : destination index volume where well is given in well coordinates e . g . ' D4 '
function parseAdapterTransfers(str, indexSet) {
	var INDEX_SETS = {};
	INDEX_SETS["truseq"] = {1:"A1", 2:"B1", 3:"C1", 4:"D1", 5:"E1", 6:"F1",
							7:"G1", 8:"H1", 9:"A2", 10:"B2", 11:"C2", 12:"D2",
							13:"E2", 14:"F2", 15:"G2", 16:"H2", 18:"A3",
							19:"B3", 20:"C3", 21:"D3", 22:"E3", 23:"F3",
							25:"G3", 27:"H3"};
	INDEX_SETS["sureselect"] = {1:"A1", 2:"B1", 3:"C1", 4:"D1", 5:"E1", 6:"F1",
							7:"G1", 8:"H1", 9:"A2", 10:"B2", 11:"C2", 12:"D2",
							13:"E2"};
	var plateMap; 
	if(!indexSet) {
		plateMap = INDEX_SETS["truseq"];
	} else if(indexSet in INDEX_SETS) {
		plateMap = INDEX_SETS[indexSet];
	} else {
		throw "UnknownIndexSetIdException";
	}
	var rowArray = parseCsv(str, ",");
	rowArray.sort(function(a, b) {
		return parseInt(a[1], 10) - parseInt(b[1], 10);
	});
	var transferArray = [];
	for(var i = 0, len = rowArray.length; i < len; i++) {
		var row = rowArray[i];
		var source, volume, destination;
		try {
			source = convertCoords(plateMap[row[1]]);
			volume = readNumeral(row[2]);
			destination = convertCoords(row[0]);
		} catch(e) {
			throw "UnableToParseTransferTableException:" + e;
		}
		var newTip = (i == 0) || (row[1] != rowArray[i-1][1]);
		if(volume) {
			transferArray.push(new Transfer("adapter_plate", source, volume,
				destination, newTip));
		}
	}
	return transferArray;
}
function parseAdapterTransfers ( str , indexSet ) { var INDEX_SETS = { } ; INDEX_SETS [ "truseq" ] = { 1 : "A1" , 2 : "B1" , 3 : "C1" , 4 : "D1" , 5 : "E1" , 6 : "F1" , 7 : "G1" , 8 : "H1" , 9 : "A2" , 10 : "B2" , 11 : "C2" , 12 : "D2" , 13 : "E2" , 14 : "F2" , 15 : "G2" , 16 : "H2" , 18 : "A3" , 19 : "B3" , 20 : "C3" , 21 : "D3" , 22 : "E3" , 23 : "F3" , 25 : "G3" , 27 : "H3" } ; INDEX_SETS [ "sureselect" ] = { 1 : "A1" , 2 : "B1" , 3 : "C1" , 4 : "D1" , 5 : "E1" , 6 : "F1" , 7 : "G1" , 8 : "H1" , 9 : "A2" , 10 : "B2" , 11 : "C2" , 12 : "D2" , 13 : "E2" } ; var plateMap ; if ( ! indexSet ) { plateMap = INDEX_SETS [ "truseq" ] ; } else if ( indexSet in INDEX_SETS ) { plateMap = INDEX_SETS [ indexSet ] ; } else { throw "UnknownIndexSetIdException" ; } var rowArray = parseCsv ( str , "," ) ; rowArray . sort ( function ( a , b ) { return parseInt ( a [ 1 ] , 10 ) - parseInt ( b [ 1 ] , 10 ) ; } ) ; var transferArray = [ ] ; for ( var i = 0 , len = rowArray . length ; i < len ; i ++ ) { var row = rowArray [ i ] ; var source , volume , destination ; try { source = convertCoords ( plateMap [ row [ 1 ] ] ) ; volume = readNumeral ( row [ 2 ] ) ; destination = convertCoords ( row [ 0 ] ) ; } catch ( e ) { throw "UnableToParseTransferTableException:" + e ; } var newTip = ( i == 0 ) || ( row [ 1 ] != rowArray [ i - 1 ] [ 1 ] ) ; if ( volume ) { transferArray . push ( new Transfer ( "adapter_plate" , source , volume , destination , newTip ) ) ; } } return transferArray ; }
Creates an array of Transfer objects from a csv file with format:
destination,index,volume
where well is given in well coordinates, e.g.
Creates an array of Transfer objects from a csv file with format : destination index volume where well is given in well coordinates e . g .
// Tables mapping the plate positions of the different adapters:  // Sort the array by index: // Assumes a, b is [(string) well, (int) index] // Create transfer objects from sorted array: // Keep tip between transfers of the same index: