Skip to content

Commit

Permalink
Merge pull request #161 from zktuong/productive-ratio-and-vj-gene-usage
Browse files Browse the repository at this point in the history
add new functions and rework github actions
  • Loading branch information
zktuong committed Jul 7, 2022
2 parents 04586e2 + 28e6d99 commit 69ae2e2
Show file tree
Hide file tree
Showing 29 changed files with 1,830 additions and 2,023 deletions.
33 changes: 1 addition & 32 deletions .github/workflows/badge.yml
@@ -1,52 +1,21 @@
name: badge

on:
pull_request:
branches:
- "*"
push:
branches:
- "master"
- "devel"
create:
tags:
- "*"


jobs:
devel:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
if: github.ref != 'refs/heads/master'
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.7'
- id: version
name: Install package
run: |
pip install setuptools wheel setuptools_scm numpy
pip install git+https://www.github.com/zktuong/dandelion@devel
echo "##[set-output name=version;]$(python dandelion/logging/_badge.py)"
- name: version badge
uses: RubbaBoy/BYOB@v1.2.0
with:
NAME: devel-version
LABEL: 'devel-version'
ICON: 'github'
STATUS: ${{ steps.version.outputs.version}}
COLOR: blue
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
master:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
if: github.ref != 'refs/heads/devel'
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v2
- name: Set up Python
Expand Down
24 changes: 22 additions & 2 deletions .github/workflows/singularity_container-install.yml
Expand Up @@ -3,15 +3,35 @@ on:
push:
branches:
- master
- devel
- "*"

# Do the builds on all pull requests (to test them)
pull_request:
branches:
- "*"
jobs:
changes:
name: Checking changed files
runs-on: ubuntu-latest
outputs:
changed_file: ${{ steps.files.outputs.added_modified }}
keepgoing: ${{ steps.checkfiles.outputs.keepgoing }}
steps:
- id: files
uses: jitterbit/get-changed-files@b17fbb00bdc0c0f63fcf166580804b4d2cdc2a42
with:
format: 'json'
- id: checkfiles
run: |
if [[ ${{ steps.files.outputs.added_modified }} == *.yml* || ${{ steps.files.outputs.added_modified }} == *.py* || ${{ steps.files.outputs.added_modified }} == *test* || ${{ steps.files.outputs.added_modified }} == *requirements* ]] ; then
echo "::set-output name=keepgoing::true"
else
echo "::set-output name=keepgoing::false"
fi
container:
needs:
- changes
if: needs.changes.outputs.keepgoing == 'true'
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.13
Expand Down
41 changes: 31 additions & 10 deletions .github/workflows/tests.yml
Expand Up @@ -7,13 +7,34 @@ on:
push:
branches:
- "master"
- "devel"

env:
cache-version: 'cache-v1'

jobs:
tests:
changes:
name: Checking changed files
runs-on: ubuntu-latest
outputs:
changed_file: ${{ steps.files.outputs.added_modified }}
keepgoing: ${{ steps.checkfiles.outputs.keepgoing }}
steps:
- id: files
uses: jitterbit/get-changed-files@b17fbb00bdc0c0f63fcf166580804b4d2cdc2a42
with:
format: 'json'
- id: checkfiles
run: |
if [[ ${{ steps.files.outputs.added_modified }} == *.yml* || ${{ steps.files.outputs.added_modified }} == *.py* || ${{ steps.files.outputs.added_modified }} == *test* || ${{ steps.files.outputs.added_modified }} == *requirements* ]]; then
echo "::set-output name=keepgoing::true"
else
echo "::set-output name=keepgoing::false"
fi
tests:
needs:
- changes
if: needs.changes.outputs.keepgoing == 'true'
timeout-minutes: 720
defaults:
run:
Expand Down Expand Up @@ -42,7 +63,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2

- name: Install ubuntu system dependencies
if: matrix.config.os == 'ubuntu-latest'
run: |
Expand Down Expand Up @@ -76,7 +97,7 @@ jobs:
python-version: ${{ matrix.config.python-version }}
environment-file: environment.yml
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!

- name: Display Python version
run: |
python --version
Expand All @@ -100,7 +121,7 @@ jobs:
- id: R
name: Check R version
run: |
R --version > VERSION
R --version > VERSION
echo "##[set-output name=version;]$(head -1 VERSION | awk '{print $3}')"
echo "##[set-output name=mainbiocversion;]$(Rscript -e 'cat(unlist(tools:::.BioC_version_associated_with_R_version()))' | awk '{print $1}')"
echo "##[set-output name=subbiocversion;]$(Rscript -e 'cat(unlist(tools:::.BioC_version_associated_with_R_version()))' | awk '{print $2}')"
Expand All @@ -112,11 +133,11 @@ jobs:
with:
r-version: ${{ steps.R.outputs.version}}

- name: Setup r-lib/remotes
- name: Setup r-lib/remotes
run: |
install.packages('remotes')
shell: Rscript {0}

- name: Cache ubuntu R packages
if: "!contains(github.event.head_commit.message, '/nocache') && matrix.config.os == 'ubuntu-latest'"
uses: actions/cache@v2
Expand All @@ -132,11 +153,11 @@ jobs:
path: ${{ env.R_LIBS_USER }}
key: ${{ env.cache-version }}-${{ matrix.config.os }}-biocversion-RELEASE_${{ steps.R.outputs.mainbiocversion}}_${{ steps.R.outputs.subbiocversion}}-r-${{ steps.R.outputs.version}}-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ env.cache-version }}-${{ matrix.config.os }}-biocversion-RELEASE_${{ steps.R.outputs.mainbiocversion}}_${{ steps.R.outputs.subbiocversion}}-r-${{ steps.R.outputs.version}}-

