Skip to main content

A command-line utility to rotate and reverse complement GenBank files.

Project description

gb_rotate

A basic Python for rotating and reverse complementing GenBank files based on a numerical offset. This tool updates feature annotations to ensure consistency with the transformed sequence. Intended for personal use and originally developed for rotating plastid genomes.

Features

  • Rotate GenBank sequences around a specified offset.
  • Reverse complement sequences and update annotations accordingly.
  • Compatible with GenBank formatting, preserving header and feature details.

Installation

From PyPI

pip install gb_rotate

From repository

  1. Clone the repository:
git clone https://github.com/kherronism/gb_rotate.git
  1. Build and install locally:
cd gb_rotate
pip install .

Usage

Basic usage

After installation, use the gb_rotate command:

gb_rotate -i <input_file> -o <output_file> -r <rotation_offset> -c

Options

Option Description
-i, --input-file Path to the input GenBank file (required).
-o, --output-file Path to the output GenBank file (required).
-r, --rotation-offset Rotation offset position (default: 0).
-rc, --reverse-complement Reverse complement the sequence (optional).

Examples

Rotate only

Rotations should be in the range of 0 to the sequence length. With a rotation_offset of 1000, the first position in the sequence will be the 1001st position in the output.

Rotate a sequence around offset 50000 and save the result:

gb_rotate -i example.gb -o example_rotated.gb -r 50000

Reverse Complement only

Reverse complement a sequence and save the result:

gb_rotate -i example.gb -o example_rc.gb -rc

Combine both

When combining, the reverse complement operation takes place first, followed by the rotation, therefore the offset is applied to the reverse complemented sequence.

Combine both operations:

gb_rotate -i example.gb -o example_modified.gb -r 50000 -rc

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

gb_rotate-0.1.4.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

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

gb_rotate-0.1.4-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file gb_rotate-0.1.4.tar.gz.

File metadata

  • Download URL: gb_rotate-0.1.4.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.10

File hashes

Hashes for gb_rotate-0.1.4.tar.gz
Algorithm Hash digest
SHA256 d33d83d712ce3e739715bf7a76903855cab671e8a9eb160c6342ad90eacd5bfa
MD5 6037ad04584d99e982ca0bea6ff9cb71
BLAKE2b-256 a571bc79db57b1b46185542cb128ff20981e76e9cde09337abb52236863d78fb

See more details on using hashes here.

File details

Details for the file gb_rotate-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: gb_rotate-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.10

File hashes

Hashes for gb_rotate-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3ba978d28fa51975110eff6268f7985678e60a6d24197b67535e2b5e883ac352
MD5 63f1785ed20fc137ba513b635f7745d1
BLAKE2b-256 3a170f347d624bc68e40ff80ad100ec6c53b53b2e9f08d1cfdb973aa76a3e17c

See more details on using hashes here.

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