Skip to content

Commit 644d307

Browse files
committed
Escape case when three FastQ files per sample exist
By default, we evaluate whether there are more than two FastQ files available in the column download_links by checking the presence of a semicolon. If there is a semicolon, the first entry is used as R1 and the second entry as R2. However, in the case that a third FastQ file is uploaded, such as the merged reads or singletons, the first FastQ file does not contain the paired reads but the second and third do. This implements the check whether there are three FastQ files to pick the correct paired FastQ files for the assembly.
1 parent b50fd39 commit 644d307

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

amdirt/core/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,12 @@ def get_filename(path_string: str, orientation: str) -> Tuple[str, str]:
233233
"""
234234

235235
if ";" in path_string:
236-
fwd = Path(path_string.split(";")[0]).name
237-
rev = Path(path_string.split(";")[1]).name
236+
if path_string.count(";") == 1:
237+
fwd = Path(path_string.split(";")[0]).name
238+
rev = Path(path_string.split(";")[1]).name
239+
else: # three files per sample
240+
fwd = Path(path_string.split(";")[1]).name
241+
rev = Path(path_string.split(";")[2]).name
238242
else:
239243
fwd = Path(path_string).name
240244
rev = "NA"

0 commit comments

Comments
 (0)