in src/main/scripts/sc_rna_expression_cellranger_fastq.py [0:0]
def parse_arguments(script_name, argv):
species = None
read_type = None
job_name = None
dir_out = None
feature_reference = None
fastq_list = None
fastq_list_r2 = None
library_type = None
master = None
expected_cells = None
forced_cells = None
chemistry = None
nosecondary = None
r1_length = None
r2_length = None
genome_build = None
transcriptome = None
vdj_genome = None
detect_doublet = None
project = None
run = None
toolset = None
cores_per_sample = None
sync = None
master_mode = None
verbose = None
sample_name_list = None
toolchain = None
target_panel = None
mem_free = None
try:
opts, args = getopt.getopt(argv, "hs:t:j:o:b:x:l:q:L:M:e:f:c:a:R:r:G:m:g:d:p:u:n:k:i:z:F:v",
["help", "species=", "read_type=", "job_name=", "dir_out=", "feature_reference=",
"target_panel=", "fastq_list=", "fastq_list_r2=", "library_type=", "master=",
"expected_cells=", "forced_cells=", "chemistry=", "nosecondary=", "r1_length=",
"r2_length=", "genome_build=", "transcriptome=", "vdj_genome=", "detect_doublet=",
"project=", "run=", "toolset=", "cores_per_sample=", "sync=", "sample_name_list=",
"toolchain=", "mem_free=", "master_mode", "verbose"])
for opt, arg in opts:
if opt == '-h':
print(script_name + ' -s <species> -t <read_type> -j <job_name> -o <dir_out> -b <feature_reference> '
'-x <target_panel> -l <fastq_list> -q <fastq_list_r2> -L <library_type> -M <master>'
' -e <expected_cells> -f <forced_cells> -c <chemistry> -a <nosecondary> '
'-R <r1_length> -r <r2_length> -G <genome_build> -m <transcriptome> -g <vdj_genome>'
' -d <detect_doublet> -p <project> -u <run> -n <toolset> -k <cores_per_sample> '
'<sync> -i <sample_name_list> -z <toolchain> -F <mem_free> <master_mode> '
'-v <verbose>')
sys.exit()
elif opt in ("-s", "--species"):
species = arg
elif opt in ("-t", "--read_type"):
read_type = arg
elif opt in ("-j", "--job_name"):
job_name = arg
elif opt in ("-o", "--dir_out"):
dir_out = arg
elif opt in ("-b", "--feature_reference"):
feature_reference = arg
elif opt in ("-x", "--target_panel"):
target_panel = arg
elif opt in ("-l", "--fastq_list"):
fastq_list = arg
elif opt in ("-q", "--fastq_list_r2"):
fastq_list_r2 = arg
elif opt in ("-L", "--library_type"):
library_type = arg
elif opt in ("-M", "--master"):
master = arg
elif opt in ("-e", "--expected_cells"):
expected_cells = arg
elif opt in ("-f", "--forced_cells"):
forced_cells = arg
elif opt in ("-c", "--chemistry"):
chemistry = arg
elif opt in ("-a", "--nosecondary"):
nosecondary = arg
elif opt in ("-R", "--r1_length"):
r1_length = arg
elif opt in ("-r", "--r2_length"):
r2_length = arg
elif opt in ("-G", "--genome_build"):
genome_build = arg
elif opt in ("-m", "--transcriptome"):
transcriptome = arg
elif opt in ("-g", "--vdj_genome"):
vdj_genome = arg
elif opt in ("-d", "--detect_doublet"):
detect_doublet = arg
elif opt in ("-p", "--project"):
project = arg
elif opt in ("-u", "--run"):
run = arg
elif opt in ("-n", "--toolset"):
toolset = arg
elif opt in ("-k", "--cores_per_sample"):
cores_per_sample = arg
elif opt in "--sync":
sync = arg
elif opt in "--master_mode":
master_mode = True
elif opt in ("-v", "--verbose"):
verbose = 'True'
elif opt in ("-i", "--sample_name_list"):
sample_name_list = arg
elif opt in ("-z", "--toolchain"):
toolchain = arg
elif opt in ("-F", "--mem_free"):
mem_free = arg
if not species:
print('Species (-s <species>) is required')
usage()
sys.exit(2)
if not fastq_list:
print('The path to the input manifest fastq file (-l <fastq_list>) is required')
usage()
sys.exit(2)
if not dir_out:
print('The output directory for the analysis (-o <dir_out>) is required')
usage()
sys.exit(2)
if not chemistry:
print('The assay configuration (-c <chemistry>) is required')
usage()
sys.exit(2)
if not r1_length:
print('The length parameter of hard-trim the input R1 sequence (-R <r1_length>) is required')
usage()
sys.exit(2)
if not r2_length:
print('The length parameter of hard-trim the input R2 sequence (-r <r2_length>) is required')
usage()
sys.exit(2)
if not genome_build:
print('The genome build (-G <genome_build>) is required')
usage()
sys.exit(2)
if not transcriptome:
print('The transcriptome reference (-m <transcriptome>) is required')
usage()
sys.exit(2)
if not vdj_genome:
print('The path to the Cell Ranger V(D)J compatible reference (-g <vdj_genome>) is required')
usage()
sys.exit(2)
return species, read_type, job_name, dir_out, feature_reference, fastq_list, fastq_list_r2, library_type, \
master, expected_cells, forced_cells, chemistry, nosecondary, r1_length, r2_length, genome_build, \
transcriptome, vdj_genome, detect_doublet, project, run, toolset, cores_per_sample, verbose, sync, \
sample_name_list, master_mode, toolchain, target_panel, mem_free
except getopt.GetoptError:
usage()
sys.exit(2)