Skip to main content

NextPyper

Recovery of homoeologous loci from target capture data in higher ploidy samples.

Documentation

Please refer to the official documentation, which is more complete.

Table of contents

Installation

Regardless of the installation method, NextPyper requires conda in your PATH, to manage and deploy workflow environments.

Conda/Mamba

If you already have bioconda set up, you can create a new environment and simply run:

conda install nextpyper # or mamba

Pip

Alternatively you can use pip:

pip install nextpyper

Manual

You can also install NextPyper manually with pip. We recommend to create a new environment.

# from your new environment with pip
git clone git@github.com:M2BL/NextPyper.git
cd NextPyper
pip install .

NextPyper uses snakemake to orchestrate and execute the different steps of the workflow, which uses conda to set up the packages and environments required at each stage.

The first time you run NextPyper, this setup will be done automatically at the start of the workflow.

Alternatively, you can set up these environments beforehand by running:

nextpyper prepare

This command creates the required environments within NextPyper's installation path. You can use the option --conda-prefix to specify a different path where to store these environments.

Usage

NextPyper requires two inputs, a probes file with the targets of your experiment, and a sample table describing where to find the data of your samples.

1. Preparing your probes

NextPyper expects a nucleotide fasta file with the sequences of the targeted loci, what we call the probe set. Probe sets can be divided into two categories:

  • Multi probe sets: Contains multiple sequences per locus/gene (e.g. Angiosperms353).
  • Single probe sets: Contains a single sequence per locus. Usually, custom probe sets designed from a single reference genome fall in this category.

Sequence names in the probe set are required to be simple (letters, numbers and underscore, characters only). Additionally no duplicated names are allowed.

Currently, only coding regions that can be translated are supported.

Single-probe sets

If you are using a single-probe set, you only need to worry about sticking to the naming conventions described above. To check your probes, you can use nextpyper validate:

$ nextpyper validate --probes probes.fasta 

# Probe sequence names comply with naming convention.
# Pattern (.*) yielded no grouping of the sequences.
# Either this is a single-probe set or the pattern is not appropriate for multi-probe mode

If you get the message above, your probe set is well formatted to run in single-probes mode.

Multi-probe sets

If using a multi-probe set, NextPyper needs to know which sequences target the same locus. The option --pattern expects a RegEx (with one capture group) that will inform about that hierarchy based on the name of the probes.

For instance, for the Angiosperms353 probe set with sequence names:

AJFN_probe4471
Ambtr_probe4471
BERS_probe4527
ZENX_probe4527
Arath_probe4691
QUTB_probe4691

We can use --pattern "(\d+)$", which will group the sequences by the number at the end of the sequence name (which is the LocusID).

You can use the validate subcommand to check if your pattern groups your probes:

$ nextpyper validate --probes kew_probes.fasta --pattern "(\d+)$"

# Probe sequence names comply with naming convention.
# The pattern yields 353 groups from 4781 probe sequences

Use the options --out_summary and --out_hierarchy to get more details about the grouping.

2. Preparing your samples

NextPyper expects a 4-column table that defines the identity and ploidy of your samples, and where to find their associated data.

Knowledge about your samples' ploidy is not required to run NextPyper. Simply set it to 0, if you do not know it, or do not want to take it into account.

The table requires a header with 4 columns (see an example here):

  • sample: the name of the sample.
  • path_forward: absolute path to the forward reads. It can be .gz compressed.
  • path_reverse: absolute path to the reverse reads. It can be .gz compressed.
  • ploidy: the ploidy of the sample. If 0, ploidy won't be taken into account to process the sample.

You can use the gather subcommand to help you create the sample table. From a data directory (like this one) with only the paired-end data (forward and reverse files) you can run:

nextpyper gather --input data_folder --output sample.tsv

To get the input the sample table for your samples. See an example of the result here.

The sample names are inferred based on the common prefix between the forward and reverse files.

3. Running NextPyper

Finally, use the run subcommand to start the workflow. For single-probes you do not need to specify a pattern, so simply provide the inputs we prepared:

nextpyper run --threads 16 --single-probes --input input_samples.tsv --probes custom_probes.fasta --output out_single

For multi-probes, specify the appropriate pattern as well:

nextpyper run --threads 16 --input new_hier_samples.tsv --probes kew_probes.fasta --pattern "(\d+)$" --output out_multi

Output

Sequence versions

The main output of NextPyper are the samples' homologous sequences for each targeted locus. We generate 3 versions of these sequences, depending on the final postprocessing:

  • Exons: includes only the exonic part of the sequence.
  • Genetigs: includes exons and introns.
  • Supercontigs: The full sequence, including exons, introns and flanking regions.

The exons are the shorter and more conserved version of the output sequences, while the supercontigs are longer and include all discovered variation (which can be a bit noisy). Genetigs usually provide a good balance, containing more signal than the exons without it being overwhelming. You may want to explore which type of sequence suits better your purposes.

Output structure

NextPyper organizes its main outputs in the following fashion:

  • Homologous sequences per sample: <outdir>/outputs/seqs_per_sample
  • Homologous sequences per locus: <outdir>/outputs/seqs_per_locus
  • Loci Multiple Sequence Alignments (MSAs): <outdir>/outputs/alignments

NextPyper output directory follows the following structure:

outdir
├── config.yaml      # Final config with parameters used to run the workflow.
├── execution.log    # Snakemake execution log of all workflow jobs.
├── logs/            # Logs generated by the workflow jobs.
├── nextpyper.log    # Summary of params and snakemake invocation.
├── outputs/         # Final outputs of the workflow.
└── workflow/        # Working folder for all the jobs and stages of the pipeline. It contains intermediate and final files.

Metadata

Release files for NextPyper 0.1.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 NextPyper 0.1.0
File Size Uploaded Provenance Actions
nextpyper-0.1.0.tar.gz 106.5 kB Without provenance Details for nextpyper-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 236.3 kB

Release files / nextpyper-0.1.0.tar.gz

Download URL nextpyper-0.1.0.tar.gz
Size 106.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f5f7f11ae803107f6427a3acd62c97d325256460dcf7c504132f4388f36b5cf7
BLAKE2b-256 checksum
How to use checksums
33c82564a00d4e08ad0d3addb2cf292b4df00781fb16156454ab9489962f9372
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release files / nextpyper-0.1.0-py3-none-any.whl

Download URL nextpyper-0.1.0-py3-none-any.whl
Size 129.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
867ae2c467a18f379f9a78e12e0634a2179349a991d467091e1299d061c7f8dc
BLAKE2b-256 checksum
How to use checksums
050cb0478fedb59d249d787fe7a46ccd62ca0681f7f0d77655ce2028da84aa69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Security for NextPyper 0.1.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

0.1.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