Skip to content

Commit

Permalink
Merge pull request #7 from WrightonLabCSU/develop
Browse files Browse the repository at this point in the history
0.1.0 Release
  • Loading branch information
madeline-scyphers authored Jul 29, 2024
2 parents 83b7b64 + 163d168 commit e8ff3e6
Show file tree
Hide file tree
Showing 19 changed files with 2,932 additions and 1,347 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: tests
on:
push:
branches:
- main
pull_request:
branches:
- "*"
schedule:
- cron: "0 19 * * SUN"


jobs:
ci:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
# This is the version of the action for setting up Python, not the Python version.
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
# You can test your matrix by printing the current Python version
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e '.[dev]'
- name: Install pre-commit hooks
run: pre-commit install

- name: Run pre-commit hooks for linting and other checks
run: pre-commit run --all-files

- name: Run tests
run: pytest tests --doctest-modules --cov=dram2_viz --cov-report=xml --cov-report=html

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3

- name: Pytest coverage comment
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-xml-coverage-path: ./coverage.xml
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Visualization Output Files
product.html
product.tsv
output/

# docs build
docs/_build
Expand Down
26 changes: 26 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This is the configuration for pre-commit, a local framework for managing pre-commit hooks
# Check out the docs at: https://pre-commit.com/

default_stages: [commit]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-toml
- id: check-json
- id: detect-private-key
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.5
hooks:
# Run the linter.
- id: ruff
types_or: [ python, pyi, jupyter ]
args: ['--select', 'I', '--fix']
# Run the formatter.
- id: ruff-format
types_or: [ python, pyi, jupyter ]
24 changes: 20 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DRAM2 Visualization Library

This directory contains the visualization code for DRAM2. The visualization code is written in Python and uses the [Bokeh](https://bokeh.org) and [Panel](https://panel.holoviz.org) libraries. The visualization code is used to generate the figures
This directory contains the visualization code for DRAM2. The visualization code is written in Python and uses the [Bokeh](https://bokeh.org) and [Panel](https://panel.holoviz.org) libraries. The visualization code is used to generate the figures
and dashboards for the [DRAM2 gene annotation tool](https://github.com/WrightonLabCSU/DRAM2).

## Nextflow Integration
Expand Down Expand Up @@ -29,14 +29,30 @@ The DRAM2 Visualization Library can also be used as a standalone Python package
pip install git+https://github.com/WrightonLabCSU/dram2_viz.git
```

This will install the DRAM2 Visualization Library and all of its dependencies from the main branch of the GitHub repository. To install the DRAM2 Visualization Library as a development package, clone the repository, cd into the repository, create your environment, and run:
This will install the DRAM2 Visualization Library and all of its dependencies from the main branch of the GitHub repository.

#### Development Installation

To install the DRAM2 Visualization Library as a development package, clone the repository, cd into the repository, create your environment, and run:

```bash
pip install -e .[dev]
pip install -e '.[dev]'
```

This will install the DRAM2 Visualization Library and all of its dependencies from the main branch of the GitHub repository, as well as the development dependencies.

We use [pre-commit](https://pre-commit.com) to manage our pre-commit hooks (e.g., linting, formatting that run commit to keep code formatting in check). To install the pre-commit hooks, run:

```bash
pre-commit install
```

now pre-commit will run automatically on git commit, but you can run it manually by running:

```bash
pre-commit run --all-files
```

### Usage

To generate a figure like the one shown above [TODO: insert figure], run the following command:
Expand All @@ -55,7 +71,7 @@ This should open your default web browser and display the dashboard. If the dash
### SSH Tunneling

If you are using the DRAM2 Visualization Library as a standalone Python package, you can run the dashboard on a remote server and use SSH tunneling to view the dashboard on your local machine. This will allow you to avoid downloading large data files to your local machine. To do this, first launch the dashboard on the remote server by ssh'ing into the server, navigating to the DRAM2 visualization directory, and running the above dashboard command. Then, on your local machine, run the following command:

```bash
ssh -NfL localhost:5006:localhost:5006 <username>@<remote-server>
```
Expand Down
10 changes: 10 additions & 0 deletions dram2_viz/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
try:
from dram2_viz._version import __version__

except ImportError:
# package not installed
__version__ = "0.0.0"


__authors__ = ["Madeline Scyphers", "Rory Flynn"]
__copyright__ = "Copyright 2024, Wrighton Lab"
1 change: 0 additions & 1 deletion dram2_viz/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from dram2_viz.make_product import main


if __name__ == "__main__":
main()
Loading

1 comment on commit e8ff3e6

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
dram2_viz
   make_product.py511276%113–116, 118, 123–124, 128–129, 131, 176, 185
dram2_viz/apps
   heatmap.py1634572%63, 66, 69, 75, 78, 111–116, 118–119, 123–124, 289, 309, 451–453, 455–456, 458, 460–461, 463–464, 507, 509–510, 512, 520, 526–532, 534, 540–543, 549
dram2_viz/processing
   process_annotations.py2301294%79, 371–377, 403–406
TOTAL4446984% 

Please sign in to comment.