Skip to content

Commit

Permalink
Merge pull request #82 from zktuong/devel
Browse files Browse the repository at this point in the history
Small changes
  • Loading branch information
zktuong committed Jun 17, 2021
2 parents 14e604f + 36ce116 commit 5fa84ac
Show file tree
Hide file tree
Showing 23 changed files with 988 additions and 423 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/tests.yml
Expand Up @@ -141,18 +141,22 @@ jobs:

- name: Test if R dependencies are installed properly
run: |
Rscript tests/r_dependencies.R
Rscript dandelion/tests/r_dependencies.R
shell: bash -l {0}

- name: Test with pytest
run: |
pytest --cov=./ --cov-report=xml -rP tests -W ignore::DeprecationWarning -W ignore::PendingDeprecationWarning -W ignore::FutureWarning
pytest --cov=./ --cov-report=xml -rP -W ignore::DeprecationWarning -W ignore::PendingDeprecationWarning -W ignore::FutureWarning
- name: Run coverage
run: |
coverage xml --omit="*site-packages*","*envs*" -o ./coverage_code.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
files: ./coverage.xml, ./coverage_code.xml
directory: ./coverage/reports/
flags: unittests
env_vars: OS,PYTHON
Expand Down
10 changes: 6 additions & 4 deletions .gitignore
Expand Up @@ -11,8 +11,10 @@
*sc_dandelion.egg-info
*.coverage
*.coverage*
*coverage.xml
*coverage_code.xml
dandelion/logging/version.py
tests/test_local.py
tests/reassigned_all/
tests/reassigned_filtered/
tests/test_local_tr.py
*/tests/test_local.py
*/tests/reassigned_all/
*/tests/reassigned_filtered/
*/tests/test_local_tr.py
2 changes: 1 addition & 1 deletion DESCRIPTION.md
Expand Up @@ -45,7 +45,7 @@ This can be used for the preprocessing steps by navigating to the data folder an
```bash
singularity run -B $PWD sc-dandelion_latest.sif dandelion-preprocess
```
Please refer to the [documentation](https://sc-dandelion.readthedocs.io/) for more information.
Please refer to the [documentation](https://sc-dandelion.readthedocs.io/en/master/notebooks/singularity_preprocessing.html) for more information.

For more fine control, as well as for the exploration steps, please install via following the instructions below.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -45,7 +45,7 @@ This can be used for the preprocessing steps by navigating to the data folder an
```bash
singularity run -B $PWD sc-dandelion_latest.sif dandelion-preprocess
```
Please refer to the [documentation](https://sc-dandelion.readthedocs.io/) for more information.
Please refer to the [documentation](https://sc-dandelion.readthedocs.io/en/master/notebooks/singularity_preprocessing.html) for more information.

For more fine control, as well as for the exploration steps, please install via following the instructions below.

Expand Down
2 changes: 1 addition & 1 deletion container/dandelion_preprocess.py
Expand Up @@ -34,7 +34,7 @@ def main():
# do we have metadata?
if args.meta is not None:
# if so, read it and use the index as the sample list
meta = pd.read_csv(args.meta, index_col=0, sep = None) # I'm sure Krzysztof wouldn't mind me making a little change here to make the dtype of the metafile guessable :P
meta = pd.read_csv(args.meta, index_col=0)
samples = list(meta.index)
else:
# no metadata file. create empty data frame so we can easily check for column presence
Expand Down
5 changes: 2 additions & 3 deletions container/sc-dandelion.def
Expand Up @@ -10,7 +10,7 @@ From: continuumio/miniconda3
dandelion_preprocess.py /share/dandelion_preprocess.py

%post
apt-get -y update && apt-get install -y curl r-base-core libcurl4-openssl-dev
apt-get -y update && apt-get install -y curl r-base-core libcurl4-openssl-dev rsync
R --slave -e 'install.packages("remotes", repos="https://cloud.r-project.org/")'
R --slave -e 'cat("apt-get update -y && apt-get install -y", paste(gsub("apt-get install -y ", "", remotes::system_requirements("ubuntu", "20.04", package = c("shazam","alakazam","tigger","airr","optparse","Biostrings","GenomicAlignments","IRanges","BiocManager","RCurl","XML"))), collapse = " "))'

Expand All @@ -30,8 +30,7 @@ From: continuumio/miniconda3
export BLASTDB=/share/database/blast/
export PATH=/share/ncbi-igblast-1.15.0/bin:$PATH
export PATH=/share/ncbi-blast-2.10.1+/bin:$PATH
export PATH=/share:$PATH
export NUMBA_CACHE_DIR=$PWD/dandelion_cache
export PATH=/share:$PATH

%runscript
alias dandelion-preprocess='dandelion_preprocess.py'
Expand Down
3 changes: 2 additions & 1 deletion dandelion/__init__.py
Expand Up @@ -2,7 +2,7 @@
# @Author: kt16
# @Date: 2020-05-12 18:11:20
# @Last Modified by: Kelvin
# @Last Modified time: 2021-05-20 15:03:42
# @Last Modified time: 2021-06-17 15:53:45

from . import preprocessing as pp
from . import utilities as utl
Expand All @@ -11,3 +11,4 @@
from .utilities import read_pkl, read_h5, read_10x_airr, read_10x_vdj, from_scirpy, to_scirpy, Dandelion, update_metadata, concat, load_data
from .logging import __version__, __author__, __email__, __url__, __docs__, __classifiers__
from . import logging
from . import tests
2 changes: 2 additions & 0 deletions dandelion/tests/__init__.py
@@ -0,0 +1,2 @@

from .fixtures import *
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/test_airr.py → dandelion/tests/test_airr.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
import dandelion as ddl

from fixtures import airr_10x, create_testfolder
from dandelion.tests.fixtures import airr_10x, create_testfolder


def test_write_airr(create_testfolder, airr_10x):
Expand Down
11 changes: 11 additions & 0 deletions dandelion/tests/test_importr.py
@@ -0,0 +1,11 @@
#!/usr/bin/env python


def test_importrpy2():

from rpy2.robjects.packages import importr
from rpy2.rinterface import NULL
from rpy2.robjects import pandas2ri
sh = importr('shazam')

assert sh.__module__ == 'rpy2.robjects.packages'
Expand Up @@ -4,8 +4,8 @@
import dandelion as ddl
from pathlib import Path

from fixtures import (fasta_10x, annotation_10x, create_testfolder,
database_paths, dummy_adata, processed_files)
from dandelion.tests.fixtures import (fasta_10x, annotation_10x, create_testfolder,
database_paths, dummy_adata, processed_files)


@pytest.mark.parametrize("filename,expected",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_tools.py → dandelion/tests/test_tools.py
Expand Up @@ -4,7 +4,7 @@
import dandelion as ddl
from pathlib import Path

from fixtures import (airr_reannotated, dummy_adata, create_testfolder)
from dandelion.tests.fixtures import (airr_reannotated, dummy_adata, create_testfolder)


def test_setup(create_testfolder, airr_reannotated, dummy_adata):
Expand Down
Expand Up @@ -4,9 +4,9 @@
import dandelion as ddl
from pathlib import Path

from fixtures import (fasta_10x_tr1, fasta_10x_tr2, annotation_10x_tr1,
processed_files_tr, annotation_10x_tr2,
create_testfolder, database_paths, dummy_adata_tr)
from dandelion.tests.fixtures import (fasta_10x_tr1, fasta_10x_tr2, annotation_10x_tr1,
processed_files_tr, annotation_10x_tr2,
create_testfolder, database_paths, dummy_adata_tr)


def test_write_fasta_tr1(create_testfolder, fasta_10x_tr1):
Expand Down

0 comments on commit 5fa84ac

Please sign in to comment.