Skip to content

Commit

Permalink
Merge branch 'main' of github.com:ssi-dk/bifrost_sp_ecoli
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskiil committed Nov 12, 2024
2 parents 4024ecb + daf862f commit fe9f17c
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 19 deletions.
37 changes: 18 additions & 19 deletions bifrost_sp_ecoli/pipeline.smk
Original file line number Diff line number Diff line change
Expand Up @@ -133,25 +133,24 @@ rule run_postecolityping:
"""


# rule_name = "run_qc_ecoli_summary"
# rule run_qc_ecoli_summary:
# message:
# f"Running step:{rule_name}"
# log:
# out_file = f"{component['name']}/log/{rule_name}.out.log",
# err_file = f"{component['name']}/log/{rule_name}.err.log",
# benchmark:
# f"{component['name']}/benchmarks/{rule_name}.benchmark",
# input: # files
# rules.check_requirements.output.check_file,
# output:
# folder = directory(rules.setup.params.folder + "/ecoli_analysis"),
# shell:
# """
# # Summarize
# python3 ecoli_fbi/qc_ecoli_summary.py -i {output.folder} -o {output.folder} 1> {log.out_file} 2> {log.err_file}
# """

rule_name = "run_qc_ecoli_summary"
rule run_qc_ecoli_summary:
message:
f"Running step:{rule_name}"
log:
out_file = f"{component['name']}/log/{rule_name}.out.log",
err_file = f"{component['name']}/log/{rule_name}.err.log",
benchmark:
f"{component['name']}/benchmarks/{rule_name}.benchmark",
input: # files
rules.check_requirements.output.check_file,
output:
folder = directory(rules.setup.params.folder + "/ecoli_analysis"),
shell:
"""
# Summarize
python3 ecoli_fbi/qc_ecoli_summary.py -i {output.folder} -o {output.folder} 1> {log.out_file} 2> {log.err_file}
"""

#* Dynamic section: end ****************************************************************************

Expand Down
65 changes: 65 additions & 0 deletions test/test_simple.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import os
from pathlib import Path

#import pymongo
import pytest
from bifrost_sp_ecoli import launcher
from bifrostlib import common, database_interface, datahandling
from bifrostlib.datahandling import (Component, ComponentReference, Run,
RunReference, Sample, SampleReference)


bifrost_install_dir = os.environ['BIFROST_INSTALL_DIR']
bifrost_config_and_data_path = Path(f"{bifrost_install_dir}/bifrost/test_data")

@pytest.fixture
def sample(use_collection):
json_entries = [
{
"_id": {"$oid": "000000000000000000000001"},
"display_name": "S1",
"name": "S1",
"components": [],
"categories": {
"paired_reads": {
"summary": {
"data": [f"{bifrost_config_and_data_path}/samples/S1_R1.fastq.gz",
f"{bifrost_config_and_data_path}/samples/S1_R2.fastq.gz"]
}
}
}
}
]
bson_entries = [database_interface.json_to_bson(i) for i in json_entries]
use_collection("samples")
sample = Sample(value=json_entries[0])
sample.save()
return sample


class TestBifrostSpEcoli:
component_name = "bifrost_sp_ecoli_v0.0.1"
current_dir = os.getcwd()
json_entries = [
{
"_id": {"$oid": "000000000000000000000001"},
"display_name": "S1",
"name": "S1",
"components": [],
"categories": {
"paired_reads": {
"summary": {
"data": [f"{bifrost_config_and_data_path}/samples/S1_R1.fastq.gz",
f"{bifrost_config_and_data_path}/samples/S1_R2.fastq.gz"]
}
}
}
}
]
bson_entries = [database_interface.json_to_bson(i) for i in json_entries]

def test_info(self):
launcher.main(["launcher.py", "--info"])

def test_help(self):
launcher.main(["launcher.py", "--help"])

0 comments on commit fe9f17c

Please sign in to comment.