Skip to content

Commit

Permalink
allow outdir to exist
Browse files Browse the repository at this point in the history
  • Loading branch information
mbhall88 committed May 30, 2022
1 parent c7cb134 commit 4fe5719
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fastq-dl.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def sra_download(accession, outdir, cpus=1, max_attempts=10):
pe = f"{outdir}/{accession}_2.fastq.gz"

if not os.path.exists(se) and not os.path.exists(pe):
Path(outdir).mkdir(parents=True)
Path(outdir).mkdir(parents=True, exist_ok=True)
outcome = execute(
f"fasterq-dump {accession} --split-files --threads {cpus}",
max_attempts=max_attempts,
Expand Down Expand Up @@ -273,7 +273,7 @@ def download_ena_fastq(fasp, ftp, outdir, md5, aspera, max_attempts=10, ftp_only
fastq = f"{outdir}/{os.path.basename(fasp)}"

if not os.path.exists(fastq):
Path(outdir).mkdir(parents=True)
Path(outdir).mkdir(parents=True, exist_ok=True)

while not success:
if ftp_only:
Expand Down

0 comments on commit 4fe5719

Please sign in to comment.