Skip to content

Commit

Permalink
bcftbx/mock: add 'complete' argument to MockIlluminaRun, to allow run…
Browse files Browse the repository at this point in the history
… completion files to be omitted.
  • Loading branch information
pjbriggs committed Feb 16, 2024
1 parent a898c23 commit cbe61e0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions bcftbx/mock.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# mock.py: module providing mock Illumina data for testing
# Copyright (C) University of Manchester 2012-2022 Peter Briggs
# Copyright (C) University of Manchester 2012-2024 Peter Briggs
#
########################################################################

Expand Down Expand Up @@ -755,7 +755,7 @@ class MockIlluminaRun:
def __init__(self,name,platform,top_dir=None,
ntiles=None,bases_mask=None,
sample_sheet_content=None,
flowcell_mode=None):
flowcell_mode=None,complete=True):
"""
Create a new MockIlluminaRun instance
Expand All @@ -778,6 +778,9 @@ def __init__(self,name,platform,top_dir=None,
be used to generate a sample sheet
flowcell_mode (str): optionally specify the flow cell
mode to be included in the run parameters
complete (bool): default is to include the appropriate
run completion files in the mock run; set to False to
omit these files
"""
self._created = False
self._name = name
Expand All @@ -786,6 +789,7 @@ def __init__(self,name,platform,top_dir=None,
else:
self._top_dir = os.getcwd()
self._platform = platform
self._complete = bool(complete)
# Set defaults for platform
if self._platform == "miniseq":
# MiniSeq
Expand Down Expand Up @@ -1057,7 +1061,7 @@ def create(self):
io.open(self._path('Data','Intensities','BaseCalls','config.xml'),
'wb+').close()
# Run completion files (e.g. 'RTAComplete.txt' etc)
if self._completion_files:
if self._complete and self._completion_files:
for f in self._completion_files:
io.open(self._path(f),'wb+').close()

Expand Down

0 comments on commit cbe61e0

Please sign in to comment.