diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a30dc58..49e3b78 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,7 +2,7 @@ name: Build and Test on: push: - branches: [main, master, develop] + branches: [main, master] pull_request: branches: [main, master] @@ -14,7 +14,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest] - python-version: ["3.9", "3.10", "3.11", "3.12"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13","3.14"] steps: - uses: actions/checkout@v4 @@ -50,7 +50,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-13, macos-14] # macos-13=x86, macos-14=arm64 + os: [ubuntu-latest, macos-15-intel, macos-14] # macos-15-intel=x86, macos-14=arm64 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8ad5979..1170dae 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,7 +10,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-13, macos-14] + os: [ubuntu-latest, macos-15-intel, macos-14] steps: - uses: actions/checkout@v4 @@ -48,7 +48,9 @@ jobs: name: Publish to PyPI needs: [build-wheels, build-sdist] runs-on: ubuntu-latest - environment: pypi + environment: + name: pypi + url: https://pypi.org/project/smudgeplot permissions: id-token: write # Required for trusted publishing diff --git a/Makefile b/Makefile index bb4da2b..4834060 100644 --- a/Makefile +++ b/Makefile @@ -8,11 +8,14 @@ endif HET_KMERS_INST = $(INSTALL_PREFIX)/bin/hetmers $(INSTALL_PREFIX)/bin/extract_kmer_pairs .PHONY : default -default: exec/hetmers exec/extract_kmer_pairs +default: exec/ exec/hetmers exec/extract_kmer_pairs .PHONY : install install : $(HET_KMERS_INST) +exec/: + mkdir -p exec + $(INSTALL_PREFIX)/bin/% : exec/% install -C $< $(INSTALL_PREFIX)/bin diff --git a/README.md b/README.md index 10bd1d0..c82d04a 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,12 @@ # Smudgeplot -**_Version: 0.5.1 Skylight_** +**_Version: 0.5.3 Skylight_** **_Authors: Sam Ebdon, [Gene W Myers](https://github.com/thegenemyers) and [Kamil S. Jaron](https://github.com/KamilSJaron), Tianyi Ma._** -We keep the same pythonic interface; the interface of this and previous versions are very similar and largely compatible. - -Current state: RUNNING; beta-testing; - ## Installation -This version of smudgeplot operates on FastK k-mer databases. The smudgeplot installation consists of a python package and C-backend to search for all the k-mer pairs (hetmers) and extract sequences of k-mer pairs (extract_kmer_pairs). +This version of smudgeplot operates on FastK k-mer databases. The smudgeplot installation consists of a python package and C-backend to search for all the k-mer pairs (smudgeplot hetmers) and extract sequences of k-mer pairs (smudgeplot extract). We recommend installing smudgeplot within a [conda](https://conda-forge.org/download/) environment. @@ -19,7 +15,10 @@ We recommend installing smudgeplot within a [conda](https://conda-forge.org/down conda create -n smudgeplot && conda activate smudgeplot conda install pip -#download and install +# install via pypi +pip install smudgeplot + +# or download and install directly. See below if you need to compile the C dependencies. git clone https://github.com/KamilSJaron/smudgeplot.git cd smudgeplot && pip install . smudgeplot -h # check installation succeeded @@ -31,7 +30,7 @@ Note the smudgeplot version downloadable from conda itself is not currently up t ### Compiling the C code -The process above install everything including compilation of the C backend. If you would like to know how to compile the code yourself you can simply run +The process above should install everything including compilation of the C backend. If you need or would like to know how to compile the code yourself you can simply run ``` make @@ -39,6 +38,14 @@ make This will not, however, install the smudgeplot python package. +### Pypi installation [EXPERIMENTAL] + +We are working on packaging smudgeplot for pypi. You are welcome to try installing from pypi if you are interested and please open an issue if you have problems. If it fails please follow the main instructions above to install for now. + +``` +pip install smudgeplot +``` + ## Example run on Saccharomyces data Requires ~2.1GB of space and `FastK` and `smudgeplot` installed. diff --git a/pyproject.toml b/pyproject.toml index 7220e30..ade4459 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "smudgeplot" -version = "0.5.1" +version = "0.5.3" description = "Inference of ploidy and heterozygosity structure using whole genome sequencing data" readme = "README.md" license = "Apache-2.0" @@ -38,6 +38,8 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Operating System :: POSIX :: Linux", "Operating System :: MacOS", "Intended Audience :: Science/Research", @@ -67,6 +69,7 @@ smudgeplot = ["bin/*"] # Skip 32-bit, PyPy, musllinux, and Windows (no Windows support for now) skip = ["*-win32", "*-win_amd64", "*-manylinux_i686", "pp*", "*-musllinux*"] build = ["cp39-*", "cp310-*", "cp311-*", "cp312-*"] +environment = { MACOSX_DEPLOYMENT_TARGET = "11.0" } # Test that the CLI works after building test-command = "smudgeplot --version" diff --git a/setup.py b/setup.py index add6518..de1df16 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ from setuptools import setup from setuptools.command.build_py import build_py from setuptools.command.develop import develop - +from setuptools.dist import Distribution class CompilationError(Exception): """Raised when C binary compilation fails.""" @@ -132,10 +132,14 @@ def run(self): print("Continuing with editable install, but binaries will not work.", file=sys.stderr) super().run() +class BinaryDistribution(Distribution): + def has_ext_modules(self): + return True setup( cmdclass={ "build_py": BuildPyWithBinaries, "develop": DevelopWithBinaries, - } + }, + distclass=BinaryDistribution ) diff --git a/src/smudgeplot/cli.py b/src/smudgeplot/cli.py index 086e851..8eebf1b 100755 --- a/src/smudgeplot/cli.py +++ b/src/smudgeplot/cli.py @@ -78,7 +78,7 @@ def __init__(self): tasks: cutoff Calculate meaningful values for lower kmer histogram cutoff. hetmers Calculate unique kmer pairs from a FastK k-mer database. peak_aggregation Agregates smudges using local aggregation algorithm; prints assignments to stdout. - plot Generate 2d histogram; infere ploidy and plot a smudgeplot. + plot Generate 2d histogram; infer ploidy and plot a smudgeplot. all Runs all the steps (with default options) extract Extract kmer pair sequences from a FastK k-mer database. """ @@ -301,7 +301,7 @@ def add_plotting_arguments(self, argparser): "--format", default="png", help="Output format for the plots (default png)", - choices=["pdf", "png"], + choices=["pdf", "png", "svg"], ) argparser.add_argument( "--json_report", @@ -372,7 +372,7 @@ def main(): smudge_tab = smg.read_csv(args.smudgefile, sep="\t", names=["structure", "size", "rel_size"]) cov_tab = smg.load_hetmers(args.infile) smudgeplot_data = smg.SmudgeplotData(cov_tab, smudge_tab, args.n) - smg.prepare_smudgeplot_data_for_plotting(smudgeplot_data, args.o, title, upper_ylim=args.ylim) + smg.prepare_smudgeplot_data_for_plotting(smudgeplot_data, args.o, title, upper_ylim=args.ylim, fmt=args.format) smg.smudgeplot(smudgeplot_data, log=False, palette=args.col_ramp, invert_cols=args.invert_cols) smg.smudgeplot(smudgeplot_data, log=True, palette=args.col_ramp, invert_cols=args.invert_cols)