Skip to content

Commit

Permalink
update installation files
Browse files Browse the repository at this point in the history
  • Loading branch information
fcomitani committed Aug 21, 2022
1 parent 3da29c6 commit 0f61782
Show file tree
Hide file tree
Showing 25 changed files with 64 additions and 39 deletions.
14 changes: 14 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2

conda:
environment: environment.yml

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# Optionally declare the Python requirements required to build your docs
python:
version: "3.7"
install:
- requirements: docs/requirements.txt
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 fcomitani, bhadbhubbie
Copyright (c) 2021-2022 fcomitani, bhadbhubbie

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[![Build Status](https://img.shields.io/travis/com/fcomitani/tapir/main?style=flat-square)](https://travis-ci.com/fcomitani/tapir)
-->

tapir (`tapyra` in Tupi) is a python 3 package for the analysis of gene expression data.
`tapir` is a python 3 package for the analysis of gene expression data.
It includes a number of functions for statistical analysis, differential expression
and gene sets enrichment analysis.

Expand Down Expand Up @@ -49,7 +49,7 @@ Besides basic scientific and plotting libraries, the current version requires
### Installation

<!--- tapir releases can be easily installed through the python standard package manager
`pip install tapyra`.
`pip install tapir`.
--->

To install the latest (unreleased) version you can download it from this repository by running
Expand All @@ -64,7 +64,7 @@ Given an `input` dataset in pandas-like format (samples X genes), the `build_dge
the samples as TMM and fit a glmQL model for differential expression
significance.

from tapyra.edger import build_dgelist, diff_exp
from tapir.edger import build_dgelist, diff_exp

dgelist, tmmlog = build_dgelist(input_table)
de = diff_exp(dgelist, groups, filter=True)
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
#
import os
import sys
sys.path.insert(0, os.path.abspath('../tapyra'))
sys.path.insert(0, os.path.abspath('../tapir'))

# -- Project information -----------------------------------------------------

project = 'tapir'
copyright = '2021, Federico Comitani, Josh Oren Nash'
copyright = '2021-2022, Federico Comitani, Josh Oren Nash'
author = 'Federico Comitani, Josh Oren Nash'

# The full version, including alpha/beta/rc tags
Expand Down
2 changes: 1 addition & 1 deletion docs/de.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ equivalent to the flags in :code:`EdgeR.filterByExpr`.

.. code-block:: python
from tapyra.edger import build_dgelist, diff_exp
from tapir.edger import build_dgelist, diff_exp
dgelist, tmmlog = build_dgelist(input_table)
de = diff_exp(dgelist, groups, filter=True)
Expand Down
4 changes: 2 additions & 2 deletions docs/gsets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ the :code:`type`.

.. code-block:: python
from tapyra.gsets import run_gsea
from tapir.gsets import run_gsea
gsmat = run_gsea(data, subsel=None, type='ssgsea', tmp_path=r'./tmp_gsea')
Expand Down Expand Up @@ -39,7 +39,7 @@ a certain percentage relative to the highest connection value observed.

.. code-block:: python
from tapyra.plotting import plot_genes_network
from tapir.plotting import plot_genes_network
plot_genes_network(gset, subsel, exp=None, cutoff=.1, save_file='./net.png')
Expand Down
6 changes: 3 additions & 3 deletions docs/immune.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ an expression matrix :code:`tmm` with samples as rows and genes as columns.

.. code-block:: python
from tapyra.immune import mcpc_estimate
from tapir.immune import mcpc_estimate
estimates = mcpc_estimate(tmm)
For details on the deconvolution process, please see the MCPcounter
publication [Becth2016]_.
publication [Becht2016]_.

References
----------

.. [Becht2016] Becht E., Giraldo N. A., Lacroix L., Buttard B., Elarouci N., Petitprez F., Selves J., Laurent-Puig P., Sautès-Fridman C., Fridman W. H. and de Reyniès A., (2016). “Estimating the population abundance of tissue-infiltrating immune and stromal cell populations using gene expression”, Genome Biol. 20; 17(1) 218.
.. [Becht2016] Becht E., Giraldo N. A., Lacroix L., Buttard B., Elarouci N., Petitprez F., Selves J., Laurent-Puig P., Sautès-Fridman C., Fridman W. H. and de Reyniès A., (2016). “Estimating the population abundance of tissue-infiltrating immune and stromal cell populations using gene expression”, Genome Biol. 20; 17(1) 218.
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Welcome to tapir's documentation!
===================================

Transcriptome Analysis in Python Imported from R (tapir) is a python 3 package for the statistical analysis of expression data.
Transcriptome Analysis in Python Imported from R (`tapir`) is a python 3 package for the statistical analysis of expression data.
It includes a number of analysis and plotting utilities, which include differential expression functions imported from EdgeR and
gene sets enrichment analysis.

Expand Down
16 changes: 8 additions & 8 deletions docs/stats.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ for the multiple testing correction.

.. code-block:: python
from tapyra.stats import multicompare
from tapir.stats import multicompare
stats, dunn = multicompare(groups, membership, data,
cutoff=1, multi_method='fdr_tsbh', multi_alpha=0.05)
Expand All @@ -37,7 +37,7 @@ Contingency tables can be built and related tests can be run with TAPIR.

.. code-block:: python
form tapyra.stats import get_contingency, test_contingency
form tapir.stats import get_contingency, test_contingency
contab = get_contingency(series, groups, membership)
stats = test_contingency(contab, method='auto')
Expand Down Expand Up @@ -69,8 +69,8 @@ a one-hot-encoded matrix with groups :code:`membership`.

.. code-block:: python
from tapyra.stats import st_curves
from tapyra.plotting import plot_survival
from tapir.stats import st_curves
from tapir.plotting import plot_survival
stats, curves = st_curves(st_stats, groups, membership)
plot_survival(curves, xlab='Years', ylab='OST', save_file='./plot.png')
Expand Down Expand Up @@ -100,8 +100,8 @@ by providing the appropriate UMAP object keywords.

.. code-block:: python
from tapyra.embedding import get_umap
from tapyra.plotting import plot_clusters
from tapir.embedding import get_umap
from tapir.plotting import plot_clusters
proj, mappa = get_umap(data, collinear_thresh=None, var_drop_thresh=.99)
proj.index = data.index
Expand All @@ -128,7 +128,7 @@ This function allows to plot on one (:code:`genes_up`) or two levels

.. code-block:: python
from tapyra.plotting import plot_distribution
from tapir.plotting import plot_distribution
plot_distribution(data, groups, membership,
genes_up, genes_dw,
Expand All @@ -142,7 +142,7 @@ with :code:`plot_heatmap`

.. code-block:: python
from tapyra.plotting import plot_heatmap
from tapir.plotting import plot_heatmap
plot_heatmap(data, groups, membership, genes,
clab='log$_2$(TPM+1)',
Expand Down
13 changes: 13 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
channels:
- conda-forge
dependencies:
- python=3.7.6
- numpy>=1.20.2
- pandas>=1.1.3
- gseapy>=0.9.5
- lifelines>=0.21.0
- rpy2>=3.4.5
- seaborn>=0.11.1
- scikit-learn>=0.4.6
- statsmodels>=0.11.1
- umap-learn>=0.3.9
17 changes: 7 additions & 10 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
#general
numpy>=1.20.2
pandas>=1.1.3
scikit-learn>=0.22.2.post1
scikit-network>=0.20.0
umap-learn>=0.4.5
psutil>=5.7.3
anytree>=2.8.0

#plotting
matplotlib>=3.3.3
seaborn>=0.11.0
gseapy>=0.9.5
lifelines >= 0.21.0
rpy2 >= 3.4.5
seaborn >= 0.11.1
scikit-learn >= 0.4.6
statsmodels >= 0.11.1
umap-learn >= 0.3.9

#documentation
sphinx==3.5.4
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
from os import path

here = path.abspath(path.dirname(__file__))
version = open("tapyra/_version.py").readlines()[-1].split()[-1].strip("\"'")
version = open("tapir/_version.py").readlines()[-1].split()[-1].strip("\"'")

with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()


setup(

name='tapyra',
name='tapir',

version=version,

Expand All @@ -32,6 +32,7 @@
'License :: OSI Approved :: MIT License',
'Programming Language :: Python'
'Programming Language :: Python :: 3.7'
'Programming Language :: Python :: 3.8'
],

keywords='clustering recursion dimension-reduction k-NN hiearchical-clustering optimal-clusters differential-evolution',
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tapyra/__init__.py → tapir/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
J. O. Nash @2021
"""

from tapyra._version import __version__
from tapir._version import __version__

if __name__ == "__main__":

Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tapyra/edger.py → tapir/edger.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def build_dgelist(tab):
""" Builds a DGE list and normalizes counts as TMM.
Args:
tab (pandas dataframe): expression counts matrix with samples as row and
tab (pandas dataframe): expression counts matrix with samples as rows and
genes as columns.
Returns:
dgelist (edgeR DGElist): a composite dataframe with samples and expression
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tapyra/gsets.py → tapir/gsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import pandas as pd
import gseapy as gp

from tapyra.auxiliary import invert_dict
from tapir.auxiliary import invert_dict

ref_path = os.path.join(os.path.dirname(__file__),'ref/')

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions tapyra/plotting.py → tapir/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
from matplotlib.colors import LinearSegmentedColormap
import seaborn as sns

from tapyra.gsets import gset_as_dict, connection_matrix_gsets
from tapyra.embedding import get_umap
from tapir.gsets import gset_as_dict, connection_matrix_gsets
from tapir.embedding import get_umap

sns.set_style("darkgrid")

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tapyra/stats.py → tapir/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from lifelines import KaplanMeierFitter
from lifelines.statistics import multivariate_logrank_test as mlt

from tapyra.auxiliary import smart_selection
from tapir.auxiliary import smart_selection

def compare(gene, classes):

Expand Down

0 comments on commit 0f61782

Please sign in to comment.