Skip to content

Commit

Permalink
Merge branch 'crichgriffin-pip-_install' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
crichgriffin committed Mar 9, 2023
2 parents 49f7393 + 4dbd792 commit 2add0e6
Show file tree
Hide file tree
Showing 96 changed files with 112 additions and 234 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
dist/panpipes-0.2.0-py3-none-any.whl
dist/panpipes-0.2.0.tar.gz
panpipes.egg-info/PKG-INFO
panpipes.egg-info/requires.txt
panpipes/__pycache__
panpipes.egg-info
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added panpipes/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file added panpipes/__pycache__/entry.cpython-39.pyc
Binary file not shown.
57 changes: 3 additions & 54 deletions panpipes/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,83 +18,32 @@
import os
import sys
import re
import glob
import imp
import panpipes


def printListInColumns(l, ncolumns):
'''output list *l* in *ncolumns*.'''
ll = len(l)

if ll == 0:
return

max_width = max([len(x) for x in l]) + 3
n = ll // ncolumns
if ll % ncolumns != 0:
n += 1

# build columns
columns = [l[x * n:x * n + n] for x in range(ncolumns)]

# add empty fields for missing columns in last row
for x in range(ncolumns - (len(l) % ncolumns)):
columns[-(x + 1)].append('')

# convert to rows
rows = list(zip(*columns))

# build pattern for a row
p = '%-' + str(max_width) + 's'
pattern = ' '.join([p for x in range(ncolumns)])

# put it all together
return '\n'.join([pattern % row for row in rows])

# l = ['a', 'b', 'c', 'd']
# ncolumns = 2
# printListInColumns(l, ncolumns)

def main(argv=None):

argv = sys.argv

# paths to look for pipelines:
#print(pipelines.__file__)
path = os.path.abspath(os.path.dirname(panpipes.__file__))
relpath = os.path.abspath("../")

path = os.path.abspath(os.path.join(os.path.dirname(panpipes.__file__), "panpipes"))
relpath = os.path.abspath("./")
paths = [path, relpath]

if len(argv) == 1 or argv[1] == "--help" or argv[1] == "-h":
pipelines = []
for path in paths:
pipelines.extend(glob.glob(os.path.join(path, "pipeline_*.py")))
print((globals()["__doc__"]))
print("The list of available workflows are:\n")
# pipelines_list = sorted([os.path.basename(x)[len("pipeline_"):-len(".py")] for x in pipelines])
pipelines_list = ['1. "qc_mm" : for the ingestion of data and computation of QC metrics' ,
'2. "preprocess" : for filtering and normalising of each modality',
'3. "integration" : integrate and batch correction using single and multimodal methods',
'4. "clustering" : cell clustering on single modalities',
'5. "refmap" : transfer scvi-tools models from published data to your data',
'6. "vis" : visualise metrics from other pipelines in context of experiment metadata']
print("{}\n".format(
printListInColumns(pipelines_list,1)))
print(*pipelines_list, sep="\n")
return

command = argv[1]
command = re.sub("-", "_", command)
pipeline = "pipeline_{}".format(command)

# remove 'cellhub' from sys.argv
del sys.argv[0]

(file, pathname, description) = imp.find_module(pipeline, paths)

module = imp.load_module(pipeline, file, pathname, description)

module.main(sys.argv)


Expand Down
Binary file added panpipes/funcs/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file added panpipes/funcs/__pycache__/io.cpython-39.pyc
Binary file not shown.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
"../pipeline.yml",
"pipeline.yml"])

PARAMS['py_path'] = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'python')
PARAMS['r_path'] = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'R')
PARAMS['py_path'] = os.path.join(os.path.dirname(__file__), 'python_scripts')
PARAMS['r_path'] = os.path.join(os.path.dirname(__file__), 'R_scripts')
PARAMS['mudata_with_knn'] = 'mudata_w_neighbors.h5mu'

job_kwargs={}
if PARAMS['condaenv'] is not None:
job_kwargs["job_condaenv"] =PARAMS['condaenv']
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"pipeline.yml"])


PARAMS['py_path'] = os.path.join(os.path.dirname(os.path.dirname(__file__)), "python")
PARAMS['R_path'] = os.path.join(os.path.dirname(os.path.dirname(__file__)), "R")
PARAMS['resources_path'] = os.path.join(os.path.dirname(os.path.dirname(__file__)), "resources")
PARAMS['py_path'] = os.path.join(os.path.dirname(__file__), 'python_scripts')
PARAMS['r_path'] = os.path.join(os.path.dirname(__file__), 'R_scripts')
PARAMS['resources_path'] = os.path.join(os.path.dirname(__file__), "resources")

sprefix = PARAMS['sample_prefix']

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
"pipeline.yml"])


