Skip to content

Commit 6fbe7e6

Browse files
authored
Merge pull request #12 from OpenOmics/sample_name_parsing
Sample name parsing
2 parents ed009da + 38f427e commit 6fbe7e6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/run.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -506,15 +506,15 @@ def add_sample_metadata(input_files, config, group=None):
506506
for file in input_files:
507507
# Split sample name on file extension
508508
sample = re.split(r"(_S[0-9]+)(_L[0-9]{3})?\.R[12]\.f(ast)?q.gz", os.path.basename(file))[0]
509+
if os.path.basename(file) == sample:
510+
# Sample has a non-standard name, print warning message
511+
err("Warning: Sample '{0}' has a file name that is not compatible with cellranger! Skipping over input file...".format(os.path.basename(file)))
512+
continue
509513
if sample not in added:
510514
# Only add PE sample information once
511515
added.append(sample)
512516
config['samples'].append(sample)
513-
if os.path.basename(file) == sample:
514-
# Sample has a non-standard name,
515-
# print warning message
516-
err("Warning: Sample '{0}' has a file name that is not compatible with cellranger! Skipping over input file...".format(os.path.basename(file)))
517-
continue
517+
518518
return config
519519

520520

0 commit comments

Comments
 (0)