Skip to content

Commit

Permalink
Snakemake workflow (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
rnmitchell authored Apr 21, 2023
1 parent ea1309b commit 6730754
Show file tree
Hide file tree
Showing 46 changed files with 2,652 additions and 2,454 deletions.
10 changes: 6 additions & 4 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
include versioneer.py
include lusSTR/_version.py
include lusSTR/filters.json
include lusSTR/str_markers.json
include lusSTR/snp_data.json
include lusSTR/filters.json
include lusSTR/data/filters.json
include lusSTR/data/str_markers.json
include lusSTR/data/snp_data.json
include lusSTR/data/config.yaml
include lusSTR/tests/data/*
include lusSTR/workflows/*
include lusSTR/wrappers/*
include lusSTR/tests/data/STRait_Razor_test_output/*
include lusSTR/tests/data/UAS_bulk_input/*
include lusSTR/tests/data/snps/*
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ help: Makefile

## test: run the automated test suite and print coverage information
test:
pytest --cov=lusSTR --doctest-modules lusSTR/annot.py lusSTR/tests/test_*.py
pytest -m "not snps" --cov=lusSTR --doctest-modules lusSTR/tests/test_*.py

## style: check code style
style:
black --line-length=99 --check *.py lusSTR/*.py lusSTR/tests/test_*.py
black --line-length=99 --check *.py lusSTR/scripts/*.py lusSTR/wrappers/*.py lusSTR/tests/test_*.py

## format: auto-reformat code with Black
format:
black --line-length=99 *.py lusSTR/*.py lusSTR/tests/test_*.py
black --line-length=99 *.py lusSTR/scripts/*.py lusSTR/wrappers/*.py lusSTR/tests/test_*.py

## devenv: configure a development environment
devenv:
Expand Down
245 changes: 86 additions & 159 deletions README.md

Large diffs are not rendered by default.

17 changes: 10 additions & 7 deletions lusSTR/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@
# Development Center.
# -------------------------------------------------------------------------------------------------

from lusSTR import annot
from lusSTR import marker
from lusSTR import repeat
from lusSTR import format
from lusSTR import snps
from lusSTR import filter
from pkg_resources import resource_filename
from lusSTR import cli
from ._version import get_versions
from lusSTR._version import get_versions

__version__ = get_versions()["version"]
del get_versions


def snakefile(workflow="strs"):
return resource_filename("lusSTR", f"workflows/{workflow}.smk")


def wrapper(label):
return resource_filename("lusSTR", f"wrappers/{label}.py")
211 changes: 0 additions & 211 deletions lusSTR/cli.py

This file was deleted.

41 changes: 41 additions & 0 deletions lusSTR/cli/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import argparse
import lusSTR
from lusSTR.cli import config
from lusSTR.cli import strs
from lusSTR.cli import snps
import snakemake


mains = {
"config": config.main,
"strs": strs.main,
"snps": snps.main
}

subparser_funcs = {
"config": config.subparser,
"strs": strs.subparser,
"snps": snps.subparser
}


def main(args=None):
if args is None:
args = get_parser().parse_args()
if args.subcmd is None:
get_parser().parse_args(["-h"])
mainmethod = mains[args.subcmd]
result = mainmethod(args)
return result


def get_parser():
parser = argparse.ArgumentParser()
parser.add_argument(
"-v", "--version", action="version", version="lusSTR v" + lusSTR.__version__
)
subcommandstr = ", ".join(sorted(subparser_funcs.keys()))
subparsers = parser.add_subparsers(dest="subcmd", metavar="subcmd", help=subcommandstr)
for func in subparser_funcs.values():
func(subparsers)
return parser
Loading

0 comments on commit 6730754

Please sign in to comment.