Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version 2.1.1 -- add ci and cDNA fasta bug fix #203

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: run-test

on:
push:
branches: [dev, master]
pull_request:
branches: [dev, master]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]

steps:
- uses: actions/checkout@v3
- name: Setup Python # Set Python version
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# Install pip and pytest
- name: Install dependencies
run: |
pip install .
- name: Install xpore-package
run: |
#python -m pip install --upgrade pip
pip install pytest pytest-dependency
- name: Test with pytest
run: pytest --junitxml=junit/test-results-${{ matrix.python-version }}.xml
- name: Upload pytest test results
uses: actions/upload-artifact@v3
with:
name: pytest-results-${{ matrix.python-version }}
path: junit/test-results-${{ matrix.python-version }}.xml
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![alt text](https://github.com/GoekeLab/xpore/blob/master/figures/xpore_textlogo.png "xPore")
![alt text](./docs/xpore_textlogo.png "xPore")



Expand Down
File renamed without changes
50 changes: 50 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[build-system]
requires = ["setuptools>=42"]
build-backend = "setuptools.build_meta"


[project]
name = "xpore"
authors = [{name = "Ploy N. Pratanwanich", email= "naruemon.p@chula.ac.th"}]
maintainers = [
{name = "Ploy N. Pratanwanich", email= "naruemon.p@chula.ac.th"},
{name = "Leon Rauschning"},
]
requires-python = ">=3.8"
description="xpore is a python package for Nanopore data analysis of differential RNA modifications."
dependencies = [
"numpy>=2.0.0",
"pandas>=2.0.0",
"scipy>=1.10.1",
"PyYAML",
"h5py>=3.0.0",
"pyensembl>=2.2.0",
"ujson>=4.0.1"
]
readme = "README.md"
license = {text = "MIT"}
classifiers = [
# Trove classifiers
# (https://pypi.python.org/pypi?%3Aaction=list_classifiers)
"Development Status :: 1 - Planning",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3.8",
"Topic :: Software Development :: Libraries",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Intended Audience :: Science/Research",
]
dynamic = ["version"]

[project.urls]
homepage = "https://github.com/GoekeLab/xpore"

[project.scripts]
xpore = "xpore.scripts.xpore:main"

[tool.setuptools]
include-package-data = true # set explicitly in case it changes in the future

[tool.setuptools.dynamic]
version = {attr = "xpore.__version__"}

45 changes: 0 additions & 45 deletions setup.py

This file was deleted.

2 changes: 1 addition & 1 deletion xpore/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.1"
__version__ = "2.1.1"
2 changes: 1 addition & 1 deletion xpore/diffmod/configurator.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
def get_condition_run_name(condition_name,run_name):
return '-'.join([condition_name,run_name])

class Configurator(object):
class Configurator:
def __init__(self, config_filepath):
self.filepath = os.path.abspath(config_filepath)
self.filename = self.filepath.split('/')[-1]
Expand Down
13 changes: 7 additions & 6 deletions xpore/diffmod/gmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import scipy.stats


class GMM(object):
class GMM:
"""
1D multi-sample 2-Gaussian mixture model.
"""
Expand Down Expand Up @@ -121,6 +121,7 @@ def fit(self):
if (diff < self.method['stopping_criteria']):
converged = True
break

self.info['n_iterations'] = iteration
self.info['converged'] = converged
self.info['convergence_ratio'] = diff
Expand All @@ -131,7 +132,7 @@ def fit(self):
################################


class Constant(object):
class Constant:
"""
Constant node.
"""
Expand All @@ -140,7 +141,7 @@ def __init__(self, data=None, inits=None):
self.data = data


class UnivariateNormalMixture(object):
class UnivariateNormalMixture:
def __init__(self, parents=None, data=None, inits=None):

self.parents = parents
Expand Down Expand Up @@ -189,7 +190,7 @@ def _update(self):
self.params['variance'] = N_inverse * np.sum(self.parents['z'].expected()*(residuals**2), axis=-2) # sum across reads => K


class Bernoulli(object):
class Bernoulli:
def __init__(self, dim, parents=None, data=None, inits=None):
self.params = dict()
self.params['prob'] = np.full(dim, np.nan)
Expand Down Expand Up @@ -244,7 +245,7 @@ def _update(self, children):



class Dirichlet(object):
class Dirichlet:
def __init__(self, dim, parents=None, data=None, inits=None, priors=None): # dim - [,n_categories]

self.priors = dict()
Expand Down Expand Up @@ -297,7 +298,7 @@ def __log_C(alpha):
return scipy.special.gammaln(np.sum(alpha, axis=-1)) - np.sum(scipy.special.gammaln(alpha), axis=-1)


class UnivariateNormalGamma(object):
class UnivariateNormalGamma:
def __init__(self, dim, parents=None, data=None, inits=None, priors=None):

self.priors = dict.fromkeys(['location', 'lambda', 'alpha', 'beta'], np.full(dim, np.nan)) # alpha = shape, beta=rate
Expand Down
2 changes: 1 addition & 1 deletion xpore/diffmod/statstest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import scipy.stats
import numpy as np

class StatsTest(object):
class StatsTest:
def __init__(self,data):
if self.__isok(data):
self.data = [data['y'][data['x'][:,0]==1],data['y'][data['x'][:,1]==1]]
Expand Down
Loading
Loading