Skip to content
This repository was archived by the owner on Apr 22, 2025. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 29 additions & 3 deletions sequence_processing_pipeline/GenPrepFileJob.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from sequence_processing_pipeline.Job import Job
from sequence_processing_pipeline.PipelineError import PipelineError
from os import makedirs, symlink
from os.path import join, exists, basename
from shutil import copytree
from os.path import isdir, join, exists, basename
from shutil import copy, copytree
from functools import partial
from collections import defaultdict
from metapool import (demux_sample_sheet, parse_prep,
Expand Down Expand Up @@ -46,7 +46,33 @@ def __init__(self, run_dir, convert_job_path, qc_job_path, output_path,
self.is_restart = True
else:
self.is_restart = False
copytree(self.reports_path, reports_dir)

"""
With copytree(src, dst), src must be an existing directory and dst
must be a path that doesn't already exist.
src cannot be a file. it must be a directory.

when using copytree to copy a directory, dst must be the path to
the directory where you want the copy PLUS the name of the copied
directory. To give dst the same directory name as src you would
then need to split() the folder name off the end of src and append
it to dst to get a proper value. copytree() DOES NOT put a copy
of src in dst. More like it copies the entire contents of src
recursively into dst, however dst cannot already exist so you
can't use it to copy the contents of a directory into an existing
directory.

This means that if src is a file and not a directory, you will
need to use copy() to copy the file instead. It also means that
you will need to make reports_dir manually.
"""

if isdir(self.reports_path):
copytree(self.reports_path, reports_dir)
else:
# assume self.reports_path is a file.
makedirs(reports_dir)
copy(self.reports_path, reports_dir)

# extracting from either convert_job_path or qc_job_path should
# produce equal results.
Expand Down
Loading