comparison vsnp_determine_ref_from_data.py @ 4:efb86aade548 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/vsnp commit 2e312886647244b416c64eca91e1a61dd1be939b"
author iuc
date Thu, 10 Dec 2020 15:25:53 +0000
parents 85587c8eb25f
children b08cc87b2888
comparison
equal deleted inserted replaced
3:85587c8eb25f 4:efb86aade548
10 10
11 OUTPUT_DBKEY_DIR = 'output_dbkey' 11 OUTPUT_DBKEY_DIR = 'output_dbkey'
12 OUTPUT_METRICS_DIR = 'output_metrics' 12 OUTPUT_METRICS_DIR = 'output_metrics'
13 13
14 14
15 def get_base_file_name(file_path): 15 def get_sample_name(file_path):
16 base_file_name = os.path.basename(file_path) 16 base_file_name = os.path.basename(file_path)
17 if base_file_name.find(".") > 0: 17 if base_file_name.find(".") > 0:
18 # Eliminate the extension. 18 # Eliminate the extension.
19 return os.path.splitext(base_file_name)[0] 19 return os.path.splitext(base_file_name)[0]
20 elif base_file_name.find("_fq") > 0:
21 # The "." character has likely
22 # changed to an "_" character.
23 return base_file_name.split("_fq")[0]
24 elif base_file_name.find("_fastq") > 0:
25 return base_file_name.split("_fastq")[0]
26 return base_file_name 20 return base_file_name
27 21
28 22
29 def get_dbkey(dnaprints_dict, key, s): 23 def get_dbkey(dnaprints_dict, key, s):
30 # dnaprints_dict looks something like this: 24 # dnaprints_dict looks something like this:
176 with open(output_file, "w") as fh: 170 with open(output_file, "w") as fh:
177 fh.write("%s" % dbkey) 171 fh.write("%s" % dbkey)
178 172
179 173
180 def output_files(fastq_file, count_list, group, dbkey, dbkey_file, metrics_file): 174 def output_files(fastq_file, count_list, group, dbkey, dbkey_file, metrics_file):
181 base_file_name = get_base_file_name(fastq_file) 175 base_file_name = get_sample_name(fastq_file)
182 output_dbkey(base_file_name, dbkey, dbkey_file) 176 output_dbkey(base_file_name, dbkey, dbkey_file)
183 output_metrics(base_file_name, count_list, group, dbkey, metrics_file) 177 output_metrics(base_file_name, count_list, group, dbkey, metrics_file)
184 178
185 179
186 def output_metrics(file_name, count_list, group, dbkey, output_file): 180 def output_metrics(file_name, count_list, group, dbkey, output_file):