-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathlaunch_universc.sh
executable file
·4266 lines (3940 loc) · 181 KB
/
launch_universc.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/bash
# UniverSC
# Copyright (C) 2019 Tom Kelly; Kai Battenberg
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
install=false
######UniverSC version#####
universcversion="1.2.7"
##########
#####locate cellranger and get cellranger version#####
cellrangerpath=$(which cellranger) #location of Cell Ranger
if [[ -z $cellrangerpath ]]; then
echo "cellranger command is not found."
exit 1
fi
## detects version by attempting to parse "cellranger --version" (older versions do not support this by print the help header if invalid args given)
cellrangerversion=$(cellranger --version 2>/dev/null | head -n 2 | tail -n 1 | rev | cut -f 1 -d" " | rev | cut -f 2 -d'(' | cut -f 1 -d')')
if [[ $verbose ]]; then
echo $cellrangerversion
fi
##########
#####locate launch_universc.sh, barcode sources, and other tools######
echo "script running in $(realpath $0)..."
SOURCE=${BASH_SOURCE[0]}
# check if script is started via SLURM or bash (job ID defined in Slurm job)
if [[ -n $SLURM_JOB_ID ]]; then
if [[ $(echo $SLURM_JOB_ID | wc -w) -ge 1 ]]; then
# check the original location through scontrol and $SLURM_JOB_ID
SOURCE=$(scontrol show job $SLURM_JOBID | awk -F= '/Command=/{print $2}')
fi
fi
SDIR=""
RDIR=""
while [[ -h "$SOURCE" ]]; do #resolve $SOURCE until the file is no longer a symlink
TARGET="$(readlink "$SOURCE")"
if [[ $TARGET == /* ]]; then
echo "SOURCE '$SOURCE' is an absolute symlink to '$TARGET'"
SOURCE="$TARGET"
else
SDIR="$( dirname "$SOURCE" )"
echo "SOURCE '$SOURCE' is a relative symlink to '$TARGET' (relative to '$SDIR')"
SOURCE="$SDIR/$TARGET" #if $SOURCE is a relative symlink, we need to resolve it relative to the path where the symlink file was located
fi
done
SDIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
echo "... script called from ${SDIR}"
RDIR="$( dirname "$SOURCE" )"
if [[ $RDIR != $SDIR ]]; then
echo "'$RDIR' resolves to '$SDIR'"
fi
echo "Running launch_universc.sh in '$SDIR'"
TOOLS=${SDIR}/sub
ADDMOCKUMI=${TOOLS}/AddMockUMI.pl
BARCODERECOVER=${TOOLS}/RecoverBarcodes.pl
MAKEINDROPBARCODES=${TOOLS}/MakeIndropBarcodes.pl
FILTERSMARTSEQREADUMI=${TOOLS}/FilterSmartSeqReadUMI.pl
CONCATENATEBARCODES=${TOOLS}/ConcatenateDualIndexBarcodes.pl
PERCELLSTATS=${TOOLS}/ExtractBasicStats.pl
##########
#####define set options#####
# set defaults to 10x if missing (enables unit testing without warnings)
if [[ -z ${lastcall_b} ]]; then
lastcall_b=16
fi
if [[ -z ${lastcall_u} ]]; then
lastcall_u=10
fi
if [[ -z ${lastcall_p} ]]; then
lastcall_p="default:10x"
fi
lockfile=${cellrangerpath}-cs/${cellrangerversion}/lib/python/cellranger/barcodes/.lock #path for .lock file
lastcallfile=${cellrangerpath}-cs/${cellrangerversion}/lib/python/cellranger/barcodes/.last_called #path for .last_called
lastcall=`[[ -e $lastcallfile ]] && cat $lastcallfile || echo ""`
lastcall_b=`echo ${lastcall} | cut -f 1 -d' '`
lastcall_u=`echo ${lastcall} | cut -f 2 -d' '`
lastcall_p=`echo ${lastcall} | cut -f 3 -d' '`
barcodedir=${cellrangerpath}-cs/${cellrangerversion}/lib/python/cellranger/barcodes #folder within cellranger with the whitelist barcodes
if [[ $(echo "${cellrangerversion} 4.0.0" | tr " " "\n" | sort -V | tail -n 1) == ${cellrangerversion} ]]; then
barcodedir=$(dirname $cellrangerpath)/lib/python/cellranger/barcodes
mkdir -p ${cellrangerpath}-cs/${cellrangerversion}
ln -sf $(dirname $cellrangerpath)/mro/rna ${cellrangerpath}-cs/${cellrangerversion}/mro
ln -sf $(dirname $cellrangerpath)/lib ${cellrangerpath}-cs/${cellrangerversion}/lib
fi
barcodefile=""
crIN=input4cellranger #name of the directory with all FASTQ and index files given to Cell Ranger
whitelistdir=${SDIR}/whitelists #path to whitelists
whitelistfile="outs/whitelist.txt" #name of the whitelist file added to the cellranger output
percellfile="outs/basic_stats.txt" #name of the file with the basic statistics of the run added to the cellranger output
##########
#####checking if Universc and Cell Ranger are writable#####
# user configuration
host=$(hostname) # returns host for local run and container ID for docker container
user=$(whoami 2> /dev/null || id -ur) # returns username if defined and user ID if not
#Cell Ranger
if ! [[ -w "$barcodedir" ]]; then
echo "Error: Trying to run Cell Ranger installed at ${cellrangerpath}"
echo "launch_universc.sh can only run with Cell Ranger installed locally"
echo "Install Cell Ranger in a directory with write permissions such as /home/${user}/local and export to the PATH"
echo "The following versions of Cell Ranger are found:"
echo " `whereis cellranger`"
exit 1
fi
#convert
if ! [[ -w "$SDIR" ]]; then
echo "Error: Trying to run launch_universc.sh installed at $SDIR"
echo "$SDIR must be writable to run launch_universc.sh"
echo "Install launch_universc.sh in a directory with write permissions such as /home/${user}/local and export to the PATH"
exit 1
fi
##########
#####usage statement#####
## detect shell across different OS
if [[ -z $VENDOR ]]; then
if [[ $(uname -a | grep "[Mm]ac") ]]; then
VENDOR="apple"
else
VENDOR="linux"
fi
fi
if [[ $VENDOR != "apple" ]]; then
SHELL=$(readlink -f /proc/$$/exe | cut -d'/' -f 3)
else
SHELL=$(ps -p $$ | awk '$1 == PP {print $4}' PP=$$)
fi
## detect how called (e.g., bash converrt.sh or ./launch_universc.sh)
if [[ $(which launch_universc.sh) == *"/"* ]] || [[ $0 == *"/"* ]]; then
SHELL=''
invocation=$0
else
if [[ ! -z $ZSH_VERSION ]]; then
SHELL="zsh"
elif [[ ! -z $KSH_VERSION ]]; then
SHELL="ksh"
elif [[ ! -z $FISH_VERSION ]]; then
SHELL="fish"
elif [[ ! -z $BASH_VERSION ]]; then
SHELL="bash"
else
SHELL=$SHELL
fi
invocation=$(echo $(basename $0))
fi
if [[ $SHELL != "" ]]; then
SHELL=" $SHELL"
fi
copyright="
UniverSC Copyright (C) 2019 Tom Kelly; Kai Battenberg
"
notice="
This program comes with ABSOLUTELY NO WARRANTY; for details type 'cat LICENSE'.
This is free software, and you are welcome to redistribute it
under certain conditions; type 'cat LICENSE' for details.
"
disclaimer="
Cell Ranger is called as third-party dependency and is not maintained
by this project. Please ensure you comply with the End User License
Agreement for all software installed where applicable; for details type 'cat README.md'.
"
help='
Usage:
'$SHELL' '$invocation' --testrun -t TECHNOLOGY
'$SHELL' '$invocation' -t TECHNOLOGY --setup
'$SHELL' '$invocation' -R1 FILE1 -R2 FILE2 -t TECHNOLOGY -i ID -r REFERENCE [--option OPT]
'$SHELL' '$invocation' -R1 READ1_LANE1 READ1_LANE2 -R2 READ2_LANE1 READ2_LANE2 -t TECHNOLOGY -i ID -r REFERENCE [--option OPT]
'$SHELL' '$invocation' -f SAMPLE_LANE -t TECHNOLOGY -i ID -r REFERENCE [--option OPT]
'$SHELL' '$invocation' -f SAMPLE_LANE1 SAMPLE_LANE2 -t TECHNOLOGY -i ID -r REFERENCE [--option OPT]
'$SHELL' '$invocation' -v
'$SHELL' '$invocation' -h
Convert sequencing data (FASTQ) from Nadia or ICELL8 platforms for compatibility with 10x Genomics and run cellranger count
Mandatory arguments to long options are mandatory for short options too.
--testrun Initiates a test trun with the test dataset
-R1, --read1 FILE Read 1 FASTQ file to pass to Cell Ranger (cell barcodes and umi)
-R2, --read2 FILE Read 2 FASTQ file to pass to Cell Ranger
-I1, --index1 FILE Index (I1) FASTQ file to pass to Cell Ranger (OPTIONAL)
-I2, --index2 FILE Index (I2) FASTQ file to pass to Cell Ranger (OPTIONAL and EXPERIMENTAL)
-f, --file NAME Path and the name of FASTQ files to pass to Cell Ranger (prefix before R1 or R2)
e.g. /path/to/files/Example_S1_L001
-i, --id ID A unique run id, used to name output folder
-d, --description TEXT Sample description to embed in output files.
-r, --reference DIR Path of directory containing 10x-compatible reference.
Available here the human genome and various model species:
https://genomec.gsc.riken.jp/gerg/UniverSC/Premade_references/
-t, --technology PLATFORM Name of technology used to generate data.
Supported technologies:
10x Genomics (version 2 or 3 automatically detected): 10x, chromium
10x Genomics version 1 (14 bp barcode, 10 bp UMI): 10x-v1, chromium-v1
10x Genomics version 2 (16 bp barcode, 10 bp UMI): 10x-v2, chromium-v2
10x Genomics version 3 (16 bp barcode, 12 bp UMI): 10x-v3, chromium-v3
Aligent Bravo B (16 bp barcode, No UMI): aligent, bravo
BD Rhapsody v1 (27 bp barcode, 8 bp UMI): bd-rhapsody
BD Rhapsody v2 enhanced beads (27 bp barcode, 8 bp UMI): bd-rhapsody-v2
C1 Fluidigm (16 bp barcode, No UMI): c1, fluidgm-c1
C1 CAGE (16 bp, No UMI): c1-cage
C1 RamDA-Seq (16 bp, No UMI): c1-ramda-seq
CEL-Seq (8 bp barcode, 4 bp UMI): celseq
CEL-Seq2 (6 bp UMI, 6 bp barcode): celseq2
Drop-Seq (12 bp barcode, 8 bp UMI): dropseq, nadia
ICELL8 3\′ scRNA version 2 (11 bp barcode, No UMI): icell8-non-umi, icell8-v2
ICELL8 3\′ scRNA version 3 (11 bp barcode, 14 bp UMI): icell8
ICELL8 5\′ scRNA with TCR OR kit (10bp barcode, NO bp UMI): icell8-5-prime
ICELL8 full-length scRNA with Smart-Seq (16 bp barcode, No UMI): icell8-full-length
inDrops version 1 (19 bp barcode, 6 bp UMI): indrops-v1, 1cellbio-v1
inDrops version 2 (19 bp barcode, 6 bp UMI): indrops-v2, 1cellbio-v2
inDrops version 3 (16 bp barcode, 6 bp UMI): indrops-v3, 1cellbio-v3
Nadia (12 bp barcode, 8 bp UMI): nadia, dropseq
MARS-Seq (6 bp barcode, 10 bp UMI): marsseq, marsseq-v1
MARS-Seq2 (7 bp barcode, 8 bp UMI): marsseq2, marsseq-v2
Microwell-Seq (18 bp barcode, 6 bp UMI): microwell
PIP-Seq version 0 (24 bp barcode, 8 bp UMI): pip-seq-v0
PIP-Seq version 1 (16 bp barcode, 6 bp UMI): pip-seq-v1
PIP-Seq version 2 (24 bp barcode, 12 bp UMI): pip-seq-v2
PIP-Seq version 3 (28 bp barcode, 12 bp UMI): pip-seq-v3, fluent-bio-v3
PIP-Seq version 4 (28 bp barcode, 12 bp UMI): pip-seq-v4, fluent-bio-v4
QuartzSeq (6 bp index, no UMI): quartz-seq
Quartz-Seq2 (14 bp barcode, 8 bp UMI): quartzseq2-384
Quartz-Seq2 (15 bp barcode, 8 bp UMI): quartzseq2-1536
RamDA-Seq (16 bp barcode, no UMI): ramda-seq
SCI-Seq 2-level indexing (30 bp barcode, 8 bp UMI): sciseq2
SCI-Seq 3-level indexing (40 bp barcode, 8 bp UMI): sciseq3
SCIFI-Seq (27 bp barcode, 8 bp UMI): scifiseq
SCRB-Seq (6 bp barcode, 10 bp UMI): scrbseq, mcscrbseq
SeqWell (12 bp barcode, 8 bp UMI): plexwell, seqwell, seqwells3
Smart-seq (16 bp barcode, No UMI): smartseq
Smart-seq2 (16 bp barcode, No UMI): smartseq2
Smart-seq2-UMI, Smart-seq3 (16 bp barcode, 8 bp UMI): smartseq3
SPLiT-Seq (8 bp UMI, 24 bp barcode): splitseq
SPLiT-Seq v2.1 (10 bp UMI, 24 bp barcode): splitseq2
STRT-Seq (6 bp barcode, no UMI): strt-seq
STRT-Seq-C1 (8 bp barcode, 5 bp UMI): strt-seq-c1
STRT-Seq-2i (13 bp barcode, 6 bp UMI): strt-seq-2i
SureCell (18 bp barcode, 8 bp UMI): surecell, ddseq, biorad
VASA-plate (6 bp UMI, 6 bp barcode): vasa-plate
VASA-drop (6 bp UMI, 16 bp barcode): vasa-drop
Custom inputs are also supported by giving the name "custom" and length of barcode and UMI separated by "_"
e.g. Custom (16 bp barcode, 10 bp UMI): custom_16_10
-b, --barcodefile FILE Custom barcode list in plain text (with each line containing a barcode)
-c, --chemistry CHEM Assay configuration, autodetection is not possible for converted files: 'SC3Pv2' (default), 'SC5P-PE', 'SC5P-R1', 'SC5P-R2', 'threeprime', or 'fiveprime'
5\′ scRNA-Seq ('SC5P-PE') is available only for 10x Genomics, ICELL8, SmartSeq, and STRT-Seq technologies.
Setting 'SC3Pv1' for 10x version 1 chemistry is recommended.
All other technologies default to 3\′ scRNA-Seq parameters. Only 10x Genomics, ICELL8, and SmartSeq2 allow choosing which to use.
For SmartSeq2 this parameter detemines using full-length sequences or 5\′ ends with internal reads removed.
-n, --force-cells NUM Force pipeline to use this number of cells, bypassing the cell detection algorithm.
-j, --jobmode MODE Job manager to use. Valid options: 'local' (default), 'sge', 'lsf', or a .template file
--localcores NUM Set max cores the pipeline may request at one time.
Only applies when --jobmode=local.
--localmem NUM Set max GB the pipeline may request at one time.
Only applies when --jobmode=local.
--mempercore NUM Set max GB each job may use at one time.
Only applies in cluster jobmodes.
-p, --per-cell-data Generates a file with basic run statistics along with per-cell data
--non-umi or --read-only Force counting reads by adding or replacing UMI with a mock sequence.
Default for: Quartz-Seq, RamDA-Seq, Smart-Seq, Smart-Seq2, STRT-Seq, ICELL8 3-prime version2
--setup Set up whitelists for compatibility with new technology and exit
--as-is Skips the FASTQ file conversion if the file already exists
-h, --help Display this help and exit
-v, --version Output version information and exit
--verbose Print additional outputs for debugging
For each fastq file, follow the naming convention below:
<SampleName>_<SampleNumber>_<LaneNumber>_<ReadNumber>_001.fastq
e.g. EXAMPLE_S1_L001_R1_001.fastq
Example_S4_L002_R2_001.fastq.gz
For custom barcode and umi length, follow the format below:
custom_<barcode>_<UMI>
e.g. custom_16_10 (which is the same as 10x)
Files will be renamed if they do not follow this format. File extension will be detected automatically.
'
echo $copyright
echo $notice
echo $disclaimer
if [[ -z $@ ]]; then
echo "$help"
exit 1
fi
##########
#####options#####
#variable options
setup=false
convert=true
testrun=false
read1=()
read2=()
index1=()
index2=()
SAMPLE=""
LANE=()
id=""
description=""
reference=""
ncells=""
chemistry=""
jobmode="local"
ncores=""
mem=""
bam=""
secondary=""
library=""
introns=""
noexit=""
nopreflight=""
nonUMI=false
percelldata=false
next=false
for op in "$@"; do
if $next; then
next=false;
continue;
fi
case "$op" in
--testrun)
testrun=true
next=false
shift
;;
-R1|--read1)
shift
if [[ "$1" != "" ]]; then
arg=$1
while [[ ! "$arg" == "-"* ]] && [[ "$arg" != "" ]]; do
read1+=("${1/%\//}")
shift
arg=$1
done
next=true
elif [[ -z $read1 ]]; then
echo "Error: file input missing for --read1"
exit 1
fi
;;
-R2|--read2)
shift
if [[ "$1" != "" ]]; then
arg=$1
while [[ ! "$arg" == "-"* ]] && [[ "$arg" != "" ]]; do
read2+=("${1/%\//}")
shift
arg=$1
done
next=true
elif [[ -z $read2 ]]; then
echo "Error: file input missing for --read2"
exit 1
fi
;;
-I1|--index1|--index)
shift
if [[ "$1" != "" ]]; then
arg=$1
while [[ ! "$arg" == "-"* ]] && [[ "$arg" != "" ]]; do
index1+=("${1/%\//}")
shift
arg=$1
done
next=true
elif [[ -z $index1 ]]; then
echo "Error: file input missing for --index1"
exit 1
fi
;;
-I2|--index2)
shift
if [[ "$1" != "" ]]; then
arg=$1
while [[ ! "$arg" == "-"* ]] && [[ "$arg" != "" ]]; do
index2+=("${1/%\//}")
shift
arg=$1
done
next=true
elif [[ -z $index1 ]]; then
echo "Error: file input missing for --index1"
exit 1
fi
;;
-f|--file)
shift
if [[ "$1" != "" ]]; then
arg=$1
while [[ ! "$arg" == "-"* ]] && [[ "$arg" != "" ]]; do
read1+=("${1}_R1_001")
read2+=("${1}_R2_001")
shift
arg=$1
done
skip=true
else
echo "Error: file input missing for --file"
exit 1
fi
;;
-i|--id)
shift
if [[ "$1" != "" ]]; then
id="${1/%\//}"
next=true
shift
else
echo "Error: value missing for --id"
exit 1
fi
;;
-d|--description)
shift
if [[ "$1" != "" ]]; then
description="${1/%\//}"
next=true
shift
else
echo "Error: value missing for --description"
exit 1
fi
;;
-r|--reference)
shift
if [[ "$1" != "" ]]; then
reference="${1/%\//}"
next=true
shift
else
echo "Error: value missing for --reference: reference transcriptome generated by cellranger mkfastq required"
exit 1
fi
;;
-t|--technology)
shift
if [[ $1 != "" ]]; then
technology="${1/%\//}"
technology=`echo "$technology" | tr '[:upper:]' '[:lower:]'`
next=true
shift
else
echo "Error: value missing for --technology"
exit 1
fi
;;
-b|--barcodefile)
shift
if [[ "$1" != "" ]]; then
barcodefile="${1/%\//}"
next=true
shift
else
echo "Error: value missing for --barcodefile"
exit 1
fi
;;
-c|--chemistry)
shift
if [[ "$1" != "" ]]; then
chemistry="${1/%\//}"
next=true
shift
else
echo "Error: value missing for --chemistry"
exit 1
fi
;;
-n|--force-cells)
shift
if [[ "$1" != "" ]]; then
ncells="${1/%\//}"
next=true
shift
else
echo "Error: value missing for --force-cells"
exit 1
fi
;;
-j|--jobmode)
shift
if [[ "$1" != "" ]]; then
jobmode="${1/%\//}"
next=true
shift
else
echo "Error: value missing for --jobmode"
exit 1
fi
;;
--localcores)
shift
if [[ "$1" != "" ]]; then
ncores="${1/%\//}"
next=true
shift
else
echo "Error: value missing for --localcores"
exit 1
fi
;;
--localmem)
shift
if [[ "$1" != "" ]]; then
mem="${1/%\//}"
next=true
shift
else
echo "Error: value missing for --localmem"
exit 1
fi
;;
--mempercore)
shift
if [[ "$1" != "" ]]; then
mem="${1/%\//}"
next=true
shift
else
echo "Error: value missing for --mempercore"
exit 1
fi
;;
-p|--per-cell-data)
percelldata=true
next=false
shift
;;
--non-umi|--read-only)
nonUMI=true
next=false
shift
;;
--setup)
setup=true
next=false
shift
;;
--as-is)
convert=false
next=false
shift
;;
--include-introns)
introns="include-introns"
next=false
shift
;;
--no-bam)
bam="--no-bam"
next=false
shift
;;
--nosecondary)
secondary="--nosecondary"
next=false
shift
;;
--nolibraries)
library="--nolibraries"
next=false
shift
;;
--noexit)
noexit="--noexit"
next=false
shift
;;
--nopreflight)
nopreflight="--nopreflight"
next=false
shift
;;
-h|--help)
echo "$help"
exit 0
;;
-v|--version)
echo "launch_universc.sh version ${universcversion}"
echo "cellranger version ${cellrangerversion}"
exit 0
;;
--verbose)
echo "debugging mode activated"
verbose=true
next=false
shift
;;
-*)
echo "Error: Invalid option: $op"
exit 1
;;
esac
done
##########
#####check if this is a test run#####
if [[ $testrun == "true" ]]; then
if [[ ${#read1[@]} -gt 0 ]] || [[ ${#read2[@]} -gt 0 ]]; then
echo "Error: for test run, no R1 or R2 file can be selected."
exit 1
elif [[ -n $reference ]]; then
echo "Error: for test run, reference will be set automatically."
exit 1
elif [[ -n $id ]]; then
echo "Error: for test run, id will be set automatically."
exit 1
fi
TESTDIR=${SDIR}/test
reference=${TESTDIR}/cellranger_reference/cellranger-tiny-ref/3.0.0
id=test-tiny-${technology}
description=${id}
percelldata=true
if [[ $technology == "10x" ]]; then
gunzip -fk ${TESTDIR}/shared/cellranger-tiny-fastq/3.0.0/tinygex_S1_L00[12]_R[12]_001.fastq.gz
read1=("${TESTDIR}/shared/cellranger-tiny-fastq/3.0.0/tinygex_S1_L001_R1_001.fastq" "${TESTDIR}/shared/cellranger-tiny-fastq/3.0.0/tinygex_S1_L002_R1_001.fastq")
read2=("${TESTDIR}/shared/cellranger-tiny-fastq/3.0.0/tinygex_S1_L001_R2_001.fastq" "${TESTDIR}/shared/cellranger-tiny-fastq/3.0.0/tinygex_S1_L002_R2_001.fastq")
index1=("${TESTDIR}/shared/cellranger-tiny-fastq/3.0.0/tinygex_S1_L001_I1_001.fastq.gz" "${TESTDIR}/shared/cellranger-tiny-fastq/3.0.0/tinygex_S1_L002_I1_001.fastq.gz")
elif [[ $technology == "nadia" ]]; then
gunzip -fk ${TESTDIR}/shared/dropseq-test/SRR1873277_S1_L001_R[12]_001.fastq.gz
read1=("${TESTDIR}/shared/dropseq-test/SRR1873277_S1_L001_R1_001.fastq")
read2=("${TESTDIR}/shared/dropseq-test/SRR1873277_S1_L001_R2_001.fastq")
elif [[ $technology == "icell8" ]]; then
gunzip -fk ${TESTDIR}/shared/icell8-test/ICELL8_01_S1_L00[12]_R[12]_001.fastq.gz
read1=("${TESTDIR}/shared/icell8-test/ICELL8_01_S1_L001_R1_001.fastq" "${TESTDIR}/shared/icell8-test/ICELL8_01_S1_L002_R1_001.fastq")
read2=("${TESTDIR}/shared/icell8-test/ICELL8_01_S1_L001_R2_001.fastq" "${TESTDIR}/shared/icell8-test/ICELL8_01_S1_L002_R2_001.fastq")
barcodefile=${TESTDIR}/shared/icell8-test/BarcodeList.txt
ncells=`wc -l $barcodefile | cut -f 1 -d' '`
else
echo "Error: for test run, -t needs to be 10x, nadia, or icell8"
exit 1
fi
fi
##########
#####Check if technology matches expected inputs#####
if [[ $verbose ]]; then
echo " checking option: --technology"
fi
if [[ "$technology" == "10x" ]] || [[ "$technology" == "chromium" ]]; then
technology="10x"
elif [[ "$technology" == "10x-v1" ]] || [[ "$technology" == "chromium-v1" ]]; then
technology="10x-v1"
elif [[ "$technology" == "10x-v2" ]] || [[ "$technology" == "chromium-v2" ]]; then
technology="10x-v2"
elif [[ "$technology" == "10x-v3" ]] || [[ "$technology" == "chromium-v3" ]]; then
technology="10x-v3"
elif [[ "$technology" == "bd-rhapsody" ]] || [[ "$technology" == "bd" ]] || [[ "$technology" == "rhapsody" ]] || [[ "$technology" == "bdrhapsody" ]]; then
technology="bd-rhapsody"
elif [[ "$technology" == "bd-rhapsody-v2" ]] || [[ "$technology" == "bd-v2" ]] || [[ "$technology" == "rhapsody-v2" ]] || [[ "$technology" == "bdrhapsody-v2" ]] || [[ "$technology" == "bd-rhapsodyv2" ]] || [[ "$technology" == "bdv2" ]] || [[ "$technology" == "rhapsodyv2" ]] || [[ "$technology" == "bdrhapsodyv2" ]] || [[ "$technology" == "bd-rhapsody-2022" ]] || [[ "$technology" == "bd-2022" ]] || [[ "$technology" == "rhapsody-2022" ]] || [[ "$technology" == "bdrhapsody-2022" ]] || [[ "$technology" == "bd-rhapsody2022" ]] || [[ "$technology" == "bd2022" ]] || [[ "$technology" == "rhapsody2022" ]] || [[ "$technology" == "bdrhapsody2022" ]]; then
technology="bd-rhapsody-v2"
elif [[ "$technology" == "aligent" ]] || [[ "$technology" == "bravo" ]] || [[ "$technology" == "aligent-bravo" ]] || [[ "$technology" == "bravo-b" ]] || [[ "$technology" == "aligent-bravo-b" ]]; then
techology="bravo"
nonUMI=false
elif [[ "$technology" == "c1" ]] || [[ "$technology" == "c1-fluidigm" ]] || [[ "$technology" == "fluidigm" ]] || [[ "$technology" == "fluidigm-c1" ]]|| [[ "$technology" == "fluidigmc1" ]] || [[ "$technology" == "c1-rna-seq" ]]|| [[ "$technology" == "c1-mrna-seq" ]] || [[ "$technology" == "c1-rnaseq" ]]|| [[ "$technology" == "c1-scrna" ]]; then
technology="fluidigm-c1"
nonUMI=true
elif [[ "$technology" == "c1-cage" ]] || [[ "$technology" == "c1cage" ]] || [[ "$technology" == "cage-c1" ]] || [[ "$technology" == "cagec1" ]]; then
technology="c1-cage"
nonUMI=true
elif [[ "$technology" == "celseq" ]] || [[ "$technology" == "cel-seq" ]]; then
technology="celseq"
elif [[ "$technology" == "celseq2" ]] || [[ "$technology" == "cel-seq2" ]]; then
technology="celseq2"
elif [[ "$technology" == "nadia" ]] || [[ "$technology" == "dropseq" ]] || [[ "$technology" == "drop-seq" ]]; then
technology="nadia"
elif [[ "$technology" == "icell8" ]] || [[ "$technology" == "icell-8" ]] || [[ "$technology" == "icell8-v3" ]] || [[ "$technology" == "icell8v3" ]]; then
technology="icell8"
#set as "icell8-5-prime" if called by chemistry
if [[ "$chemistry" == "SC5P-"* ]] || [[ "$chemistry" == "fiveprime" ]]; then
technology="icell8-icell8-5-prime"
nonUMI=true
fi
elif [[ "$technology" == "icell8-non-umi" ]] || [[ "$technology" == "icell8-nonumi" ]] || [[ "$technology" == "icell8-v2" ]] || [[ "$technology" == "icell8v2" ]]; then
technology="icell8"
nonUMI=true
elif [[ "$technology" == "icell8-five-prime" ]] || [[ "$technology" == "icell8fiveprime" ]] || [[ "$technology" == "icell8-5p" ]] || [[ "$technology" == "icell85p" ]]; then
technology="icell8-5-prime"
nonUMI=true
if [[ -z ${chemistry} ]] || [[ ${chemistry} == "SC3Pv"* ]]; then
if [[ $verbose ]]; then
echo "setting chemistry for 5' scRNA"
fi
chemistry="SC5P-PE"
fi
elif [[ "$technology" == "icell8-full" ]] || [[ "$technology" == "icell8-fl" ]] || [[ "$technology" == "icell8fl" ]] || [[ "$technology" == "smartseq-icell8" ]] || [[ "$technology" == "smart-seq-icell8" ]] || [[ "$technology" == "icell8-smart-seq" ]] || [[ "$technology" == "icell8smartseq" ]]; then
technology="icell8-full-length"
nonUMI=true
if [[ -z ${chemistry} ]] || [[ ${chemistry} == "SC3Pv"* ]]; then
if [[ $verbose ]]; then
echo "setting chemistry for 5' scRNA"
fi
chemistry="SC5P-PE"
fi
elif [[ "$technology" == "indrop-v1" ]] || [[ "$technology" == "indrops-v1" ]] || [[ "$technology" == "indropv1" ]] || [[ "$technology" == "indropsv1" ]] || [[ "$technology" == "indrop1" ]] || [[ "$technology" == "indrops1" ]] || [[ "$technology" == "1cellbio-v1" ]] || [[ "$technology" == "1cellbiov1" ]]; then
technology="indrop-v1"
elif [[ "$technology" == "indrop-v2" ]] || [[ "$technology" == "indrops-v2" ]] || [[ "$technology" == "indropv2" ]] || [[ "$technology" == "indropsv2" ]] || [[ "$technology" == "indrop2" ]] || [[ "$technology" == "indrops2" ]] ||[[ "$technology" == "1cellbio-v2" ]] || [[ "$technology" == "1cellbiov2" ]]; then
technology="indrop-v2"
elif [[ "$technology" == "indrop-v3" ]] || [[ "$technology" == "indrops-v3" ]] || [[ "$technology" == "indropv3" ]] || [[ "$technology" == "indropsv3" ]] || [[ "$technology" == "indrop3" ]] || [[ "$technology" == "indrops3" ]] || [[ "$technology" == "1cellbio-v3" ]] || [[ "$technology" == "1cellbiov3" ]]; then
technology="indrop-v3"
elif [[ "$technology" == "marsseq" ]] || [[ "$technology" == "mars-seq" ]] || [[ "$technology" == "marsseq-v1" ]] || [[ "$technology" == "mars-seq-v1" ]] || [[ "$technology" == "marsseqv1" ]] || [[ "$technology" == "mars-seqv1" ]]; then
technology="marsseq-v1"
elif [[ "$technology" == "marsseq2" ]] || [[ "$technology" == "mars-seq2" ]] || [[ "$technology" == "marsseq-v2" ]] || [[ "$technology" == "mars-seq-v2" ]] || [[ "$technology" == "marsseqv2" ]] || [[ "$technology" == "mars-seqv2" ]]; then
technology="marsseq-v2"
elif [[ "$technology" == "microwell-seq" ]] || [[ "$technology" == "micro-well" ]] || [[ "$technology" == "microwell" ]] || [[ "$technology" == "microwellseq" ]]; then
technology="microwellseq"
elif [[ "$technology" == "pip-seq-v0" ]] || [[ "$technology" == "pip-seq-V0" ]] || [[ "$technology" == "pipseq-v0" ]] || [[ "$technology" == "pip-seqv0" ]] || [[ "$technology" == "pipseqv0" ]] || [[ "$technology" == "delley" ]] || [[ "$technology" == "delley2021" ]] || [[ "$technology" == "delley-2021" ]]; then
technology="pip-seq-v0"
elif [[ "$technology" == "pip-seq" ]] || [[ "$technology" == "pip-seq-v1" ]] || [[ "$technology" == "pip-seq" ]] || [[ "$technology" == "pip-seq-v1" ]] || [[ "$technology" == "pipseq" ]] || [[ "$technology" == "pipseq-v1" ]] || [[ "$technology" == "pip-seqv1" ]] || [[ "$technology" == "pipseqv1" ]]; then
technology="pip-seq-v1"
elif [[ "$technology" == "pip-seq-v2" ]] || [[ "$technology" == "pip-seq-V2" ]] || [[ "$technology" == "pipseq-v2" ]] || [[ "$technology" == "pip-seqv2" ]] || [[ "$technology" == "pipseqv2" ]]; then
technology="pip-seq-v2"
elif [[ "$technology" == "pip-seq-v3" ]] || [[ "$technology" == "pip-seq-V3" ]] || [[ "$technology" == "pipseq-v3" ]] || [[ "$technology" == "pip-seqv3" ]] || [[ "$technology" == "pipseqv3" ]] || [[ "$technology" == "fluent-bio-v3" ]] || [[ "$technology" == "fluentbio-v3" ]] || [[ "$technology" == "fluent-biov3" ]] || [[ "$technology" == "fluentbiov3" ]]; then
technology="pip-seq-v3"
elif [[ "$technology" == "pip-seq-v4" ]] || [[ "$technology" == "pip-seq-V4" ]] || [[ "$technology" == "pipseq-v4" ]] || [[ "$technology" == "pip-seqv4" ]] || [[ "$technology" == "pipseqv4" ]] || [[ "$technology" == "fluent-bio-v4" ]] || [[ "$technology" == "fluentbio-v4" ]] || [[ "$technology" == "fluent-biov4" ]] || [[ "$technology" == "fluentbiov4" ]]; then
technology="pip-seq-v4"
elif [[ "$technology" == "quartz-seq" ]] || [[ "$technology" == "quartzseq" ]] || [[ "$technology" == "quartz-seq1" ]]; then
technology="quartz-seq"
nonUMI=true
elif [[ "$technology" == "quartz-seq2-384" ]] || [[ "$technology" == "quartzseq2-384" ]] || [[ "$technology" == "quartz-seq2-v3.1" ]] || [[ "$technology" == "quartzseq2-v3.1" ]] || [[ "$technology" == "quartzseq2v3.1" ]]; then
technology="quartz-seq2-384"
elif [[ "$technology" == "quartz-seq2-1536" ]] || [[ "$technology" == "quartzseq2-1536" ]] || [[ "$technology" == "quartz-seq2-v3.2" ]] || [[ "$technology" == "quartzseq2-v3.2" ]] || [[ "$technology" == "quartzseq2v3.2" ]]; then
technology="quartz-seq2-1536"
elif [[ "$technology" == "rambda-seq" ]] || [[ "$technology" == "lamda-seq" ]] || [[ "$technology" == "lambda-seq" ]] || [[ "$technology" == "ramdaseq" ]] || [[ "$technology" == "ram-da-seq" ]] || [[ "$technology" == "ramda-seq" ]]; then
technology="ramda-seq"
nonUMI=true
elif [[ "$technology" == "rambda-seq-c1" ]] || [[ "$technology" == "lamda-seq-c1" ]] || [[ "$technology" == "lambda-seq-c1" ]] || [[ "$technology" == "ramdaseqc1" ]] || [[ "$technology" == "ram-da-seq-c1" ]] || [[ "$technology" == "ramda-seq-c1" ]] || [[ "$technology" == "ramda-seqc1" ]] || [[ "$technology" == "c1-rambda-seq" ]] || [[ "$technology" == "c1-lamda-seq" ]] || [[ "$technology" == "c1-lambda-seq" ]] || [[ "$technology" == "c1-ramdaseq" ]] || [[ "$technology" == "c1-ram-da-seq" ]] || [[ "$technology" == "c1ramda-seq" ]] || [[ "$technology" == "c1-ramda-seq" ]]; then
technology="c1-ramda-seq"
nonUMI=true
elif [[ "$technology" == "sciseq" ]] || [[ "$technology" == "sci-seq" ]] || [[ "$technology" == "sci-rna-seq" ]]; then
technology="sciseq3"
elif [[ "$technology" == "sciseq2" ]] || [[ "$technology" == "sci-seq2" ]]; then
technology="sciseq2"
elif [[ "$technology" == "sciseq3" ]] || [[ "$technology" == "sci-seq3" ]] || [[ "$technology" == "sci-rna-seq3" ]] || [[ "$technology" == "sci-rna-seq-3" ]] ; then
technology="sciseq3"
elif [[ "$technology" == "scifiseq" ]] || [[ "$technology" == "scifi-seq" ]] || [[ "$technology" == "sci-fi-seq" ]] || [[ "$technology" == "scifi-rna-seq" ]]; then
technology="scifiseq"
elif [[ "$technology" == "scrbseq" ]] || [[ "$technology" == "scrb-seq" ]] || [[ "$technology" == "mcscrbseq" ]] || [[ "$technology" == "mcscrb-seq" ]]; then
technology="scrbseq"
elif [[ "$technology" == "plexwell" ]] || [[ "$technology" == "plex-well" ]] || [[ "$technology" == "seqwell" ]] || [[ "$technology" == "seq-well" ]] || [[ "$technology" == "seqwells3" ]] || [[ "$technology" == "seq-well-s3" ]]; then
technology="seqwell"
elif [[ "$technology" == "smartseq" ]] || [[ "$technology" == "smart-seq" ]] || [[ "$technology" == "smartseq2" ]] || [[ "$technology" == "smart-seq2" ]]; then
technology="smartseq2"
nonUMI=true
elif [[ "$technology" == "smartseq2-umi" ]] || [[ "$technology" == "smart-seq2-umi" ]]; then
technology="smartseq2-umi"
nonUMI=false
elif [[ "$technology" == "smartseq3" ]] || [[ "$technology" == "smart-seq3" ]]; then
technology="smartseq3"
nonUMI=false
elif [[ "$technology" == "splitseq" ]] || [[ "$technology" == "split-seq" ]]; then
technology="splitseq"
elif [[ "$technology" == "splitseq2" ]] || [[ "$technology" == "split-seq2" ]] || [[ "$technology" == "splitseq-v2" ]] || [[ "$technology" == "split-seq-v2" ]] || [[ "$technology" == "parse" ]] || [[ "$technology" == "parsebio" ]] || [[ "$technology" == "parse-bio" ]] || [[ "$technology" == "evercode" ]]; then
technology="splitseq2"
elif [[ "$technology" == "strt-seq" ]] || [[ "$technology" == "strt" ]] || [[ "$technology" == "strtseq" ]]; then
technology="strt-seq"
nonUMI=true
if [[ -z ${chemistry} ]] || [[ ${chemistry} == "SC3Pv"* ]]; then
if [[ $verbose ]]; then
echo "setting chemistry for 5\' scRNA"
fi
chemistry="SC5P-R1"
fi
elif [[ "$technology" == "strt-seq-c1" ]] || [[ "$technology" == "strt-seqc1" ]] || [[ "$technology" == "strtseqc1" ]] || [[ "$technology" == "strtseq-c1" ]]; then
technology="strt-seq-c1"
elif [[ "$technology" == "strt-seq-2i" ]] || [[ "$technology" == "strt-seq2i" ]] || [[ "$technology" == "strtseq2i" ]] || [[ "$technology" == "strtseq-2i" ]]; then
technology="strt-seq-2i"
elif [[ "$technology" == "strt-seq-2018" ]] || [[ "$technology" == "strt-seqc2018" ]] || [[ "$technology" == "strtseq2018" ]] || [[ "$technology" == "strtseq-2018" ]] || [[ "$technology" == "strt-seq-v3" ]]; then
technology="strt-seq-2018"
if [[ -z ${chemistry} ]] || [[ ${chemistry} == "SC5P"* ]]; then
if [[ $verbose ]]; then
echo "setting chemistry for 3\' scRNA PE"
fi
chemistry="SC3Pv2"
fi
elif [[ "$technology" == "surecell" ]] || [[ "$technology" == "surecellseq" ]] || [[ "$technology" == "surecell-seq" ]] || [[ "$technology" == "ddseq" ]] || [[ "$technology" == "dd-seq" ]] || [[ "$technology" == "bioraad" ]]; then
technology="surecell"
elif [[ "$technology" == "vasa-seq-plate" ]] || [[ "$technology" == "vasa-seq" ]] || [[ "$technology" == "vasa-plate" ]] || [[ "$technology" == "vasaplate" ]] || [[ "$technology" == "vasa" ]]; then
technology="vasa-plate"
elif [[ "$technology" == "vasa-seq-drop" ]] || [[ "$technology" == "vasa-drop-seq" ]] || [[ "$technology" == "vasa-drop" ]] || [[ "$technology" == "vasadrop" ]] || [[ "$technology" == "vasa-droplet" ]]; then
technology="vasa-drop"
elif [[ "$technology" == "custom"* ]]; then
fields=$((`echo $technology | grep -o "_" | wc -l` + 1))
if [[ $fields -ne 3 ]]; then
echo "Error: custom input must have exactly 3 fields separated by '_', e.g. custom_10_16"
else
b=`echo $technology | cut -f 2 -d'_'`
u=`echo $technology | cut -f 3 -d'_'`
if ! [[ "$b" =~ ^[0-9]+$ ]] || ! [[ "$u" =~ ^[0-9]+$ ]]; then
echo "Error: option -t needs to be a technology listed or custom_<barcode>_<UMI>"
exit 1
fi
fi
else
echo "Error: option -t needs to be a technology listed or custom_<barcode>_<UMI>"
exit 1
fi
if [[ $verbose ]]; then
echo " technology set to ${technology}"
fi
if [[ "$technology" == "icell8" ]]; then
echo "***WARNING: ${technology}-v3 should only be used for kits that have valid UMIs***"
fi
if [[ "$technology" == "smartseq2-umi" ]] || [[ "$technology" == "smartseq3" ]]; then
echo "***WARNING: ${technology} should only be used for kits that have UMIs***"
echo "... UMI reads will be filtered using a tag sequence which will be subsequently removed"
echo "... barcodes will be derived from dual indexes"
fi
if [[ "$technology" == "smartseq2" ]] || [[ "$technology" == "smartseq3" ]] || [[ "$technology" == "indrop-v1" ]] || [[ "$technology" == "indrop-v2" ]] || [[ "$technology" == "indrop-v3" ]]; then
echo "***Note: Make sure that samples are demultiplexed prior to running launch_universc.sh***"
fi
##########
#####Setting barcode and UMI length according to the set technology#####
if [[ $verbose ]]; then
echo " setting barcode and UMI lengths for ${technology}"
fi
#barcode and umi lengths given by options
barcodelength=""
if [[ $verbose ]]; then
echo "barcodelength before $barcodelength"
fi
umilength=""
minlength=""
if [[ "$technology" == "10x" ]]; then
barcodelength=16
umilength=10
minlength=16
elif [[ "$technology" == "10x-v1" ]]; then
barcodelength=14
barcode_default=14
umilength=10
minlength=14
chemistry="SC3Pv1"
technology="10x"
elif [[ "$technology" == "10x-v2" ]]; then
barcodelength=16
umilength=10
minlength=16
technology="10x"
elif [[ "$technology" == "10x-v3" ]]; then
barcodelength=16
umilength=12
minlength=16
chemistry="SC3Pv3"
technology="10x"
elif [[ "$technology" == "bd-rhapsody" ]] || [[ "$technology" == "bd-rhapsody-v2" ]]; then
barcodelength=27
umilength=8
minlength=27
elif [[ "$technology" == "fluidigm-c1" ]]; then
barcodelength=16
umilength=0
minlength=16
elif [[ "$technology" == "c1-cage" ]]; then
barcodelength=16
umilength=0
minlength=16
elif [[ "$technology" == "celseq" ]]; then
barcodelength=8
umilength=4
minlength=8
elif [[ "$technology" == "celseq2" ]]; then
barcodelength=6
umilength=6
minlength=6
elif [[ "$technology" == "nadia" ]]; then
barcodelength=12
umilength=8
minlength=12
elif [[ "$technology" == "icell8" ]]; then
barcodelength=11
if [[ $nonUMI == "true" ]]; then
umilength=0
else
umilength=14
fi
minlength=11
elif [[ "$technology" == "icell8-5-prime" ]]; then
barcodelength=10
if [[ $nonUMI == "true" ]]; then
umilength=0
else
umilength=8
fi
minlength=10
elif [[ "$technology" == "indrop-v1" ]] || [[ "$technology" == "indrop-v2" ]]; then
barcodelength=19
umilength=6
minlength=16
elif [[ "$technology" == "indrop-v3" ]]; then
barcodelength=16
umilength=6
minlength=16
elif [[ "$technology" == "marsseq-v1" ]]; then
barcodelength=6
umilength=10
minlength=6
elif [[ "$technology" == "microwellseq" ]]; then
barcodelength=18
umilength=6
minlength=18
elif [[ "$technology" == "marsseq-v2" ]]; then
barcodelength=7
umilength=8
minlength=7
elif [[ "$technology" == "pip-seq-v0" ]]; then
barcodelength=27
umilength=8
minlength=24
elif [[ "$technology" == "pip-seq-v1" ]]; then
barcodelength=19
umilength=6
minlength=16
elif [[ "$technology" == "pip-seq-v2" ]]; then
barcodelength=24
umilength=12
minlength=24
elif [[ "$technology" == "pip-seq-v3" ]]; then
barcodelength=28
umilength=12
minlength=28
elif [[ "$technology" == "pip-seq-v4" ]]; then
barcodelength=31
umilength=12
minlength=28
elif [[ "$technology" == "quartz-seq2-384" ]]; then
barcodelength=14
umilength=8
minlength=14
elif [[ "$technology" == "quartz-seq2-1536" ]]; then
barcodelength=15
umilength=8
minlength=15
elif [[ "$technology" == "sciseq2" ]]; then
barcodelength=30
umilength=8
minlength=30
elif [[ "$technology" == "sciseq3" ]]; then
barcodelength=40
umilength=8
minlength=40