### Setting up Development Environment for tag Project Source: https://github.com/standage/tag/blob/master/docs/dev.rst Provides a quickstart guide to set up the development environment for the 'tag' project, including cloning the repository, setting up a virtual environment, installing dependencies, running tests, and configuring a pre-commit hook. ```bash # Fork repo on GitHub then clone git clone git@github.com:YourGithubUsername/tag.git cd tag/ # Optional (but highly recommended): set up a virtual environment virtualenv -p python3 env echo "export PYTHONPATH=$(pwd)" >> env/bin/activate source env/bin/activate # Re-run this any time you return after launching a new terminal. # Install Python libraries needed for testing and run the test suite make devenv make test echo "make style" > .git/hooks/pre-commit # Test the development CLI; end users will invoke `tag` instead of `./tagcli` ./tagcli -h ``` -------------------------------- ### Install tag Python Package via pip Source: https://github.com/standage/tag/blob/master/docs/install.rst This snippet shows the standard way to install the tag package from the Python Package Index (PyPI) using the pip command. It ensures the most recent stable release is installed. ```bash pip install tag ``` -------------------------------- ### Install tag Python Package from GitHub Source: https://github.com/standage/tag/blob/master/docs/install.rst This snippet demonstrates how to install the latest unreleased code of the tag package directly from its development repository on GitHub using pip. This is useful for accessing the newest features or bug fixes. ```bash pip install git+https://github.com/standage/tag.git ``` -------------------------------- ### tag Package API Documentation Overview Source: https://github.com/standage/tag/blob/master/docs/dev.rst Describes the API of the 'tag' package, adhering to semantic versioning. It explains that changes to the command-line or Python interface require version bumps and that API documentation is generated directly from Python docstrings, with code examples in docstrings being executed during testing. ```APIDOC The 'tag' package API adheres to semantic versioning (http://semver.org/). Version Bumping: - Minor version bump: For backwards-compatible additions to the CLI or Python interface. - Major version bump: For API-breaking changes. API Documentation Generation: - Documentation is pulled directly from docstrings in class and module definitions. - Any Python code within API docstrings is executed and evaluated via autodoc when the test suite is invoked. ``` -------------------------------- ### Analyze Genomic Data Interactively with tag Source: https://github.com/standage/tag/blob/master/docs/install.rst This Python snippet illustrates how to use the tag library interactively within a Python interpreter. It demonstrates reading a GFF3 file, selecting features of a specific type (e.g., 'intron'), and filtering them based on length to print their slugs. ```python import tag reader = tag.reader.GFF3Reader(infilename='/data/genomes/mybug.gff3.gz') for entry in tag.select.features(reader, type='intron'): if len(entry) > 100000: print(entry.slug) ``` -------------------------------- ### Python API Modules and Classes for tag project Source: https://github.com/standage/tag/blob/master/docs/api.rst Overview of the core modules and classes available in the 'tag' Python API, including their purpose and the functionality they encapsulate. Each module's members are exposed for use, following semantic versioning. ```APIDOC Module: tag Description: Core module for the tag project's Python API. Submodules: Module: tag.range Description: Provides functionality related to ranges. Members: All public members are exposed. Module: tag.comment Description: Handles comment-related operations. Members: All public members are exposed. Module: tag.directive Description: Manages directives within the tag system. Members: All public members are exposed. Module: tag.sequence Description: Deals with sequence-related operations. Members: All public members are exposed. Module: tag.feature Description: Provides functionality for handling features. Members: All public members are exposed. Module: tag.index Description: Manages indexing operations. Members: All public members are exposed. Module: tag.reader Description: Contains classes for reading data. Classes: Class: GFF3Reader Description: Reads GFF3 formatted files. Members: All public members are exposed. Module: tag.writer Description: Contains classes for writing data. Classes: Class: GFF3Writer Description: Writes GFF3 formatted files. Members: All public members are exposed. Module: tag.transcript Description: Provides functionality for handling transcripts. Members: All public members are exposed. Module: tag.select Description: Manages selection operations. Members: All public members are exposed. Module: tag.locus Description: Provides functionality for locus partitioning. Members: All public members are exposed. Module: tag.bae Description: Handles bacterial annotation evaluation. Members: All public members are exposed. ``` -------------------------------- ### Compute Exons per Gene with tag Source: https://github.com/standage/tag/blob/master/README.md This Python snippet demonstrates how to use the 'tag' library to read a GFF3 file and iterate through gene features. For each gene, it identifies and counts the number of associated exon features, printing the result. ```Python # Compute number of exons per gene import tag reader = tag.GFF3Reader(infilename='/data/genomes/mybug.gff3.gz') for gene in tag.select.features(reader, type='gene'): exons = [feat for feat in gene if feat.type == exon] print('num exons:', len(exons)) ``` -------------------------------- ### Compute Exons Per Gene with tag in Python Source: https://github.com/standage/tag/blob/master/docs/index.rst This Python snippet demonstrates how to use the 'tag' library to read GFF3 annotation data and compute the number of exons for each gene. It utilizes `GFF3Reader` to parse the input file and `tag.select.features` to iterate through gene features, then filters for exons within each gene to count them. ```python # Compute number of exons per gene import tag reader = tag.GFF3Reader(infilename='/data/genomes/mybug.gff3.gz') for gene in tag.select.features(reader, type='gene'): exons = [feat for feat in gene if feat.type == exon] print('num exons:', len(exons)) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.