PARAMS['py_path'] = os.path.join(os.path.dirname(os.path.dirname(__file__)), "python")
PARAMS['R_path'] = os.path.join(os.path.dirname(os.path.dirname(__file__)), "R")
PARAMS['resources_path'] = os.path.join(os.path.dirname(os.path.dirname(__file__)), "resources")
PARAMS['py_path'] = os.path.join(os.path.dirname(__file__), 'python_scripts')
PARAMS['r_path'] = os.path.join(os.path.dirname(__file__), 'R_scripts')
PARAMS['resources_path'] = os.path.join(os.path.dirname(__file__), "resources")

if PARAMS['sample_prefix'] is not None:
PARAMS['filt_file'] = PARAMS['sample_prefix'] + "_filt.h5mu"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
"../pipeline.yml",
"pipeline.yml"])

PARAMS['py_path'] = os.path.join(os.path.dirname(os.path.dirname(__file__)), "python")
PARAMS['R_path'] = os.path.join(os.path.dirname(os.path.dirname(__file__)), "R")
PARAMS['resources_path'] = os.path.join(os.path.dirname(os.path.dirname(__file__)), "resources")

PARAMS['py_path'] = os.path.join(os.path.dirname(__file__), 'python_scripts')
PARAMS['r_path'] = os.path.join(os.path.dirname(__file__), 'R_scripts')
PARAMS['resources_path'] = os.path.join(os.path.dirname(__file__), "resources")
job_kwargs = {}

if PARAMS['condaenv'] is not None:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@
job_kwargs["job_condaenv"] =PARAMS['condaenv']



PARAMS['py_path'] = os.path.join(os.path.dirname(os.path.dirname(__file__)), "python")
PARAMS['R_path'] = os.path.join(os.path.dirname(os.path.dirname(__file__)), "R")
PARAMS['resources_path'] = os.path.join(os.path.dirname(os.path.dirname(__file__)), "resources")
PARAMS['py_path'] = os.path.join(os.path.dirname(__file__), 'python_scripts')
PARAMS['r_path'] = os.path.join(os.path.dirname(__file__), 'R_scripts')
PARAMS['resources_path'] = os.path.join(os.path.dirname(__file__), "resources")



Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"../pipeline.yml",
"pipeline.yml"])

PARAMS['py_path'] = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'python')
PARAMS['r_path'] = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'R')
PARAMS['py_path'] = os.path.join(os.path.dirname(__file__), 'python_scripts')
PARAMS['r_path'] = os.path.join(os.path.dirname(__file__), 'R_scripts')

job_kwargs = {}

Expand Down
File renamed without changes.
7 changes: 0 additions & 7 deletions panpipes/pipeline_clustering/notes_clustering_scanpy.md

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file added panpipes/resources/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
89 changes: 88 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,90 @@

[project]
name = "panpipes"
version = "0.2.0"
authors = [
{name = "Charlotte Rich-Griffin"},
{name = "Fabiola Curion"}
]
description = "Panpipes - multimodal single cell pipelines"
readme = "README.md"

classifiers = [
# Pick your license as you wish
"License :: OSI Approved :: BSD License",

# Optional
# How mature is this project? Common values are
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
"Development Status :: 3 - Alpha",

# Indicate who your project is intended for
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3",
"Programming Language :: R"
]

requires-python = ">= 3.8"

dependencies = [
"anndata>=0.8.0",
"apsw",
"bbknn",
"cgatcore",
"drmaa",
"gevent",
"harmonypy",
"leidenalg",
"louvain",
"matplotlib",
"mofapy2",
"mudata @ git+https://github.com/scverse/mudata",
"muon @ git+https://github.com/scverse/muon",
"numpy>=1.22.4",
"packaging",
"pandas>=1.0",
"paramiko",
"pep8",
"pysam",
"pytest",
"pyyaml",
"ruffus",
"scanorama",
"scanpy>=1.9.1",
"seaborn",
"scikit-misc",
"scirpy @ git+https://github.com/scverse/scirpy",
"scrublet",
"scvi-tools>=0.16.3",
"sqlalchemy"
]

[project.optional-dependencies]
notebook = [
"jupyter",
"jupyterlab"
]

# The following would provide a command line executable called `sample`
# which executes the function `entry` from this package when invoked.
[project.scripts] # Optional
panpipes = "panpipes:entry.main"

# This is configuration specific to the `setuptools` build backend.
# If you are using a different build backend, you will need to change this.
[tool.setuptools]
# If there are data files included in your packages that need to be
# installed, specify them here.
package-data = {"panpipes" = ["panpipes/*/*.yml", "R_scripts/*.R"]}


[build-system]
requires = ["setuptools ~= 58.0", "wheel"]
# These are the assumed default build requirements from pip:
# https://pip.pypa.io/en/stable/reference/pip/#pep-517-and-518-support
requires = ["setuptools>=43.0.0", "wheel"]
build-backend = "setuptools.build_meta"


#template for this file from https://github.com/pypa/sampleproject/blob/main/pyproject.toml
65 changes: 0 additions & 65 deletions setup.cfg

This file was deleted.

6 changes: 0 additions & 6 deletions setup.py

This file was deleted.

Loading

0 comments on commit 2add0e6

Please sign in to comment.