Skip to content

Commit

Permalink
add ngi_data dir, clarify test scope
Browse files Browse the repository at this point in the history
  • Loading branch information
kedhammar committed Apr 10, 2024
1 parent 47cb0ab commit 3b317ba
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 49 deletions.
29 changes: 15 additions & 14 deletions tests/analysis/test_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,21 +376,22 @@ def create_illumina_run_dir(
e.g.
tmp
└── sequencing
└── NovaSeqXPlus
└── 20240202_LH00217_0044_A2255J2LT3
├── CopyComplete.txt
├── Demultiplexing
├── RTAComplete.txt
├── RunInfo.xml
├── RunParameters.xml
└── SampleSheet.csv
└── ngi_data
└── sequencing
└── NovaSeqXPlus
└── 20240202_LH00217_0044_A2255J2LT3
├── CopyComplete.txt
├── Demultiplexing
├── RTAComplete.txt
├── RunInfo.xml
├── RunParameters.xml
└── SampleSheet.csv
Return it's path.
"""

# Get run path
run_path = f"{tmp.name}/sequencing/{instrument}/{run_name}"
run_path = f"{tmp.name}/ngi_data/sequencing/{instrument}/{run_name}"

# Create runs directory structure
if os.path.exists(run_path):
Expand Down Expand Up @@ -549,7 +550,7 @@ def create_illumina_run_dir(
return run_path


def test_get_runObj(create_dirs):
def test_run_preprocessing(create_dirs):
tmp = create_dirs

# Mock CONFIG
Expand Down Expand Up @@ -577,7 +578,7 @@ def test_get_runObj(create_dirs):
level = test_config_yaml.get("log").get("log_level", "INFO")
init_logger_file(log_file, level)

# Start demux
analysis.run_preprocessing(run_path, software)
# Demux in progress
# Start demux, all runs
analysis.run_preprocessing(None, software)
# Demux in progress, specified run
analysis.run_preprocessing(run_path, software)
55 changes: 27 additions & 28 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,46 +34,45 @@ def create_dirs():
│ └── samplesheets
│ ├── NovaSeqXPlus
│ └── anglerfish
└── sequencing
├── MiSeq
│ └── nosync
├── NextSeq
│ └── nosync
├── NovaSeq
│ └── nosync
├── NovaSeqXPlus
│ └── nosync
├── minion
│ ├── nosync
│ └── qc
│ └── nosync
└── promethion
└── nosync
└── ngi_data
└── sequencing
├── MiSeq
│ └── nosync
├── NextSeq
│ └── nosync
├── NovaSeq
│ └── nosync
├── NovaSeqXPlus
│ └── nosync
├── minion
│ ├── nosync
│ └── qc
│ └── nosync
└── promethion
└── nosync
--> Return the the temporary directory object
"""
tmp = tempfile.TemporaryDirectory()

# CREATE DIR STRUCTURE

# Sequencing data
# Illumina
os.makedirs(f"{tmp.name}/sequencing/MiSeq/nosync")
os.makedirs(f"{tmp.name}/sequencing/NextSeq/nosync")
os.makedirs(f"{tmp.name}/sequencing/NovaSeq/nosync")
os.makedirs(f"{tmp.name}/sequencing/NovaSeqXPlus/nosync")
# ONT
os.makedirs(f"{tmp.name}/sequencing/promethion/nosync")
os.makedirs(f"{tmp.name}/sequencing/minion/nosync")
os.makedirs(f"{tmp.name}/sequencing/minion/qc/nosync")
## Illumina
os.makedirs(f"{tmp.name}/ngi_data/sequencing/MiSeq/nosync")
os.makedirs(f"{tmp.name}/ngi_data/sequencing/NextSeq/nosync")
os.makedirs(f"{tmp.name}/ngi_data/sequencing/NovaSeq/nosync")
os.makedirs(f"{tmp.name}/ngi_data/sequencing/NovaSeqXPlus/nosync")
## ONT
os.makedirs(f"{tmp.name}/ngi_data/sequencing/promethion/nosync")
os.makedirs(f"{tmp.name}/ngi_data/sequencing/minion/nosync")
os.makedirs(f"{tmp.name}/ngi_data/sequencing/minion/qc/nosync")

# Sequencing metadata
# Illumina
## Illumina
os.makedirs(f"{tmp.name}/ngi-nas-ns/miseq_data")
os.makedirs(f"{tmp.name}/ngi-nas-ns/NextSeq_data")
os.makedirs(f"{tmp.name}/ngi-nas-ns/NovaSeq_data")
os.makedirs(f"{tmp.name}/ngi-nas-ns/NovaSeqXPlus_data")
# ONT
## ONT
os.makedirs(f"{tmp.name}/ngi-nas-ns/promethion_data")
os.makedirs(f"{tmp.name}/ngi-nas-ns/minion_data")

Expand Down
14 changes: 7 additions & 7 deletions tests/nanopore/test_ONT_run_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,31 @@ def make_ONT_test_config(tmp: tempfile.TemporaryDirectory) -> dict:
run_types:
user_run:
data_dirs:
- {tmp.name}/sequencing/promethion
- {tmp.name}/sequencing/minion
- {tmp.name}/ngi_data/sequencing/promethion
- {tmp.name}/ngi_data/sequencing/minion
ignore_dirs:
- 'nosync'
- 'qc'
instruments:
promethion:
transfer_log: {tmp.name}/log/transfer_promethion.tsv
archive_dir: {tmp.name}/sequencing/promethion/nosync
archive_dir: {tmp.name}/ngi_data/sequencing/promethion/nosync
metadata_dir: {tmp.name}/ngi-nas-ns/promethion_data
destination: {tmp.name}/miarka/promethion/
minion:
transfer_log: {tmp.name}/log/transfer_minion.tsv
archive_dir: {tmp.name}/sequencing/minion/nosync
archive_dir: {tmp.name}/ngi_data/sequencing/minion/nosync
metadata_dir: {tmp.name}/ngi-nas-ns/minion_data
destination: {tmp.name}/miarka/minion/
qc_run:
data_dirs:
- {tmp.name}/sequencing/minion/qc
- {tmp.name}/ngi_data/sequencing/minion/qc
ignore_dirs:
- 'nosync'
instruments:
minion:
transfer_log: {tmp.name}/log/transfer_minion_qc.tsv
archive_dir: {tmp.name}/sequencing/minion/qc/nosync
archive_dir: {tmp.name}/ngi_data/sequencing/minion/qc/nosync
metadata_dir: {tmp.name}/ngi-nas-ns/minion_data/qc
destination: {tmp.name}/miarka/minion/qc
anglerfish:
Expand Down Expand Up @@ -118,7 +118,7 @@ def create_ONT_run_dir(
instrument = "minion"
instrument_position = "MN19414"
if not data_dir:
data_dir = f"{tmp.name}/sequencing/{instrument}"
data_dir = f"{tmp.name}/ngi_data/sequencing/{instrument}"

run_name = f"{run_start_time}_{instrument_position}_{flowcell_id}_{run_id}"
if qc:
Expand Down

0 comments on commit 3b317ba

Please sign in to comment.