Commit 95fd3d35 authored by andrewmoorman's avatar andrewmoorman
Browse files

Added plot utilities and label mapping code

parent c04ddb6e
Loading
Loading
Loading
Loading

.gitignore

0 → 100644
+167 −0
Original line number Diff line number Diff line
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
#  Usually these files are written by a python script from a template
#  before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
#   For a library or package, you might want to ignore these files since the code is
#   intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
#   According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
#   However, in case of collaboration, if having platform-specific dependencies or dependencies
#   having no cross-platform support, pipenv may install dependencies that don't work, or not
#   install all needed dependencies.
#Pipfile.lock

# poetry
#   Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
#   This is especially recommended for binary packages to ensure reproducibility, and is more
#   commonly ignored for libraries.
#   https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
#   Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
#   pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
#   in version control.
#   https://pdm.fming.dev/latest/usage/project/#working-with-version-control
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
#  JetBrains specific template is maintained in a separate JetBrains.gitignore that can
#  be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
#  and can be added to the global gitignore or merged into this file.  For a more nuclear
#  option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

data*
media*
notebooks/check_anndatas.ipynb
notebooks/reviewer_response_2.ipynb
 No newline at end of file
+405 −0

File added.

Preview size limit exceeded, changes collapsed.

+32 −0
Original line number Diff line number Diff line
'''
This file contains standardized imports and variables used throughout the 
analysis notebooks for "Progressive Plasticity in Colorectal Cancer Metastasis"
by Moorman et al (DOI: )
'''
# Packages used throughout
import scanpy as sc
import anndata
import numpy as np
import scipy as sp
import pandas as pd
from matplotlib import pyplot as plt
import os
import sys
import json
import tqdm

# Local modules used throughout
module_path = os.path.abspath('../src')
if module_path not in sys.path:
    sys.path.append(module_path)

# Standard variables referenced throughout
data_dir = f"{os.getcwd()}/../data"
media_dir = f"{os.getcwd()}/../media"

# Plotting styles used throughout
module_path = os.path.abspath('../src')
stylesheet = f'{module_path}/utils/pl/assets/default.mplstyle'
plt.style.use(stylesheet)
with open(f'{module_path}/utils/pl/assets/named_colors.json', 'r') as f:
    named_colors = json.load(f)
 No newline at end of file

pyproject.toml

0 → 100644
+28 −0
Original line number Diff line number Diff line
[build-system]
requires = ["setuptools>=58.0.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "my_project"
version = "1.0.0"
description = "My project description"
authors = ["Andrew Moorman <moormana@mskcc.org>"]
license = "MIT"

keywords = []
classifiers = []

requires-python = ">=3.8"
dependencies = [
    "scanpy",
    "matplotlib",
    "pandas",
    "numpy",
    "seaborn",
    "openpyxl",
    "scipy",
    "scikit-misc",
    "PhenoGraph",
    "magic-impute",
    "python-ternary",
]
+23 −0
Original line number Diff line number Diff line
figure.dpi : 300
font.family : "Arial"
mathtext.default : "default"
xtick.labelsize : 7
ytick.labelsize : 7
axes.labelsize : 9
axes.titlesize : 9
axes.facecolor : "white"
xtick.direction : "out"
ytick.direction : "out"
image.cmap : "viridis"
lines.linewidth : 0.75
axes.spines.right : False
axes.spines.top : False
legend.borderaxespad : 0.25
legend.borderpad : 0.25
legend.fontsize : 7
legend.title_fontsize : 7
legend.handleheight : 0.5
legend.handlelength : 1.0
legend.markerscale : 0.5
patch.linewidth : 0.75
axes.prop_cycle : cycler("color", ["#F04437", "#E81F64", "#903E97", "#65499E", "#4356A5", "#478FCC", "#34A4DD", "#00BCD4", "#009889", "#4BB04F", "#8BC34C", "#CCDA3A", "#FCED3A", "#FFC10E", "#F8991D", "#F1592C", "#7A5649", "#9F9E9E", "#607F8C",])
 No newline at end of file
Loading
Baidu
map