Skip to main content

q2sra

Conventional microbiome bioinformatics workflows are riddled with inefficiencies, as users must navigate a variety of fragmented tools, command-line utilities, and file management systems. In the contemporary research setting, with multiple individuals contribtuting to a singular project, issues with uniformity often arise, complicating subsequent data aggregation/analysis. The q2sra package reconciles these obstacles by providing a streamlined, centralized, and standardized framework for microbiome data analysis with QIIME 2.

Installation

$ pip install q2sra

Prerequisites

Installing QIIME 2 with Conda

$ wget https://data.qiime2.org/distro/core/qiime2-2023.7-py38-linux-conda.yml
$ conda env create \
    -n qiime2-2023.7 \
    --file qiime2-2023.7-py38-linux-conda.yml
$ rm qiime2-2023.7-py38-linux-conda.yml

Installing SRA Toolkit

Instructions can be found here.

Creating a q2sra Project

To create a project, simply initialize a q2sra.Proj object, supplying the intended project name as the sole parameter.

>>> from q2sra import Proj
>>> proj = Proj('my_proj')

q2sra Project Attributes

Attribute Type Default Description
name String None Project name
fields List of str [ ] Metadata fields
nsamples Integer 30 Maximum number of samples from each study
paired Boolean True Whether to use forward and reverse reads or exclusively forward reads

Adding Metadata Fields

q2sra.Proj.add_field(field: str, required: bool) -> None

Arguments

  • field - Name of field
  • required - Whether the field is required [default=False]

Example Run

>>> proj.add_field('Phylum')
>>> proj.add_field('Country', required = True)

Saving a Project

>>> proj.save()

Output

<proj name>.pkl - a pickle file storing the project's attributes.

Loading a Pre-configured Project

Any existing q2sra project saved in .pkl format (see previous step) can later be loaded to perform additional actions (adding more studies, merging runs, etc.).

q2sra.proj.load(name: str) -> None

Arguments

  • name - Name of project to load

Example Run

>>> proj = Proj.load('my_proj')

Adding Studies

q2sra.Proj.run(study_name: str, accession: str, include: list, exclude: list) -> None

Arguments

  • study_name - Name of study
  • accession - Study accession number in the NCBI SRA database
  • include - List of substrings that must be included when filtering .fastq files [default=[]]
  • exclude - List of substrings that must be excluded when filtering .fastq files [default=[]]

Example Run (w/ user input)

>>> proj.run('takagi_2022', 'PRJNA809527')
Phylum: Chordata
[Required] Country: Japan

Aggregating Studies

After compiling a satisfactory number of studies, individual metadata files and QIIME 2 feature tables/representative sequences can be merged for further analysis using the following method:

>>> proj.merge()

Metadata

Release files for q2sra 1.0.0

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

Source distribution (sdist)

Source distribution for q2sra 1.0.0
File Size Uploaded Provenance Actions
q2sra-1.0.0.tar.gz 10.3 kB Without provenance Details for q2sra-1.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 19.3 kB

Release files / q2sra-1.0.0.tar.gz

Download URL q2sra-1.0.0.tar.gz
Size 10.3 kB
Tags Source
SHA-256 checksum
How to use checksums
34df97b8038187eb2cd8945e075fc2d7edf62c63cf0d284a7e0f0a1d38ebbd91
BLAKE2b-256 checksum
How to use checksums
1edd325c14b3980dc38995fac35119ae3d3b5f11b13ed16fbbe9f1ea089c9f30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.8.15

Release files / q2sra-1.0.0-py3-none-any.whl

Download URL q2sra-1.0.0-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f67e701a4f737d31ffee54339eb988965fbbdd34f6a555635e5a1aa2f41aac4a
BLAKE2b-256 checksum
How to use checksums
8f37864573a58284eddc2aecfff697bee54bc1012fdf82a11737270b9ff2aab0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.8.15

Security for q2sra 1.0.0

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.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

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