Saravanan666/pypi-org huggingface dataset:
Package: genomicassertions
# genomicassertions[![Build Status](https://travis-ci.org/dakl/genomicassertions.svg?branch=master)](https://travis-ci.org/dakl/genomicassertions)[![Coverage Status](https://coveralls.io/repos/github/dakl/genomicassertions/badge.svg?branch=master)](https://coveralls.io/github/dakl/genomicassertions?branch=master)[![PyPI version](https://badge.fury.io/py/genomicassertions.svg)](https://badge.fury.io/py/genomicassertions)`genomicassertions` is a python package which adds methods to test commonly generated files in the genomics field.# Installation`pip install genomicassertions`# ExamplesUse the `VariantAssertions` or `ReadAssertions` mixin in your test class to get access to the methods.## VCF filesFor VCF files, the following methods exist:* `assertVcfHasVariantAt(vcf, chrom, pos)`* `assertVcfHasSample(vcf, sample)`* `assertVcfHasVariantWithChromPosRefAlt(vcf, chrom, pos, ref, alt)`* `assertVcfHasVariantWithChromPosId(vcf, chrom, pos, variant_id)`* `assertVcfHasVariantWithCall(vcf, chrom, pos, sample, call)`## BAM files* `assertBamHasCoverageAt(self, bam, coverage, chrom, pos)`* `assertBamHasHeaderElement(self, bam, header_element)`* `assertBamHeaderElementEquals(self, bam, header_element_name, header_element_value)`### Examples#### VCF files~~~pythonfrom genomicassertions.variantassertions import VariantAssertionsclass TestVariants(unittest.TestCase, VariantAssertions):vcf = "tests/variants.vcf.gz"vcf_with_genotypes = "tests/variants-with-genotypes.vcf.gz"def test_variant_at(self):self.assertVcfHasVariantAt(self.vcf, 3, 178936091)def test_variant_with_chrom_pos_ref_alt(self):self.assertVcfHasVariantWithChromPosRefAlt(self.vcf_with_genotypes, 1, 3062915, 'G', 'C')self.assertVcfHasVariantWithChromPosRefAlt(self.vcf_with_genotypes, 1, 3062915, 'G', 'T')def test_variant_with_id(self):self.assertVcfHasVariantWithChromPosId(self.vcf_with_genotypes, 1, 3062915, 'id3D')~~~`assertVcfHasVariantWithCall()` asserts that individual items in a sample call are set. The parameter `call` is a dict with the items to test. The dict does not have to be complete, i.e. not all fields in the call have to be tested.~~~pythondef test_vcf_has_variant_with_call(self):self.assertVcfHasVariantWithCall(self.vcf_with_genotypes, 1, 3184885, 'B',call={'GT': '1/2', 'DP': 10})~~~#### BAM files~~~pythonfrom genomicassertions.readassertions import ReadAssertionsclass TestReads(unittest.TestCase, ReadAssertions):bam = "tests/3_178936091.bam"# assert coverage as chrom:posdef test_has_coverage_as_pos(self):self.assertBamHasCoverageAt(self.bam, coverage=324, chrom=3, pos=178936091)def test_bam_has_header_element(self):self.assertBamHasHeaderElement(self.bam, header_element="HD")def test_header_element_equals(self):self.assertBamHeaderElementEquals(self.bam,header_element_name='HD',header_element_value={'SO': 'coordinate','VN': '1.3'})~~~# File requirements`genomicassertions` requires the vcf files to be compressed with `bgzip` and indexed with `tabix` in order to work. This is required for the random access to variants provided by the index, which gives a significant performance increase over using non-indexed vcf files. Bam files have to be indexed.
Package: genomic-features
genomic-featuresGenomic annotations using BioConductor resources in Python.Getting startedPlease refer to thedocumentation.InstallationYou need to have Python 3.9 or newer installed on your system. If you don't have
Python installed, we recommend installingMambaforge.There are several alternative options to install genomic-features:Development installTo install the latest development version:pipinstallgit+https://github.com/scverse/genomic-features.git@mainRelease notesSee thechangelog.ContactFor questions and help requests, you can reach out in thescverse discourse.
If you found a bug, please use theissue tracker.Citationt.b.a
Package: genomicsdb
GenomicsDB-PythonExperimental Python 3 Bindings to the nativeGenomicsDBlibrary. Only queries are supported for now. For importing vcf files into GenomicsDB, use the command line tools -vcf2genomicsdborgatk GenomicsDBImport.Installation : Only Linux and MacOS are currently supportedInstallgenomicsdbbinary wheels from PyPi with pip:pip install genomicsdbOr explicitly from a source distribution# Download the source distribution from https://pypi.org/project/genomicsdb/#files as genomicsdb.source.tar.gz
tar xvf genomicsdb.source.tar.gz
cd genomicsdb-<version>
python setup.py installDevelopmentSeeinstructionsfor local builds and running tests.
Package: genomicsqlite
Genomics Extension for SQLite("GenomicSQLite")ThisSQLite3 loadable extensionadds features supporting applications in genome bioinformatics:genomic range indexing for overlap queries & joinsstreaming storage compression (also availablestandalone)pre-tuned settings for "big data"Notice: this project is not associated with the SQLite developers.https://github.com/mlin/GenomicSQLite
Package: genomixhub-api
Overviewgenomixhub-api integrates genomics information into GenomiXHub reports.This project was generated withcookiecutterusingjacebrowning/template-python.SetupRequirementsPython 3.8+InstallationInstall it directly into an activated virtual environment:$ pip install genomixhub-apior add it to yourPoetryproject:$ poetry add genomixhub-apiUsageAfter installation, the package can be imported:$ python
>>> import genomixhub
>>> genomixhub.__version__
Package: genoml
GenoML-coreGenoML is an Automated Machine Learning (AutoML) for Genomic. This is the core package of GenoML.
this repo is under development, please report any issues (bug, performance, documentation) on theGenoML issues page.Here are some quick "get started" exmaples, please checkout the additional options and details in theUsageandCLI.
In general, use linux or mac with python > 3.5 for best results.InstallRun:pip install genomlTrain the ML modelYou can use the IPDGC (International Parkinson's Disease Genomics Consortium) test data. This data is a simulation of the genetic and clinical data used for Parkinson's diagnosis in previous publications. You can find it atIPDGC example data.Download and unzip data:wget https://github.com/ipdgc/GenoML-Brief-Intro/raw/master/exampleData.zip
unzip exampleData.zipTo train, run:genoml-train --geno-prefix=./exampleData/training --pheno-file=./exampleData/training.pheno --model-dir=./exampleModelFinal tuned model and performance metrics are stored in the--model-dirdirectory.Using the trained ML model for inferencegenoml-inference --model-dir=./exampleModel --valid-dir=./exampleData --valid-geno-prefix=./exampleData/validation --valid-pheno-file=./exampleData/validation.phenoValdiation results and model performance metrics are stored in the--valid-dirdirectory.For debugging purposes, include the-vor-vvvflags at the end of a command.Report issuesPlease report any issue or suggestions on theGenoML issues page.
Package: genomvar
Packagegenomvarworks with genomic variants and implements
set-like operations on them. It supports import from VCF files and
export to NumPy.For documentation seehere.InstallationRequirements:Python >=3.6rbi-treejinja2To install:pip install genomvarSample usageCase 1Common task in genome variant analysis is: there are two VCF files (for
example obtained from variant caller #1 and caller #2)
and the differences should be investigated.First we read the VCF files
into genomvar genomvar.varset.VariantSet objects which
hold the variants with underlying data contained in INFO fields:>>>fromgenomvar.varsetimportVariantSet>>>vs1=VariantSet.from_vcf('caller1.out.vcf.gz',parse_info=True)>>>vs2=VariantSet.from_vcf('caller2.out.vcf.gz',parse_info=True)To find variants detected by caller #1 but not caller #2diffmethod is used. Then differences are exported tonumpyfor futher
analysis:>>>diff=vs1.diff(vs2)>>>recs=diff.to_records()# recs is a numpy structured dtype array>>>recs[['chrom','start','end','ref','alt','vartype']][('chr1',1046755,1046756,'T','G','SNP')('chr1',1057987,1057988,'T','C','SNP')...,('chr19',56434340,56434341,'A','G','SNP')('chrY',56839067,56839068,'A','G','SNP')]>>>recs['INFO']['DP'].mean()# recs['INFO']['DP'] is a numpy ndarray232.18819746028257Case 2There is a smaller variant file obtained from the data and a bigger one
usually obtained from a database. Variants in the former should be “annotated”
with some data associated with variants in the latter.This case is different from the previous in that DB file might not
comfortably fit into memory. Class
genomvar.varset.VariantSetFromFile can be used for this
purpose:>>>vs=varset.VariantSet.from_vcf('vcf_of_interest.vcf')>>>dbSNP=varset.VariantSetFromFile('DBSNP.vcf.gz',index=Trueg)>>>annots=[]>>>forvrtinvs.iter_vrt():>>>m=dbSNP.match(vrt)>>>annots.append(m[0].attrib['id']ifmelseNone)>>>annots[None,None,'rs540057607','rs367710686','rs940651103',...]Here genomvar.varset.VariantSet.match method is used. It
searches for variants with the same genomic alteration as argument
variant and returns a list of those.  Then VCFIDfield can be
accessed from those matching variants inattrib['id'](dbSNP rs
numbers in this particular case).
Package: genonets
GenonetsWelcome to the latest version of Genonets. The project now uses Python 3.8+,
with several feature and performance upgrades. A previous version based on
Python 2 was used as the backend for theGenonets Server.DocumentationInstallation and usage instructions, as well as further documentation is
availablehere.Genonets Server end-of-lifeThe Genonets Server had to be shut down due to lack of funding for web hosting
services. Nevertheless, all analyses are still available in the Genonets
package via this repository.ContactNote:Pleaseemail usfor any questions
and/or comments.
Package: genopandas
GenoPandasGenoPandas is a library that provides various datastructures to support
manipulation, querying and plotting of genomic data in Python. To do so,
GenoPandas provides several pandas-based data structures, such as theGenomicDataFrameandAnnotatedMatrixclasses, which can be used to
store different types of genomic data. For basic analyses, these classes
also provide a variety of different manipulation and plotting functions.DocumentationPyIM’s documentation is available atjrderuiter.github.io/genopandas.ExamplesComing soon!LicenseThis software is released under the MIT license.History0.1Initial release with GenomicsDataFrame + AnnotatedMatrix classes.
Package: gen-openapi-rest
OpenAPI to VSCode REST Client GeneratorThis tool automatically generates.httpfiles for the VSCode REST Client from an OpenAPI (Swagger) specification. It supports both local and remote (URL) OpenAPI JSON files.FeaturesFetch OpenAPI JSON from a URL or a local file.Generate.httpfiles compatible with the VSCode REST Client.Handle path and query parameters, including enum options.PrerequisitesBefore you begin, ensure you have met the following requirements:Python 3.xrequestslibrary for Python (Install usingpip install requests)UsageTo use the OpenAPI to VSCode REST Client Generator, follow these steps:Clone or download this repository to your local machine.Install the required Python packages usingpip install -r requirements.txt.Run the script using the following command:The file can be loaded locally or pulled directly from an url e.ghttps://petstore.swagger.io/v2/swagger.jsonpythongen_openapi_rest.py<swagger-json-source><output-http-file>
Package: genophenocorr
Genophenocorr is a Python library for genotype-phenotype association analysis.An example of simple genotype-phenotype association analysis# Load HPOimporthpotkhpo=hpotk.load_minimal_ontology('http://purl.obolibrary.org/obo/hp.json')# Load a cohort of phenopacketsfromgenophenocorr.dataimportget_toy_cohortcohort=get_toy_cohort()# Analyze genotype-phenotype associationsfromgenophenocorr.analysisimportCohortAnalysisfromgenophenocorr.constantsimportVariantEffectcohort_analysis=CohortAnalysis(cohort,'NM_1234.5',hpo)frameshift=cohort_analysis.compare_by_variant_type(VariantEffect.FRAMESHIFT_VARIANT)print(frameshift)prints a table with genotype-phenotype correlations:With frameshift_variant         Without frameshift_variant
                                              Count Percent                      Count Percent  p-value
HP:0001166 (Arachnodactyly)                       4  30.77%                         10  76.92%  0.04718
HP:0001250 (Seizure)                             11  84.62%                          9  69.23%  0.64472
HP:0001257 (Spasticity)                           8  61.54%                          9  69.23%  1.00000DocumentationCheck out the User guide and the API reference for more info:Stable documentation(last release onmainbranch)Latest documentation(bleeding edge, latest commit ondevelopmentbranch)
Package: genosolver
The GENO solverGENO is a solver for non-linear optimization problems. It can solve constrained and unconstrained problems. It is fully written in Python with no dependencies and it can run on the CPU and on the GPU.Installingpip install genosolverProject HomepageSeegeno-project.orgfor more details, examples, and for an easy-to-read  modeling language interface.AuthorsSören Laue- most of the solver -Mark Blacher- GPU supportMatthias MitterreiterLicenseThis project is licensed under the GNU Affero General Public License v3.PapersFor more information, see the papersOptimization for Classical Machine Learning Problems on the GPU. Sören Laue, Mark Blacher, and Joachim Giesen. InAAAI Conference on Artificial Intelligence (AAAI),2022.GENO -- GENeric Optimization for Classical Machine Learning. Sören Laue, Matthias Mitterreiter, and Joachim Giesen. InAdvances in Neural Information Processing Systems (NeurIPS),2019.
Package: geno-sugar
geno-sugarUtility functions to read bed and bgen files and facilitate genome-wide analyses.
While this can be used as a standalone module, this module has been designed to be a building block ofLIMIX2. LIMIX2 is a python module that makes available a large set of tools for genetic studies, including statistical methods for GWAS, interaction testing and variance component estimation.InstallFrom terminal, it can be installed usingpip:pipinstallgeno-sugarDocumentationThe public interface and a quick start in python are available athttp://geno-sugar.readthedocs.io/.ProblemsIf you encounter any problem, please, consider submitting anew issue.AuthorsFrancesco Paolo Casale-https://github.com/fpcasaleDanilo Horta-https://github.com/hortaRachel Moore-https://github.com/rm18Oliver Stegle-https://github.com/ostegleLicenseThis project is licensed under the Apache License (Version 2.0, January 2004) -
see theLICENSEfile for details
Package: genotate
IntroductionGenotate is a tool to annotate prokaryotic*and phage genomes.  It uses scrolling amino-acid
windows in all six frames to distinguish between windows that belong to protein coding gene
regions and those that belong to noncoding regions, in order to determine the coding frame
at every position along the genome.
*(the bacteria/archaea model is still being trained)To installGenotate,pipinstallgenotateAnd to runGenotateyou only need to specify the FASTA formatted genome file
The command to run using the phage models on the provided phiX174 genome is:genotate.py test/phiX174.fasta -o predictions.gbThe command to run using the partially trained bacterial/archaeal models needs the --bacterial flag. Instead of
a FASTA formatted file, you can provide a Genbank formatted file and Genotate will use only the genomic sequence.genotate.py test/mycoplasma.gbff.gz -o predictions.gb --bacteriaIt is recommended to use a GPU to run Genotate since it will take a long time to for prokaryotic
genomes.Genotate will automatically try to run on GPU, if one isn't found it will run on a CPU.The output ofGenotateare 'coding region' predictions in GenBank format.  Theyshouldmatch with the true coding gene regions, but are not genes per say, since they are not based
on start and stop codons. Though they have all been trimmed to a stop codon after Genotate
determines which transation table the genome uses (i.e. if it performs stop codon readthrough).There are three main phases to the Genotate workflowwindow classificationchange-point detectionrefinementanalyze stop codonsmerge adjacent regionssplit regions on stopadjust ends to a stopGenotate determines the translation table by analyzing the initial coding gene region
predictions.  There are two outcomes for a stop codon that is readthrough: either the stop
codon appears in the middle of a coding gene region or the region is broken into two pieces at
the stop codon. If one of the three known stop codons is significantly over represented in the
middle AND between predicted gene regions, that stop codon can be assumed to be read through.
With the stop codon usage now known, same frame adjacent coding regions are merged if there is
not a stop codon between them. Then the regions are split on any internal stop codons and the
ends adjusted to the nearest stop codon.** The opposite end is not adjusted to valid start codon since Genotate does not have a translation
initiation site detection method yet, so the beginning of a gene call may be off by a few codonsCurrently the best way to visualize the predictions is in a Genome Viewer application, such
as Artemis by Sanger. The example phiX174.gb GenBank file loaded into Artemis shows the
gene layout:The predictions.gb file can then be loaded using the 'File>Read An Entry' menu, and the
predictions will be overlaid as grey 'coding regions' in the gene layout window:
Package: genotations
GenotationsPython library to work with genomes and annotations, mostly Ensembl genomes. Also supports visualization of transcripts/gene features and primer selection.
As pandas and polars are libraries of everyday use for many python developers this library focus on annotations representation in a dataframe way.The library allows:downloading Ensembl annotations and genomes (uses genomepy under the hood)working with genomic annotations like with polars dataframesgetting sequences for selected genesvisualizing the genes featuresdesigning primers for selected transcripts with Primer3 python wrapperUsageInstall with pip:pipinstallgenotationsIn some cases you may also need to install ucsc annotation tools, you can add them to your micromamba/conda environment as they are installed from bioconda channel.
Here how it may look in your environment file:name:genotationschannels:-conda-forge-BjornFJohansson-bioconda-defaultsdependencies:-python=3.10-ucsc-bedtogenepred-ucsc-genepredtobed-ucsc-genepredtogtf-ucsc-gff3togenepred-ucsc-gtftogenepred-pip-pip:-genotationsNow you can start using it, for example:fromgenotationsimportensemblhuman=ensembl.human# getting human genomemouse=ensembl.mouse# getting mosue genomemouse.annotations.exons().annotations_df# getting exons as DataFramemouse.annotations.protein_coding().exons().annotations_df# getting exons of protein coding genesmouse.annotations.transcript_gene_names_df# getting transcript gene namesmouse.annotations.with_gene_name_contains("Foxo1").protein_coding().transcripts()#getting only coding Foxo1 transcriptsmouse.annotations.with_gene_name_contains("Foxo1").genes_visual(mouse.genome)[0].plot()# plotting features of the Foxo1 genecow_assemblies=ensembl.search_assemblies("Bos taurus")# you can also search genomes by species name if it exists in Ensemblcow1=ensembl.SpeciesInfo("Cow",cow_assemblies[-1][0])# selecting one of several cow assembliescow1.annotations.annotations_df# getting annotations as dataframeYou can also use the library to annotate existing gene expression data with gene and transcript symbols and features.
For examplefromgenotations.quantificationimport*fromgenotationsimportensemblbase="."examples=base/"examples"data=examples/"data"expressions=pl.read_parquet(str(data/"PRJNA543661_transcripts.parquet"))with_expressions_summaries(expressions,min_avg_value=1)expressions_ext=ensembl.mouse.annotations.extend_with_annotations_and_sequences(expressions,ensembl.mouse.genome)# extend expression data with annotations and sequencesFor more examples, checkexample notebookto see the usage and APIWorking with the library codeUse micromamba (or conda) and environment.yaml to install the dependenciesmicromamba create -f environment.yaml
micromamba activate genotations
Package: genotype_network
# genotype-networkGenotype Networks were defined in a paper by Wagner (2014)[http://rspb.royalsocietypublishing.org/content/281/1786/20132763]. A protein genotype network is defined as such: a graph, in which nodes are unique protein sequences, and edges connect nodes that differ by a single amino acid substitution, insertion or deletion.This Python package is written to provide Pythonistas a way to construct and analyze protein genotype networks. Everything here is currently experimental, we would welcome pull requests and suggestions on how to make it more useful!Documentation is being developed. Please stay tuned!# Contributor List@Chevelant (Kyle Yuan, MIT)
Package: genotype-variants
genotype_variantsProject to genotype SNV, INDELS and SV.Free software: Apache Software License 2.0Documentation:https://genotype-variants.readthedocs.io.FeaturesCurrently this module only supports genotyping and merging small variants (SNV and INDELS).For this we have the following command line submodule calledsmall_variants.Which have the following sub-commands:generate: To runGetBaseCountMultiSampleversion 1.2.5 on given BAM filesmerge: To merge MAF format files w.r.t counts generated from thegeneratecommand.all: This will run both of the sub-commands abovegenerateandmergetogather.multiple-samples: This will run sub-commandsallfor multiple samples in the provided metadata filePlease read the USAGE(https://genotype-variants.readthedocs.io/en/latest/usage.html)section of the documentation for more informationRequires GetBaseCountMultiSample v1.2.4 and aboveTo DoTagging genotyped files for thresholdsGenotyping normal buffy coatsGenotype structural variants callsCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.3.0 (2020-04-10)Release with merge for standard BAM maf and Input MAF. Converted multiple-patient to multiple-sample0.2.1 (2020-04-09)Release bug fixes, where simplex numbers are listed as duplex and vice versa, during runningallcommand.0.2.0 (2020-04-08)Release with multiple-patient command.0.1.0 (2020-01-30)First release on PyPI.