File tree 1 file changed +11
-0
lines changed
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 15
15
def biokit_sample_annotation_filename (biokit_outdir ):
16
16
return (join (biokit_outdir , 'samples.txt' ))
17
17
18
+
19
+ def check_sample_names (sample_names ):
20
+ """
21
+ Check that sample names do not contain invalid characters
22
+ """
23
+ if (any (" " in s for s in sample_names )):
24
+ raise ValueError ("Sample names must not contain empty spaces" )
25
+ return True
26
+
27
+
18
28
def parse_sample_annotation (sample_annotation_file ):
19
29
"""
20
30
Parse biokit sample annotation file into sample names and FASTQ dicts
@@ -29,6 +39,7 @@ def parse_sample_annotation(sample_annotation_file):
29
39
30
40
annotation = read_table (sample_annotation_file )
31
41
samples = [str (s ) for s in annotation .iloc [:, 0 ]]
42
+ check_sample_names (samples )
32
43
fq1s = annotation .iloc [:, 2 ]
33
44
fq2s = annotation .iloc [:, 3 ]
34
45
You can’t perform that action at this time.
0 commit comments