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

Repackage xpore & add Yuk Kei's CI #231

Merged
merged 13 commits into from
Nov 7, 2024
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8"]
python-version: ["3.11"]

steps:
- uses: actions/checkout@v3
Expand All @@ -28,7 +28,7 @@ jobs:
pip install .
- name: Install xpore-package
run: |
python -m pip install --upgrade pip
#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
Expand Down
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= "[email protected]"}]
maintainers = [
{name = "Ploy N. Pratanwanich", email= "[email protected]"},
{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/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