Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bio-grumpy

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bio-grumpy

gumpy re-implemented in Rust

  • 0.2.4
  • Source
  • PyPI
  • Socket score

Maintainers
1

grumpy - Re-implementation of gumpy in Rust for speed

Does not implement the same interface, but rather the same premise.

Up to 100x faster than gumpy

Install

pip install bio-grumpy

Usage

import grumpy

# Parse a genbank file
ref = grumpy.Genome("some/path/to/a/genbank/file.gbk")

# Parse a VCF file, respecting filter fails with a MIN_DP of 3 reads to make a call
vcf = grumpy.VCFFile("some/path/to/a/vcf/file.vcf", False, 3)

# Apply the VCF's mutations to the genome
sample = grumpy.mutate(ref, vcf)

# Get the genome level differences
genome_diff = grumpy.GenomeDifference(ref, sample)
for variant in genome_diff.variants:
    print(variant.variant)
# And minor alleles
for variant in genome_diff.minor_variants:
    print(variant.variant)

# Get gene level differences for all genes with mutations
for gene_name in sample.genes_with_mutations:
    print(gene_name)
    gene_diff = grumpy.GeneDifference(
            ref.get_gene(gene_name),
            sample.get_gene(gene_name),
            grumpy.MinorType.COV,
        )
    for mutation in gene_diff.mutations:
        print(mutation.mutation)
    # And minor alleles
    for mutation in gene_diff.minor_mutations:
        print(mutation.mutation)

Threads

By default, VCF parsing will run with the same number of threads as CPU cores. This can give significant speed improvements for complex VCF files

To force single threading (or other number of threads), run grumpy.thread_setup(<thread count>). Note that should be run before any other function in this library, and should not be called more than once! Not following this will cause errors!

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc