From 91c21db21d56a6ca39041a980f3e9157e534dfd7 Mon Sep 17 00:00:00 2001 From: Malte Benedikt Kuehl Date: Fri, 13 Sep 2024 23:04:23 +0200 Subject: [PATCH] Limit git clone to one commit, more extensive documentation, contributing information --- .gitignore | 3 +++ README.md | 19 +++++++++++++++++++ docs/source/installation.md | 2 +- docs/source/start.md | 22 ++++++++++++++++++++++ pytximport/__init__.py | 29 ++++++++++++++++++----------- 5 files changed, 63 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 578a652..4ddb12b 100644 --- a/.gitignore +++ b/.gitignore @@ -43,6 +43,9 @@ ENV/ .dmypy.json dmypy.json +# Ruff +.ruff_cache/ + # Pyre type checker .pyre/ diff --git a/README.md b/README.md index 74ac83c..6d12ea1 100755 --- a/README.md +++ b/README.md @@ -107,6 +107,25 @@ Features unique to `tximport` Argument order and argument defaults may differ between the implementations. +## Contributing + +Contributions are welcome. Contributors are asked to follow the Contributor Covenant Code of Conduct. + +To set up `pytximport` for development on your machine, we recommend to git clone the dev branch: + +```bash +git clone --depth 1 -b dev https://github.com/complextissue/pytximport.git +cd pytximport +pyenv local 3.9 +make create-venv +source .venv/source/activate +make install-dev +``` + +Since `pytximport` is linted and formatted, the repository contains a list of recommended VS Code extensions in `.vscode/extensions.json`. If you are using a different editor, please make sure to set up your environment to use the same linters and formatters. + +For new features and non-obvious bug fixes, we kindly ask that you create a GitHub issue before submitting a PR. + ## Building the documentation locally The documentation can be build locally by navigating to the `docs` folder and running: `make html`. diff --git a/docs/source/installation.md b/docs/source/installation.md index 7759472..e6a10dc 100755 --- a/docs/source/installation.md +++ b/docs/source/installation.md @@ -49,7 +49,7 @@ This option is only recommended for potential contributors and installs addition Install `pytximport` from source: ```bash -git clone https://github.com/complextissue/pytximport.git +git clone --depth 1 -b dev https://github.com/complextissue/pytximport.git cd pytximport pyenv local 3.9 make create-venv diff --git a/docs/source/start.md b/docs/source/start.md index 74ac83c..58b27b5 100755 --- a/docs/source/start.md +++ b/docs/source/start.md @@ -24,6 +24,7 @@ mamba install -c bioconda pytximpport ``` `pytximport` can also be installed via pip: + ```bash pip install pytximport ``` @@ -65,6 +66,8 @@ Common options are: - `-tx`: Provide this flag to return transcript-level instead of gene-summarized data. Incompatible with gene-level input and `counts_from_abundance=length_scaled_tpm`. - `--help`: Display all configuration options. +If you are looking for a full-featured end-to-end workflow for Pythonic bulk RNA-sequencing analysis, check out our [Snakemake workflow](https://github.com/complextissue/snakemake-bulk-rna-seq-workflow/) based on pytximport. + ## Documentation Detailled documentation is made available at: [https://pytximport.readthedocs.io](https://pytximport.readthedocs.io/en/latest/start.html). @@ -107,6 +110,25 @@ Features unique to `tximport` Argument order and argument defaults may differ between the implementations. +## Contributing + +Contributions are welcome. Contributors are asked to follow the Contributor Covenant Code of Conduct. + +To set up `pytximport` for development on your machine, we recommend to git clone the dev branch: + +```bash +git clone --depth 1 -b dev https://github.com/complextissue/pytximport.git +cd pytximport +pyenv local 3.9 +make create-venv +source .venv/source/activate +make install-dev +``` + +Since `pytximport` is linted and formatted, the repository contains a list of recommended VS Code extensions in `.vscode/extensions.json`. If you are using a different editor, please make sure to set up your environment to use the same linters and formatters. + +For new features and non-obvious bug fixes, we kindly ask that you create a GitHub issue before submitting a PR. + ## Building the documentation locally The documentation can be build locally by navigating to the `docs` folder and running: `make html`. diff --git a/pytximport/__init__.py b/pytximport/__init__.py index fb81918..f9ac18a 100755 --- a/pytximport/__init__.py +++ b/pytximport/__init__.py @@ -1,16 +1,26 @@ -"""pytximport: Convert transcript-level expression to gene-level expression. +"""pytximport: Gene-level count estimation from transcript quantification files -The `pytximport` package provides a Python implementation of the `tximport` R package, which converts transcript-level -expression to gene-level count estimates. +The `pytximport` package provides a Python implementation of the `tximport` R package, which provides an easy-to-use +interface for importing transcript quantification files from various tools (e.g., `salmon`, `kallisto`, `RSEM`) into +Python. The package is designed to work with the output of these tools and provide isoform bias-corrected gene-level +counts for downstream analysis. + +The package provides a single function, `tximport`, as the main entry point, as well as a command-line interface +(`pytximport`). Further utility functions (e.g., to create a transcript-to-gene map) are provided through the +`pytximport.utils` module. + +`pytximport` can output data as AnnData objects and xarray objects or save the data as a CSV file, enabling seamless +integration with other Python packages such as `PyDESeq2`. .. note:: - Please also cite the original `tximport` R package when using `pytximport`. - DOI: https://doi.org/10.12688/f1000research.7563.1 + Please consider citing both `pytximport` and the original R implementation of `tximport` when using `pytximport`. + For `pytximport`, please refer to the README or CITATION.cff file for the appropriate citation information. + The original `tximport` publication can be found at: https://doi.org/10.12688/f1000research.7563.1 .. warning:: - The `pytximport` package is still in development and currently does not support alevin quantification files, - unlike the `tximport` R package. Default parameters, argument names and return types may also differ between the - implementations. + Though `pytximport` aims to provide the same functionality as `tximport`, there are some differences between the two + packages. While the same configuration will result in identical output, the configuration options and defaults may + differ between the two packages. Please refer to the documentation for more information. """ from . import definitions, importers, utils @@ -20,6 +30,3 @@ # Allow users to import the tximport function as pytximport as well pytximport = tximport - -create_transcript_gene_map = utils.create_transcript_gene_map -create_transcript_gene_map_from_annotation = utils.create_transcript_gene_map_from_annotation