Skip to content

Commit

Permalink
Allow arbitrary run folder name
Browse files Browse the repository at this point in the history
  • Loading branch information
remiolsen committed Apr 30, 2024
1 parent 249360c commit 4e6c8cd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 6 additions & 2 deletions anglerfish/anglerfish.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ def run_demux(args):
if args.debug:
log.setLevel(logging.DEBUG)
run_uuid = str(uuid.uuid4())
os.mkdir(args.out_fastq)
ss = SampleSheet(args.samplesheet, args.ont_barcodes)
version = pkg_resources.get_distribution("bio-anglerfish").version
report = Report(args.run_name, run_uuid, version)
Expand Down Expand Up @@ -80,7 +79,12 @@ def run_demux(args):
adaptors_sorted[(entry.adaptor.name, entry.ont_barcode)].append(
(entry.sample_name, entry.adaptor, os.path.abspath(entry.fastq))
)

if os.path.exists(args.out_fastq):
raise FileExistsError(
f"Output folder '{args.out_fastq}' already exists. Please remove it or specify another --run_name"
)
else:
os.mkdir(args.out_fastq)
out_fastqs = []
for key, sample in adaptors_sorted.items():
adaptor_name, ont_barcode = key
Expand Down
3 changes: 3 additions & 0 deletions anglerfish/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,9 @@ def run(
)
utcnow = dt.datetime.now(dt.timezone.utc)
runname = utcnow.strftime(f"{args.run_name}_%Y_%m_%d_%H%M%S")
if run_name != "anglerfish":
runname = args.run_name

assert os.path.exists(args.out_fastq), f"Output folder '{args.out_fastq}' not found"
assert os.path.exists(
args.samplesheet
Expand Down

0 comments on commit 4e6c8cd

Please sign in to comment.