Skip to content

Commit 96d37d1

Browse files
committed
Allow user to supply 10x chemistry on import
1 parent 397bc2a commit 96d37d1

File tree

1 file changed

+33
-4
lines changed

1 file changed

+33
-4
lines changed

singlecell/resources/web/singlecell/panel/PoolImportPanel.js

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ Ext4.define('SingleCell.panel.PoolImportPanel', {
141141
name: 'tcr_library_fragment',
142142
labels: ['TCR Library Fragment Size', 'TCR Library Fragment Size (bp)'],
143143
allowRowSpan: true
144+
},{
145+
name: 'kitType',
146+
labels: ['Kit Type', 'V1.1/V2/HT', 'V1.1/HT'],
147+
transform: 'kitType'
144148
}],
145149

146150
IGNORED_COLUMNS: [],
@@ -233,12 +237,17 @@ Ext4.define('SingleCell.panel.PoolImportPanel', {
233237
return val;
234238
},
235239

236-
citeSeqTenXBarcode: function(val, panel){
240+
citeSeqTenXBarcode: function(val, panel, row){
237241
if (!val){
238242
return null;
239243
}
240244

241-
var barcodeSeries = panel.down('#useDualIndex').getValue() ? 'SI-TN' : 'SI-NA';
245+
var isDual = panel.down('#useDualIndex').getValue()
246+
if (Ext4.isDefined(row.dualIndex10x)) {
247+
isDual = row.dualIndex10x;
248+
}
249+
250+
var barcodeSeries = isDual ? 'SI-TN' : 'SI-NA';
242251
val = val.toUpperCase();
243252
var re = new RegExp('^' + barcodeSeries + '-', 'i');
244253
if (!val.match(re)) {
@@ -253,12 +262,17 @@ Ext4.define('SingleCell.panel.PoolImportPanel', {
253262
return val;
254263
},
255264

256-
tenXBarcode: function(val, panel){
265+
tenXBarcode: function(val, panel, row){
257266
if (!val){
258267
return;
259268
}
260269

261-
var barcodeSeries = panel.down('#useDualIndex').getValue() ? 'SI-TT' : 'SI-GA';
270+
var isDual = panel.down('#useDualIndex').getValue()
271+
if (Ext4.isDefined(row.dualIndex10x)) {
272+
isDual = row.dualIndex10x;
273+
}
274+
275+
var barcodeSeries = isDual ? 'SI-TT' : 'SI-GA';
262276
val = val.toUpperCase();
263277
var re = new RegExp('^' + barcodeSeries + '-', 'i');
264278
if (!val.match(re)) {
@@ -701,11 +715,26 @@ Ext4.define('SingleCell.panel.PoolImportPanel', {
701715
var ret = [];
702716

703717
var doSplitCellsByPool = false;
718+
var kitCol = colArray.filter(function(x){ return x.dataIdx === 'kitType'});
719+
kitCol = kitCol.length ? kitCol[0] : null;
720+
704721
Ext4.Array.forEach(rows, function(row, rowIdx){
705722
var data = {
706723
objectId: LABKEY.Utils.generateUUID()
707724
};
708725

726+
if (kitCol && row[kitCol.dataIdx]) {
727+
if (row[kitCol.dataIdx].toUpperCase() === 'V1.1') {
728+
row.dualIndex10x = false;
729+
}
730+
else if (row[kitCol.dataIdx].toUpperCase() === 'V2' || row[kitCol.dataIdx].toUpperCase() === 'HT') {
731+
row.dualIndex10x = true;
732+
}
733+
else {
734+
console.error('Unknown kit type: ' + row[kitCol.dataIdx]);
735+
}
736+
}
737+
709738
Ext4.Array.forEach(colArray, function(col, colIdx){
710739
var cell = Ext4.isDefined(col.dataIdx) ? row[col.dataIdx] : '';
711740
if (cell){

0 commit comments

Comments
 (0)