Skip to content

Commit

Permalink
Include notebook into package
Browse files Browse the repository at this point in the history
  • Loading branch information
jykr committed Apr 9, 2024
1 parent c49716c commit 7951331
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 11 deletions.
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
global-include *.pyx
global-include *.pxd
graft notebooks
include annotate/ldlr_exons.fa
2 changes: 1 addition & 1 deletion bean/cli/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def main(args):
"python -m ipykernel install --user --name bean_python3 --display-name bean_python3"
)
pm.execute_notebook(
f"{os.path.dirname(be.__file__)}/../notebooks/profile_editing_preference.ipynb",
f"{os.path.dirname(be.__file__)}/notebooks/profile_editing_preference.ipynb",
f"{args.output_prefix}.ipynb",
parameters=dict(
bdata_path=args.bdata_path,
Expand Down
2 changes: 1 addition & 1 deletion bean/cli/qc.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def main(args):
"python -m ipykernel install --user --name bean_python3 --display-name bean_python3"
)
pm.execute_notebook(
f"{os.path.dirname(be.__file__)}/../notebooks/sample_quality_report.ipynb",
f"{os.path.dirname(be.__file__)}/notebooks/sample_quality_report.ipynb",
f"{args.out_report_prefix}.ipynb",
parameters=dict(
bdata_path=args.bdata_path,
Expand Down
File renamed without changes.
File renamed without changes.
5 changes: 4 additions & 1 deletion bean/plotting/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import argparse
import os


def parse_args(parser=None):
Expand All @@ -23,7 +24,7 @@ def parse_args(parser=None):
"--condition-col",
help="Column name in `bdata.samples` that describes experimental condition. (sorting bin, time, etc.)",
type=str,
default="bin",
default="condition",
)
parser.add_argument(
"--pam-col",
Expand All @@ -49,6 +50,8 @@ def parse_args(parser=None):


def check_args(args):
if args.output_prefix is None:
args.output_prefix = os.path.splitext(args.bdata_path)[0]
if args.window_length < 1:
raise ValueError(f"window_length {args.window_length} is too small.")
if args.window_length > 20:
Expand Down
16 changes: 8 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
from setuptools import setup, find_packages
from setuptools import setup, find_namespace_packages
from Cython.Build import cythonize

with open("README.md", "r") as fh:
Expand All @@ -16,7 +16,7 @@
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/pinellolab/crispr-bean",
packages=find_packages(),
packages=find_namespace_packages(),
ext_modules=cythonize(["bean/mapping/CRISPResso2Align.pyx"]),
include_dirs=np.get_include(),
setup_requires=[
Expand Down Expand Up @@ -45,14 +45,14 @@
"nbconvert",
"logomaker",
],
extras_require={"model": ["pyBigWig", "pyro-ppl<=1.8.1", "statsmodels", "torch"]},
extras_require={"model": ["pyBigWig", "pyro-ppl", "statsmodels", "torch"]},
include_package_data=True,
package_data={
"": [
"bean/annotate/ldlr_exons.fa",
"notebooks/sample_quality_report.ipynb",
"notebooks/profile_editing_preference.ipynb",
]
"bean.annotate": ["ldlr_exons.fa"],
"bean.notebooks": [
"sample_quality_report.ipynb",
"profile_editing_preference.ipynb",
],
},
classifiers=[
"Programming Language :: Python :: 3",
Expand Down

0 comments on commit 7951331

Please sign in to comment.