Skip to main content

BioProv - W3C-PROV provenance documents for bioinformatics

Code PyPI Version lint Code style
Tests Build Status tests Coverage Status
Docs Docs status License binder

BioProv is a Python library for W3C-PROV representation of bioinformatics workflows. It enables you to quickly write workflows and to describe relationships between samples, files, users and programs.

Please see the tutorials for a more detailed introduction and visit ReadTheDocs for the complete documentation.

Quickstart

>>> import bioprov as bp

# Create samples and file objects
>>> sample = bp.Sample("mysample")
>>> genome = bp.File("mysample.fasta", "genome")
>>> sample.add_files(genome)

# Create programs
>>> output = sample.files["blast_out"] = bp.File("mysample.blast.tsv", "blast_out")
>>> blastn = bp.Program("blastn",
                        params={"-query": sample.files["genome"],
                                "-db": "mydb.fasta", "-out": output}
                        )
>>> sample.add_programs(blastn)

# Run programs
>>> sample.run_programs()

# Save your project
>>> proj = bp.Project((sample,), tag="example_project")
>>> proj.to_json()

# Create PROV documents
>>> prov = bp.BioProvDocument(proj)

# Save in PROVN or graphical format
>>> prov.write_provn()  # human-readable text format
>>> prov.dot.write_pdf()  # graphical format

BioProv also has a command-line application to run preset workflows.

$ bioprov -h
usage: bioprov [-h] [--show_config | --show_db | --clear_db | -v | -l]
               {genome_annotation,blastn,kaiju} ...

BioProv command-line application. Choose a command to begin.

optional arguments:
  -h, --help            show this help message and exit
  --show_config         Show location of config file.
  --show_db             Show location of database file.
  --clear_db            Clears all records in database.
  -v, --version         Show BioProv version
  -l, --list            List Projects in the BioProv database.

workflows:
  {genome_annotation,blastn,kaiju}

BioProv is built with the Biopython and Pandas libraries.

You can import data into BioProv using Pandas objects.

# Read csv straight into BioProv
>>> samples = bp.read_csv("my_dataframe.tsv", sep="\t", sequencefile_cols="assembly")

# Alternatively, use a pandas DataFrame
>>> df = pd.read_csv("my_dataframe.tsv", sep="\t")

# [...] manipulate your df
>>> df["assembly"] = "assembly_directory/" + df["assembly"]

# Now load from your df
>>> project = bp.from_df(df, sequencefile_cols="assembly", source_file="my_dataframe.tsv")

# `samples` becomes a Project dict-like object
>>> sample1 = project['sample1']

# You can also export your sample and associated files and attributes as a dataframe
>>> project.to_csv()

Installation

# Install from pip
$ pip install bioprov

# Install from conda
$ conda install -c conda-forge -c bioconda bioprov

# Install from source
$ git clone https://github.com/vinisalazar/bioprov && cd bioprov;     # download
$ conda env create -f environment.yaml && conda activate bioprov;     # install dependencies
$ pip install . && pytest;                                            # install and test

Important! BioProv requires Prodigal to be tested. Otherwise tests will fail.

Contributions are welcome!

BioProv is in active development and no warranties are provided (please see the License).

Dependencies

BioProv requires the follow dependencies to run. Also see the setup and environment files.

  • biopython
  • coolname
  • coveralls
  • dataclasses
  • pandas
  • prodigal
  • prov
  • provstore-api
  • pydot
  • pytest
  • pytest-cov
  • tqdm
  • tinydb

Metadata

Release files for bioprov 0.1.24

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bioprov 0.1.24
File Size Uploaded Provenance
bioprov-0.1.24.tar.gz 3.9 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for bioprov 0.1.24
File Interpreter ABI Platform
bioprov-0.1.24-py3-none-any.whl Python 3 none any Details

Total release size: 7.9 MB

Release files / bioprov-0.1.24.tar.gz

Download URL bioprov-0.1.24.tar.gz
Size 3.9 MB
Tags Source
SHA-256 checksum
How to use checksums
bef7edc95081274920e2f74f1c5f59d29ae4bfe4f7c7294297d722ffe722c64f
BLAKE2b-256 checksum
How to use checksums
467186fa545a6915cbc3f5b7aff630d6df13f02399905716fd63983b24ce9554
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / bioprov-0.1.24-py3-none-any.whl

Download URL bioprov-0.1.24-py3-none-any.whl
Size 4.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
e21d13a597adc1cef2c46685310f07072c9011495e038c16701c6b090ab5a1a7
BLAKE2b-256 checksum
How to use checksums
1581e048b0e855ddf670ac3b9b6a16765cf596c134533e9e4e92b355db4d798e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Security for bioprov 0.1.24

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page