Skip to content

Commit

Permalink
MNT bump to 1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
eboileau committed Mar 5, 2024
1 parent a3f3a54 commit 7b75120
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 30 deletions.
4 changes: 3 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
include README.md
recursive-include scripts *
include src/ribotools/scripts/get-sample-table
include src/ribotools/scripts/run-tea
include src/ribotools/scripts/run-dea
19 changes: 11 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,18 @@ alignment-workflow = "ribotools.htseq_wf.alignment_workflow:main"
get-ribo-periodic = "ribotools.htseq_wf.get_ribo_periodic:main"
keep-ribo-periodic = "ribotools.htseq_wf.keep_ribo_periodic:main"
call-htseq-count = "ribotools.htseq_wf.call_htseq_count:main"
# DEA/TEA
get-sample-table = "ribotools.scripts.__main__:get_sample_table"
run-tea = "ribotools.scripts.__main__:run_tea"
run-dea = "ribotools.scripts.__main__:run_dea"

# TEA
[tool.setuptools]
script-files = [
"scripts/get-sample-table",
"scripts/run-tea",
"scripts/run-dea"
]

# discouraged - not portable to bioconda
# [tool.setuptools]
# script-files = [
# "scripts/get-sample-table",
# "scripts/run-tea",
# "scripts/run-dea"
# ]
[project.urls]
Github = "https://github.com/eboileau/ribotools/"
Issues = "https://github.com/eboileau/ribotools/issues"
Expand Down
2 changes: 1 addition & 1 deletion src/ribotools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version_info__ = ("1", "0", "1")
__version_info__ = ("1", "0", "2")
__version__ = ".".join(__version_info__)
Empty file.
29 changes: 29 additions & 0 deletions src/ribotools/scripts/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import shlex
import subprocess
import sys
from importlib.resources import files


def get_sample_table():
_run("get-sample-table")


def run_dea():
_run("run-dea")


def run_tea():
_run("run-tea")


def _get_resource(script):
package = "ribotools"
resource = "scripts"
return files(package).joinpath(resource).joinpath(script)


def _run(script):
executable = _get_resource(script)
cmd = f"{executable} {' '.join(sys.argv[1:])}"
safe = shlex.split(cmd)
subprocess.run(safe, check=True, stderr=sys.stderr, stdout=sys.stdout, text=True)
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
# 1. <-config CONFIG> Yaml config file (same as used for run-htseq-workflow)
# 2. [{-ribo,-rna}] Prepare only table for Ribo-seq or RNA-seq samples - default both

library(yaml)
library(dplyr)
print("Loading R libraries...")

suppressMessages(library(yaml))
suppressMessages(library(dplyr))

# defaults
base.loc <- "count-tables"
Expand Down
20 changes: 11 additions & 9 deletions scripts/run-dea → src/ribotools/scripts/run-dea
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,19 @@
# 6. [-delim TAB/CSV] Field separator character for read.table - default ""
# 7. [-batch] If present, uses "batch" from sample table

library(yaml)
library(DESeq2)
library(IHW)
library(ashr)
library(apeglm)
print("Loading R libraries...")

library(dplyr)
library(tibble)
library(purrr)
suppressMessages(library(yaml))
suppressMessages(library(DESeq2))
suppressMessages(library(IHW))
suppressMessages(library(ashr))
suppressMessages(library(apeglm))

library(openxlsx)
suppressMessages(library(dplyr))
suppressMessages(library(tibble))
suppressMessages(library(purrr))

suppressMessages(library(openxlsx))

# ---------------------------------------------------------
## Functions
Expand Down
20 changes: 11 additions & 9 deletions scripts/run-tea → src/ribotools/scripts/run-tea
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,19 @@
# 8. [-batch] If present, uses "batch" from sample table
# 9. [-filter] If present, filter features with 0 counts in each assay separately

library(yaml)
library(DESeq2)
library(IHW)
library(ashr)
library(apeglm)
print("Loading R libraries...")

library(dplyr)
library(tibble)
library(purrr)
suppressMessages(library(yaml))
suppressMessages(library(DESeq2))
suppressMessages(library(IHW))
suppressMessages(library(ashr))
suppressMessages(library(apeglm))

library(openxlsx)
suppressMessages(library(dplyr))
suppressMessages(library(tibble))
suppressMessages(library(purrr))

suppressMessages(library(openxlsx))

# ---------------------------------------------------------
## Functions
Expand Down

0 comments on commit 7b75120

Please sign in to comment.