Skip to content

Commit 7f9dee0

Browse files
authored
Merge pull request #67 from seiboldlab/dev
Dev
2 parents ad48c9d + 6440249 commit 7f9dee0

6 files changed

Lines changed: 37 additions & 7 deletions

File tree

rules/rnaseq.rules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ with Stage("report_vp") as S:
158158
"exec >{log} 2>&1;"
159159
"SRCS=({input});"
160160
"DSTS=({output});"
161-
"MSG=\"New RNA-Seq (v{params.version}) results for \`{params.project}\`:\n\n\";"
161+
"MSG=\"New RNA-Seq (v{params.version}) results for \\`{params.project}\\`:\n\n\";"
162162
"LABEL={params.label};"
163163
"for i in \"${{!SRCS[@]}}\"; do"
164164
" echo Copying ${{SRCS[i]}} to ${{DSTS[i]}};"
@@ -175,7 +175,7 @@ with Stage("report_vp") as S:
175175
" REPORT=$(date +{params.reporttpl});"
176176
" echo Copying ${{SRCS[i]}} to $REPORT;"
177177
" cp -a ${{SRCS[i]}} $REPORT;"
178-
" MSG=\"$MSG\n- \`$REPORT\`\";"
178+
" MSG=\"$MSG\n- \\`$REPORT\\`\";"
179179
"done;"
180180
"if [ -n \"{params.slack_hook}\" ]; then"
181181
" curl"

rules/virprof.rules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ with Stage("report_pathogen_vp") as S:
615615
"exec >{log} 2>&1;"
616616
"SRCS=({input});"
617617
"DSTS=({output});"
618-
"MSG=\"New Pathogen (v{params.version}) results for \`{params.project}\`:\n\n\";"
618+
"MSG=\"New Pathogen (v{params.version}) results for \\`{params.project}\\`:\n\n\";"
619619
"LABEL={params.label};"
620620
"for i in \"${{!SRCS[@]}}\"; do"
621621
" echo Copying ${{SRCS[i]}} to ${{DSTS[i]}};"
@@ -632,7 +632,7 @@ with Stage("report_pathogen_vp") as S:
632632
" REPORT=$(date +{params.reporttpl});"
633633
" echo Copying ${{SRCS[i]}} to $REPORT;"
634634
" cp -a ${{SRCS[i]}} $REPORT;"
635-
" MSG=\"$MSG\n- \`$REPORT\`\";"
635+
" MSG=\"$MSG\n- \\`$REPORT\\`\";"
636636
"done;"
637637
"if [ -n \"{params.slack_hook}\" ]; then"
638638
" curl"

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"rules/*",
1616
"test_data/*",
1717
"*.yml",
18+
"respiratory_virus_whitelist.txt",
1819
"README.md",
1920
]
2021
}
@@ -37,7 +38,7 @@
3738
shutil.copy(src, dst)
3839
with open(os.path.join(submodule, "__init__.py"), "w"):
3940
pass
40-
setup(package_data=package_data)
41+
setup(package_data=package_data, zip_safe=False)
4142
finally:
4243
for submodule in extra_package_data:
4344
shutil.rmtree(submodule)

virprof/__init__.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
"""Virprof pipeline custom functions for pathogen recovery"""
22

3+
from pathlib import Path
34

4-
import os
5+
def get_resource(path):
6+
roots = [Path(__file__).parent.parent, Path(__file__).parent / "pipeline"]
7+
for root in roots:
8+
loc = root / path
9+
if loc.exists():
10+
return loc
11+
raise Exception(f"Unable to find {path}. Please check your installation")
512

613
def get_ymp_yml():
7-
return os.path.realpath(__file__)
14+
return str(get_resource("virprof.yml"))

virprof/cli/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ def get_command(self, ctx, cmd_name):
141141

142142

143143
@click.command(cls=AutoLoadCommand)
144+
@click.version_option()
144145
@click.option(
145146
"--profile",
146147
is_flag=True,

virprof/cli/init_test.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import click
2+
import pathlib
3+
from .. import get_resource
4+
from subprocess import run
5+
6+
@click.command()
7+
@click.argument("path", type=click.Path(path_type=pathlib.Path))
8+
def cli(path) -> bool:
9+
"""Set up a demo/test directory"""
10+
testdata = get_resource("test_data")
11+
12+
if not path.exists():
13+
path.mkdir(parents=True)
14+
elif not path.is_dir():
15+
raise click.ClickException("Not a directory: {path}")
16+
elif any(path.iterdir()):
17+
raise click.ClickException("Directory not empty: {path}")
18+
19+
run(testdata / "install_testdata.sh", cwd = path, check = True)
20+
21+
return True

0 commit comments

Comments
 (0)