Skip to content

Commit

Permalink
Trying to fix metagene installs
Browse files Browse the repository at this point in the history
  • Loading branch information
j-berg committed Jun 29, 2024
1 parent a37580a commit 3cedb12
Show file tree
Hide file tree
Showing 4 changed files with 245 additions and 86 deletions.
52 changes: 51 additions & 1 deletion .github/workflows/dev-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,70 @@ jobs:
pip install .
pip install codecov flake8
- name: Run Tests
- name: Run test_arguments.py
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage run -a tests/test_arguments.py
- name: Run test_utils.py
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage run -a tests/test_utils.py
- name: Run test_bam.py
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage run -a tests/test_bam.py
- name: Run test_modifyGTF.py
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage run -a tests/test_modifyGTF.py
- name: Run test_truncateGTF.py
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage run -a tests/test_truncateGTF.py
- name: Run test_metagene.py
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage run -a tests/test_metagene.py
- name: Run test_periodicity.py
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage run -a tests/test_periodicity.py
- name: Run test_complexity.py
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage run -a tests/test_complexity.py
- name: Run test_rrnaProbe.py
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage run -a tests/test_rrnaProbe.py
- name: Run test_help.py
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage run -a tests/test_help.py
- name: Run test_pipelines.py
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage run -a tests/test_pipelines.py
- name: Generate coverage report
Expand Down
131 changes: 90 additions & 41 deletions .github/workflows/main-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,44 +16,93 @@ jobs:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v3
- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
auto-update-conda: true
python-version: ${{ matrix.python-version }}
activate-environment: xpresspipe

- name: Install dependencies
shell: bash -l {0}
run: |
conda clean --all
conda install -c conda-forge mamba
mamba env update --file requirements.yml --name xpresspipe
conda activate xpresspipe
pip install .
pip install codecov flake8
- name: Run Tests
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage run -a tests/test_arguments.py
coverage run -a tests/test_utils.py
coverage run -a tests/test_bam.py
coverage run -a tests/test_modifyGTF.py
coverage run -a tests/test_truncateGTF.py
coverage run -a tests/test_metagene.py
coverage run -a tests/test_periodicity.py
coverage run -a tests/test_complexity.py
coverage run -a tests/test_rrnaProbe.py
coverage run -a tests/test_help.py
coverage run -a tests/test_pipelines.py
- name: Generate coverage report
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage report
bash <(curl -s https://codecov.io/bash) -cF python
- uses: actions/checkout@v3
- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
auto-update-conda: true
python-version: ${{ matrix.python-version }}
activate-environment: xpresspipe

- name: Install dependencies
shell: bash -l {0}
run: |
conda clean --all
conda env update --file requirements.yml --name xpresspipe
conda activate xpresspipe
pip install .
pip install codecov flake8
- name: Run test_arguments.py
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage run -a tests/test_arguments.py
- name: Run test_utils.py
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage run -a tests/test_utils.py
- name: Run test_bam.py
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage run -a tests/test_bam.py
- name: Run test_modifyGTF.py
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage run -a tests/test_modifyGTF.py
- name: Run test_truncateGTF.py
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage run -a tests/test_truncateGTF.py
- name: Run test_metagene.py
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage run -a tests/test_metagene.py
- name: Run test_periodicity.py
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage run -a tests/test_periodicity.py
- name: Run test_complexity.py
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage run -a tests/test_complexity.py
- name: Run test_rrnaProbe.py
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage run -a tests/test_rrnaProbe.py
- name: Run test_help.py
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage run -a tests/test_help.py
- name: Run test_pipelines.py
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage run -a tests/test_pipelines.py
- name: Generate coverage report
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage report
bash <(curl -s https://codecov.io/bash) -cF python
130 changes: 90 additions & 40 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,43 +13,93 @@ jobs:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v3
- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
auto-update-conda: true
python-version: ${{ matrix.python-version }}
activate-environment: xpresspipe

- name: Install dependencies
shell: bash -l {0}
run: |
conda clean --all
conda env update --file requirements.yml --name xpresspipe
conda activate xpresspipe
pip install .
pip install codecov flake8
- name: Run Tests
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage run -a tests/test_arguments.py
coverage run -a tests/test_utils.py
coverage run -a tests/test_bam.py
coverage run -a tests/test_modifyGTF.py
coverage run -a tests/test_truncateGTF.py
coverage run -a tests/test_metagene.py
coverage run -a tests/test_periodicity.py
coverage run -a tests/test_complexity.py
coverage run -a tests/test_rrnaProbe.py
coverage run -a tests/test_help.py
coverage run -a tests/test_pipelines.py
- name: Generate coverage report
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage report
bash <(curl -s https://codecov.io/bash) -cF python
- uses: actions/checkout@v3
- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
auto-update-conda: true
python-version: ${{ matrix.python-version }}
activate-environment: xpresspipe

- name: Install dependencies
shell: bash -l {0}
run: |
conda clean --all
conda env update --file requirements.yml --name xpresspipe
conda activate xpresspipe
pip install .
pip install codecov flake8
- name: Run test_arguments.py
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage run -a tests/test_arguments.py
- name: Run test_utils.py
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage run -a tests/test_utils.py
- name: Run test_bam.py
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage run -a tests/test_bam.py
- name: Run test_modifyGTF.py
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage run -a tests/test_modifyGTF.py
- name: Run test_truncateGTF.py
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage run -a tests/test_truncateGTF.py
- name: Run test_metagene.py
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage run -a tests/test_metagene.py
- name: Run test_periodicity.py
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage run -a tests/test_periodicity.py
- name: Run test_complexity.py
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage run -a tests/test_complexity.py
- name: Run test_rrnaProbe.py
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage run -a tests/test_rrnaProbe.py
- name: Run test_help.py
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage run -a tests/test_help.py
- name: Run test_pipelines.py
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage run -a tests/test_pipelines.py
- name: Generate coverage report
shell: bash -l {0}
run: |
conda activate xpresspipe
coverage report
bash <(curl -s https://codecov.io/bash) -cF python
18 changes: 14 additions & 4 deletions xpresspipe/Rmetagene.r
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,20 @@ if (!requireNamespace("dbplyr", quietly = TRUE)) {install.packages("dbplyr", rep
if (!requireNamespace("data.table", quietly = TRUE)) {install.packages("data.table", repos = "http://cran.us.r-project.org", quiet = TRUE)}
library(data.table)

if ("GenomicAlignments" %in% rownames(installed.packages()) == FALSE) {
BiocManager::install("GenomicAlignments", dependencies=c("Depends", "Imports"), quiet = TRUE)
} else {
print("GenomicAlignments package already installed")
# Define a function to install a package if not already installed
install_if_missing <- function(pkg) {
if (!pkg %in% rownames(installed.packages())) {
BiocManager::install(pkg, dependencies = c("Depends", "Imports"), quiet = FALSE)
} else {
message(pkg, " package already installed")
}
}
# List of packages to install
packages <- c("Rsamtools", "GenomicAlignments")

# Install each package if missing
for (pkg in packages) {
install_if_missing(pkg)
}
library(GenomicAlignments)

Expand Down

0 comments on commit 3cedb12

Please sign in to comment.