- name: Install Dandelion
run: |
python -m pip install .
- name: Install ubuntu R dependencies
if: matrix.config.os == 'ubuntu-latest'
run: |
Expand All @@ -161,7 +182,7 @@ jobs:
install.packages(c('shazam', 'alakazam', 'tigger', 'airr', 'optparse'))
shell: Rscript {0}

- name: Test if R dependencies are installed properly
- name: Test if R dependencies are installed properly
run: |
Rscript tests/r_dependencies.R
shell: bash -l {0}
Expand Down
2 changes: 0 additions & 2 deletions DESCRIPTION.md
Expand Up @@ -2,8 +2,6 @@
[![](https://img.shields.io/pypi/v/sc-dandelion?logo=PyPI)](https://pypi.org/project/sc-dandelion/)
[![](https://byob.yarr.is/zktuong/dandelion/master-version)](https://github.com/zktuong/dandelion/tree/master)
[![master](https://github.com/zktuong/dandelion/workflows/tests/badge.svg?branch=master)]((https://github.com/zktuong/dandelion/actions?query=workflow%3Atests))
[![](https://byob.yarr.is/zktuong/dandelion/devel-version)](https://github.com/zktuong/dandelion/tree/devel)
[![tests](https://github.com/zktuong/dandelion/workflows/tests/badge.svg?branch=devel)](https://github.com/zktuong/dandelion/actions?query=workflow%3Atests)
[![codecov](https://codecov.io/gh/zktuong/dandelion/branch/master/graph/badge.svg?token=661BMU1FBO)](https://codecov.io/gh/zktuong/dandelion)
[![](https://img.shields.io/static/v1?label=AIRR-C%20sw-tools%20v1&message=compliant&color=008AFF&labelColor=000000&style=plastic)](https://docs.airr-community.org/en/stable/swtools/airr_swtools_standard.html)
[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/zktuong/dandelion/blob/master/container/dandelion_singularity.ipynb)
Expand Down
5 changes: 1 addition & 4 deletions README.md
Expand Up @@ -2,8 +2,6 @@
[![](https://img.shields.io/pypi/v/sc-dandelion?logo=PyPI)](https://pypi.org/project/sc-dandelion/)
[![](https://byob.yarr.is/zktuong/dandelion/master-version)](https://github.com/zktuong/dandelion/tree/master)
[![master](https://github.com/zktuong/dandelion/workflows/tests/badge.svg?branch=master)]((https://github.com/zktuong/dandelion/actions?query=workflow%3Atests))
[![](https://byob.yarr.is/zktuong/dandelion/devel-version)](https://github.com/zktuong/dandelion/tree/devel)
[![tests](https://github.com/zktuong/dandelion/workflows/tests/badge.svg?branch=devel)](https://github.com/zktuong/dandelion/actions?query=workflow%3Atests)
[![codecov](https://codecov.io/gh/zktuong/dandelion/branch/master/graph/badge.svg?token=661BMU1FBO)](https://codecov.io/gh/zktuong/dandelion)
[![](https://img.shields.io/static/v1?label=AIRR-C%20sw-tools%20v1&message=compliant&color=008AFF&labelColor=000000&style=plastic)](https://docs.airr-community.org/en/stable/swtools/airr_swtools_standard.html)
[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/zktuong/dandelion/blob/master/container/dandelion_singularity.ipynb)
Expand Down Expand Up @@ -83,8 +81,7 @@ pip install "rpy2>=3.4.2" # or if you don't mind having conda manage R: conda in
# Use pip to install the following with --no-cache-dir --upgrade if necessary
# and then lastly install this
pip install sc-dandelion
# or pip install git+https://github.com/zktuong/dandelion.git
# for the development branch, run this: pip install git+https://github.com/zktuong/dandelion.git@devel
# or for the latest version, pip install git+https://github.com/zktuong/dandelion.git

# to use ddl.pl.clone_overlap, please install nxviz:
pip install git+https://github.com/zktuong/nxviz.git@custom_color_mapping_circos_nodes_and_edges
Expand Down
24 changes: 0 additions & 24 deletions container/environment_dev.yml

This file was deleted.

58 changes: 0 additions & 58 deletions container/sc-dandelion_dev.def

This file was deleted.

4 changes: 3 additions & 1 deletion dandelion/plotting/__init__.py
Expand Up @@ -2,13 +2,14 @@
# @Author: Kelvin
# @Date: 2020-05-13 23:21:45
# @Last Modified by: Kelvin
# @Last Modified time: 2022-07-04 08:29:04
# @Last Modified time: 2022-07-06 21:42:43
"""init module."""
from ._plotting import (
barplot,
clone_network,
clone_overlap,
clone_rarefaction,
productive_ratio,
spectratype,
stackedbarplot,
)
Expand All @@ -18,6 +19,7 @@
"clone_network",
"clone_overlap",
"clone_rarefaction",
"productive_ratio",
"spectratype",
"stackedbarplot",
]

0 comments on commit 69ae2e2

Please sign in to comment.