Skip to content

Commit bd31f2b

Browse files
authored
Merge pull request #498 from ssjunnebo/pod5_delivery
Exclude pod5 from delivery by default
2 parents a36d82b + ceb8266 commit bd31f2b

File tree

5 files changed

+28
-9
lines changed

5 files changed

+28
-9
lines changed

VERSIONLOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# TACA Version Log
22

3+
##20251121.1
4+
5+
Exclude pod5 from delivery by default
6+
37
## 20251106.1
48

59
Improve logging

taca/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""Main TACA module"""
22

3-
__version__ = "1.6.12"
3+
__version__ = "1.6.13"

taca/organise/cli.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,19 @@
1313
required=True,
1414
help="Project ID (e.g. P12345)",
1515
) # future todo: option to organise all flowcells in a project
16+
@click.option(
17+
"--include_pod5",
18+
is_flag=True,
19+
default=False,
20+
help="Include pod5 files when organising Nanopore flowcells. Default is False.",
21+
)
1622
@click.argument("flowcells")
17-
def organise_flowcells(flowcells, project):
23+
def organise_flowcells(flowcells, project, include_pod5):
1824
"""Organise FLOWCELLS.
1925
2026
FLOWCELLS is the name of one or more sequencing flowcells, separated by a comma. e.g.:
2127
241122_VH00204_464_AAG77JJN5,241120_VH00202_453_AAG76JJM7
2228
"""
2329
flowcells_to_organise = flowcells.split(",")
2430
for fc in flowcells_to_organise:
25-
organise.organise_flowcell(fc, project)
31+
organise.organise_flowcell(fc, project, include_pod5)

taca/organise/flowcells.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111
logger = logging.getLogger(__name__)
1212

1313

14-
def get_flowcell_object(flowcell, project):
14+
def get_flowcell_object(flowcell, project, include_pod5=False):
1515
if re.match(filesystem.RUN_RE_ONT, flowcell):
16-
return NanoporeFlowcell(flowcell=flowcell, project_id=project)
16+
return NanoporeFlowcell(
17+
flowcell=flowcell, project_id=project, include_pod5=include_pod5
18+
)
1719
elif re.match(filesystem.RUN_RE_ILLUMINA, flowcell):
1820
return IlluminaFlowcell(flowcell=flowcell, project_id=project)
1921
elif re.match(filesystem.RUN_RE_ELEMENT, flowcell):
@@ -44,13 +46,14 @@ def create_org_dir(self):
4446
class NanoporeFlowcell(Flowcell):
4547
"""Defines a Nanopore Flowcell"""
4648

47-
def __init__(self, flowcell, project_id):
49+
def __init__(self, flowcell, project_id, include_pod5=False):
4850
super().__init__(flowcell, project_id)
4951
self.destination_path = CONFIG.get("organise").get("nanopore_path")
5052
self.organised_project_dir = os.path.join(self.destination_path, project_id)
5153
self.tar_file = self.fc_id + ".tar"
5254
self.tar_path = os.path.join(self.organised_project_dir, self.tar_file)
5355
self.md5_path = self.tar_path + ".md5"
56+
self.include_pod5 = include_pod5
5457

5558
def organise_data(self):
5659
"""Tarball data into ONT_TAR"""
@@ -59,7 +62,13 @@ def organise_data(self):
5962
tar_err = os.path.join(self.organised_project_dir, "tar.err")
6063
with filesystem.chdir(self.incoming_path):
6164
with open(tar_err, "w") as error_file:
62-
tar_command = ["tar", "-cvf", self.tar_path, self.fc_id]
65+
tar_command = [
66+
"tar",
67+
*(["--exclude=pod5*"] if not self.include_pod5 else []),
68+
"-cvf",
69+
self.tar_path,
70+
self.fc_id,
71+
]
6372
result = subprocess.run(tar_command, stderr=error_file)
6473
if result.returncode != 0:
6574
logger.error(

taca/organise/organise.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
logger = logging.getLogger(__name__)
88

99

10-
def organise_flowcell(flowcell, project):
10+
def organise_flowcell(flowcell, project, include_pod5=False):
1111
"""Determine flowcell type and organise the data accordingly."""
12-
flowcell_object = get_flowcell_object(flowcell, project)
12+
flowcell_object = get_flowcell_object(flowcell, project, include_pod5)
1313
flowcell_object.create_org_dir()
1414
flowcell_object.organise_data()
1515
logger.info(f"Finished organisation of flowcell {flowcell}.")

0 commit comments

Comments
 (0)