Skip to main content

GCGC

GCGC is a tool for feature processing on Biological Sequences.

code style black

Installation

GCGC is primarily intended to be used as part of a larger workflow inside Python.

To install via pip:

$ pip install gcgc

If you'd like to use code that helps gcgc's tokenizers integrate with common third party libraries, either install those packages separately, or use gcgc's extras.

$ pip install 'gcgc[pytorch,hf]'

Documentation

The GCGC documentation is at gcgc.trenthauck.com, please see it for examples.

Quick Start

The easiest way to get started is to import the kmer tokenizer, configure it, then start tokenizing.

from gcgc import KmerTokenizer

kmer_tokenizer = KmerTokenizer(alphabet="unambiguous_dna")
encoded = kmer_tokenizer.encode("ATCG")
print(encoded)

sample output:

[1, 6, 7, 8, 5, 2]

This output includes the "bos" token, the "eos" token, and the four nucleotide tokens in between.

You can go the other way and convert the integers to strings.

from gcgc import KmerTokenizer

kmer_tokenizer = KmerTokenizer(alphabet="unambiguous_dna")
decoded = kmer_tokenizer.decode(kmer_tokenizer.encode("ATCG"))
print(decoded)

sample output:

['>', 'A', 'T', 'C', 'G', '<']

There's also the vocab for the kmer tokenizer.

from gcgc import KmerTokenizer

kmer_tokenizer = KmerTokenizer(alphabet="unambiguous_dna")
print(kmer_tokenizer.vocab.stoi)

sample output:

{'|': 0, '>': 1, '<': 2, '#': 3, '?': 4, 'G': 5, 'A': 6, 'T': 7, 'C': 8}

Metadata

Release files for gcgc 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 gcgc 1.0.0
File Size Uploaded Provenance Actions
gcgc-1.0.0.tar.gz 481.7 kB Without provenance Details for gcgc-1.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 497.6 kB

Release files / gcgc-1.0.0.tar.gz

Download URL gcgc-1.0.0.tar.gz
Size 481.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a5bfa1ca3b71dcb6b7ba70ad7d060584129606f754a0349fc0d14614f358d31b
BLAKE2b-256 checksum
How to use checksums
0780a45a6f4dfdd9dfcb4a2f6c505478dcdf50eb45fdefabbf9ff10b444e5147
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.9

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

Download URL gcgc-1.0.0-py3-none-any.whl
Size 15.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1d15698541cec68b5eec5684b2c24898de11fdadb9e5032651f57ea2655ede7a
BLAKE2b-256 checksum
How to use checksums
df9d5c6558dd772a632593a86ab41b045ae4d14155b7c46a19889beb61269f7f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.9

Security for gcgc 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