@@ -22,7 +22,7 @@ Ext4.define('SingleCell.panel.LibraryExportPanel', {
2222 name : 'importType' ,
2323 columns : 1 ,
2424 items : [ {
25- boxLabel : 'Novogene/ Plate List' ,
25+ boxLabel : '10x Plate List' ,
2626 inputValue : 'plateList' ,
2727 name : 'importType' ,
2828 checked : true
@@ -112,7 +112,7 @@ Ext4.define('SingleCell.panel.LibraryExportPanel', {
112112 forceSelection : true ,
113113 editable : true ,
114114 allowBlank : true ,
115- storeValues : [ 'Novogene' , 'Novogene-New' ]
115+ storeValues : [ 'Novogene' , 'Novogene-New' , 'MedGenome' ]
116116 } , {
117117 xtype : 'textarea' ,
118118 itemId : 'plateList' ,
@@ -145,7 +145,7 @@ Ext4.define('SingleCell.panel.LibraryExportPanel', {
145145 xtype : 'ldk-numberfield' ,
146146 itemId : 'laneDataMax' ,
147147 fieldLabel : 'Max Data Per Lane' ,
148- value : 700
148+ value : 900
149149 } , {
150150 xtype : 'ldk-numberfield' ,
151151 itemId : 'defaultVolume' ,
@@ -167,26 +167,26 @@ Ext4.define('SingleCell.panel.LibraryExportPanel', {
167167 Ext4 . Array . forEach ( text , function ( r , idx ) {
168168 var val = r [ 0 ] ;
169169 if ( val . startsWith ( 'G' ) ) {
170- val = val . substr ( 1 ) ;
170+ val = val . substring ( 1 ) ;
171171 val = val . replace ( '_' , '-' ) ;
172172 r [ 0 ] = 'GEX' ;
173173 r . unshift ( val ) ;
174174
175175 }
176176 else if ( val . startsWith ( 'T' ) ) {
177- val = val . substr ( 1 ) ;
177+ val = val . substring ( 1 ) ;
178178 val = val . replace ( '_' , '-' ) ;
179179 r [ 0 ] = 'VDJ' ;
180180 r . unshift ( val ) ;
181181 }
182182 else if ( val . startsWith ( 'H' ) || val . startsWith ( 'M' ) ) {
183- val = val . substr ( 1 ) ;
183+ val = val . substring ( 1 ) ;
184184 val = val . replace ( '_' , '-' ) ;
185185 r [ 0 ] = 'HTO' ;
186186 r . unshift ( val ) ;
187187 }
188188 else if ( val . startsWith ( 'C' ) ) {
189- val = val . substr ( 1 ) ;
189+ val = val . substring ( 1 ) ;
190190 val = val . replace ( '_' , '-' ) ;
191191 r [ 0 ] = 'CITE' ;
192192 r . unshift ( val ) ;
@@ -213,7 +213,7 @@ Ext4.define('SingleCell.panel.LibraryExportPanel', {
213213
214214 if ( r [ 0 ] . match ( '\\*$' ) ) {
215215 var m = r [ 0 ] . match ( '\\*$' ) ;
216- var val = r [ 0 ] . substr ( 0 , m . index ) ;
216+ var val = r [ 0 ] . substring ( 0 , m . index ) ;
217217 wildcards [ val ] = r ;
218218 }
219219 } , this ) ;
@@ -843,7 +843,7 @@ Ext4.define('SingleCell.panel.LibraryExportPanel', {
843843 } , this ) ;
844844 }
845845 }
846- else if ( instrument === '10x Sample Sheet' || instrument === 'Novogene' || instrument === 'Novogene-New' ) {
846+ else if ( instrument === '10x Sample Sheet' || instrument === 'Novogene' || instrument === 'Novogene-New' || instrument === 'MedGenome' ) {
847847 //we make the default assumption that we're using 10x primers, which are listed in the sample-sheet orientation
848848 var doRC = false ;
849849 var rows = [ ] ;
@@ -862,7 +862,8 @@ Ext4.define('SingleCell.panel.LibraryExportPanel', {
862862
863863 var cleanedName = r [ fieldName ] + '_' + r [ fieldName + '/name' ] . replace ( / / g, '_' ) ;
864864 cleanedName = cleanedName . replace ( / \/ / g, '-' ) ;
865- var sampleName = getSampleName ( simpleSampleNames , r [ fieldName ] , r [ fieldName + '/name' ] ) + ( suffix && instrument . startsWith ( 'Novogene' ) ? '' : '-' + suffix ) ;
865+ var sampleName = getSampleName ( simpleSampleNames , r [ fieldName ] , r [ fieldName + '/name' ] ) + ( suffix && ( instrument . startsWith ( 'Novogene' ) || instrument === 'MedGenome' ) ? '' : '-' + suffix ) ;
866+ console . log ( sampleName )
866867
867868 var barcode5s = r [ fieldName + '/barcode5/sequence' ] ? r [ fieldName + '/barcode5/sequence' ] . split ( ',' ) : [ ] ;
868869 if ( ! barcode5s . length ) {
@@ -968,6 +969,53 @@ Ext4.define('SingleCell.panel.LibraryExportPanel', {
968969 data . push ( r . laneAssignment || '' ) ;
969970 data . push ( barcode5Name || '' ) ;
970971 }
972+ else if ( instrument === 'MedGenome' ) {
973+ let libraryType = 'UNKNOWN' ;
974+ switch ( suffix ) {
975+ case 'GEX' :
976+ libraryType = '10x GEX' ;
977+ break ;
978+ case 'TCR' :
979+ libraryType = '10X VDJ' ;
980+ break ;
981+ case 'HTO' :
982+ libraryType = 'Cell Hashing' ;
983+ case 'CITE' :
984+ libraryType = '10X Feature Barcode' ;
985+ break ;
986+ default :
987+ console . error ( 'Unknown suffix: ' + suffix ) ;
988+ }
989+
990+ data = [ sampleName ] ;
991+ data . push ( r . plateAlias ? r . plateAlias : samplePrefix + r . plateId . replace ( / - / g, '_' ) ) ;
992+ data . push ( r . laneAssignment ? 'Pool on Lane ' + r . laneAssignment : '' ) ;
993+ data . push ( '1.5 mL tube' ) ;
994+ data . push ( totalData + 'GB' ) ; //Total data
995+ data . push ( 'PBMC' ) ; // Source
996+ data . push ( 'Macaque' ) ; // Species
997+ data . push ( libraryType ) ;
998+ data . push ( '10x' ) ; // Kit type
999+ data . push ( '10x' ) ; // Index type
1000+
1001+ data . push ( r [ fieldName + '/barcode5' ] ) ;
1002+ data . push ( bc ) ; // i7
1003+
1004+ data . push ( r [ fieldName + '/barcode3' ] )
1005+ data . push ( bc3 ) ; //P5
1006+
1007+ data . push ( size ) ;
1008+
1009+ var quantity = defaultVolume * r [ fieldName + '/concentration' ] ;
1010+ data . push ( quantity ) ;
1011+ data . push ( defaultVolume ) ;
1012+ data . push ( r [ fieldName + '/concentration' ] || '' ) ;
1013+
1014+ data . push ( r . laneAssignment || '' ) ;
1015+ data . push ( r . laneAssignment ? 'Lane ' + r . laneAssignment : '' ) ;
1016+
1017+ console . log ( data )
1018+ }
9711019 rows . push ( data . join ( delim ) ) ;
9721020 } , this ) ;
9731021
@@ -978,7 +1026,7 @@ Ext4.define('SingleCell.panel.LibraryExportPanel', {
9781026 }
9791027 } ;
9801028
981- var delim = instrument . startsWith ( 'Novogene' ) ? '\t' : ',' ;
1029+ var delim = instrument . startsWith ( 'Novogene' ) || instrument === 'MedGenome' ? '\t' : ',' ;
9821030 Ext4 . Array . forEach ( sortedRows , function ( r ) {
9831031 var totalCells = totalCellsByReadset [ r . plateId ] ;
9841032
@@ -994,7 +1042,7 @@ Ext4.define('SingleCell.panel.LibraryExportPanel', {
9941042 } , this ) ;
9951043
9961044 //add missing barcodes:
997- if ( includeBlanks && ! instrument . startsWith ( 'Novogene' ) ) {
1045+ if ( includeBlanks && ! instrument . startsWith ( 'Novogene' ) && ! instrument . startsWith ( 'MedGenome' ) ) {
9981046 var blankIdx = 0 ;
9991047 Ext4 . Array . forEach ( SingleCell . panel . LibraryExportPanel . TENX_BARCODES , function ( barcode5 ) {
10001048 if ( barcodeCombosUsed . indexOf ( barcode5 ) === - 1 ) {
@@ -1007,6 +1055,13 @@ Ext4.define('SingleCell.panel.LibraryExportPanel', {
10071055 }
10081056 } , this ) ;
10091057 }
1058+
1059+ if ( instrument === 'MedGenome' ) {
1060+ console . log ( rows )
1061+ Ext4 . Array . forEach ( rows , function ( r , idx ) {
1062+ rows [ idx ] = ( idx + 1 ) + '\t' + r ;
1063+ } , this ) ;
1064+ }
10101065 }
10111066
10121067 //check for unique barcodes
0 commit comments