Skip to main content

A collection of tools for working with primer.bed files

Project description

primalbedtools

primalbedtools is a library for manipulating and processing BED files, particularly focused on primer-related operations. It provides several functions for common BED file operations including coordinate remapping, sorting, updating, and amplicon generation.

Functions are wrapped in a CLI for ease of use.

Installation

Install primalbedtools using pip:

pip install primalbedtools

or conda:

conda install bioconda::primalbedtools

Basic Usage

primalbedtools <command> [options]

Commands

remap

Remap BED file coordinates from one reference to another using a multiple sequence alignment.

primalbedtools remap --bed <bed_file> --msa <msa_file> --from_id <source_id> --to_id <target_id>

Arguments:

  • --bed: Input BED file (required)
  • --msa: Multiple sequence alignment file (required)
  • --from_id: Source sequence ID to remap from (required)
  • --to_id: Target sequence ID to remap to (required)

Example:

primalbedtools remap --bed primers.bed --msa alignment.fasta --from_id MN908947.3 --to_id BA.2

sort

Sort BED file by chromosome, amplicon number, and primer direction.

primalbedtools sort <bed_file>

Arguments:

  • bed: Input BED file

Example:

primalbedtools sort primers.bed > primers.sorted.bed

update

Update primer names to v2 format (prefix_number_DIRECTION_index).

primalbedtools update <bed_file>

Arguments:

  • bed: Input BED file

Example:

primalbedtools update primers.v1.bed > primers.v2.bed

amplicon

Generate amplicon information from primer pairs.

primalbedtools amplicon <bed_file> [--primertrim]

Arguments:

  • bed: Input BED file
  • -t, --primertrim: Generate primer-trimmed amplicon information

Example:

primalbedtools amplicon primers.bed > amplicons.txt
primalbedtools amplicon primers.bed --primertrim > trimmed_amplicons.txt

merge

Merge primers with the same properties (chromosome, amplicon number, direction).

primalbedtools merge <bed_file>

Arguments:

  • bed: Input BED file

Example:

primalbedtools merge primers.bed > primers.merged.bed

fasta

Convert BED file to FASTA format.

primalbedtools fasta <bed_file>

Arguments:

  • bed: Input BED file

Example:

primalbedtools fasta primers.bed > primers.fasta

validate_bedfile

Validate a BED file for internal consistency (correct primer pairings, etc.).

primalbedtools validate_bedfile <bed_file>

Arguments:

  • bed: Input BED file

Example:

primalbedtools validate_bedfile primers.bed

validate

Validate a BED file against a reference genome.

primalbedtools validate <bed_file> <fasta_file>

Arguments:

  • bed: Input BED file
  • fasta: Reference FASTA file

Example:

primalbedtools validate primers.bed reference.fasta

downgrade

Downgrade a BED file from v2 to v1 primer name format.

primalbedtools downgrade <bed_file> [--merge-alts]

Arguments:

  • bed: Input BED file
  • --merge-alts: Merge alternative primers (removes _alt suffixes)

Example:

# Downgrade with alternative primers
primalbedtools downgrade primers.v2.bed > primers.v1.bed

# Downgrade without alternative primers
primalbedtools downgrade primers.v2.bed --merge-alts > primers.v1.merged.bed

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

primalbedtools-0.11.1.tar.gz (80.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

primalbedtools-0.11.1-py3-none-any.whl (23.2 kB view details)

Uploaded Python 3

File details

Details for the file primalbedtools-0.11.1.tar.gz.

File metadata

  • Download URL: primalbedtools-0.11.1.tar.gz
  • Upload date:
  • Size: 80.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for primalbedtools-0.11.1.tar.gz
Algorithm Hash digest
SHA256 aa7ae7c6c32044b6770de2bb3010cb01795b028c30137381defdc551343b4c54
MD5 814529a72a3854151d9501e7c39524f4
BLAKE2b-256 6b8d3247c6226175e403af39d8d38ceaf1013c81f0c8da2e4bcfe1d1f9894254

See more details on using hashes here.

Provenance

The following attestation bundles were made for primalbedtools-0.11.1.tar.gz:

Publisher: python-publish.yml on ChrisgKent/primalbedtools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file primalbedtools-0.11.1-py3-none-any.whl.

File metadata

File hashes

Hashes for primalbedtools-0.11.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a63bc3286253e91c22cfa645ae8ae008f5b1e05f51f2cd40855c749f085d76de
MD5 14fd2a4e7a2d5b3ae72765d617b79504
BLAKE2b-256 e82804471ae5afd76a1f9c03406a14c9fd829c35134a51abeb6b486935058576

See more details on using hashes here.

Provenance

The following attestation bundles were made for primalbedtools-0.11.1-py3-none-any.whl:

Publisher: python-publish.yml on ChrisgKent/primalbedtools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page