.. currentmodule:: gffutils Change log ========== v0.12 ----- - Fix `#216 `_ (remove deprecated OptimizedUnicode text factory) - When interfeatures (like when creating introns) results in features with multiple IDs, concatenate them (`#219 `_, thanks @Juke34) - Handle corner cases observed in GRCh38 annotations where a quoted comma in the attributes causes the dialect inference to incorrectly conclude that repeated keys are not present. See `PR #208 `_ for details. - Refactor tests to use pytest instead of the deprecated nosetests (`PR #201 `_, thanks @mr-c) - New method, `FeatureDB.create_splice_sites` (`PR #220 `_, thanks @Juke34) v0.11.1 ------- Bugfix: This fixes `#197 `_, where the :meth:`FeatureDB.interfeatures` function was not behaving correctly when computing inter-features crossing chromosomes and when overlapping features are provided. Behavior is still somewhat undefined for computing inter-features for multiple nested features, so the recommendation is still to merge features before providing them to this method. This also makes a minor maintenance change, replacing ``sqlite3.OptimizedUnicode`` with ``str``. Since Python 3.3, the former has been an alias to the latter, but this alias will be removed in Python 3.12. Making the change now avoids a deprecation warning. v0.11 ----- This is largely a bugfix release, many thanks to contributors Rory Kirchner, Stefano Rivera, Daniel Lowengrub, Nolan Woods, Stefen Moeller, and Husen Umer. - Avoid deadlocks in tests under Python 3.8 (`#155 `_, thanks Stefano Rivera) - Fix deprecation warning for invalid escape sequence (`#168 `_, Stefen Moeller, and `#165 `_, thanks Rory Kirchner) - Fix ResourceWarning about unclosed file (`#169 `_, thanks Daniel Lowengrub) - Allow database creation when there is an empty string in the transcript ID (`#171 `_, thanks Nolan Woods) - Fix off-by-one error in ``FeatureDB.region()`` when ``completely_within = False`` (`#162 `_, thanks Husen Umer and also @Brunox13 for the detailed reporting in `#126 `_) - Migrated tests to GitHub Actions - Refactored the :mod:`iterators` module to make it a bit easier to understand the code, and to pave the way for supporting FASTA sequences at the end of GFF files (see `PR #179 `_) - Empty input now raises ``EmptyInputError`` rather than ``ValueError``, making it easier to catch cases where one might expect empty input (addresses `#17 `_) - PEP8 formatting in code - New dialect detection method will weight more highly those features with more attributes. This solves things like `#128 `_ where some dialect components are otherwise ambiguous. - Fix bug in :meth:`FeatureDB.children_bp`, `#157 `_, where the `ignore_strand` argument is deprecated. - Add new :meth:`FeatureDB.seqids` to list the unique seqids/chromosomes/contigs observed in the database, see `#166 `_. - Add regression tests for `#167 `_, `#164 `_ - Add new argument for :meth:`FeatureDB.create_introns` and :meth:`FeatureDB.interfeatures` to handle cases where introns are being created from component exons and the numeric-like attributes (e.g., `exon_number`) should be numerically sorted rather than alphanumerical sorted. This addresses `#174 `_. - Features with multiple values for their ID (e.g., `ID=gene1,gene2`) are no longer permitted and a ValueError is raised with advice for addressing the issue with a custom id spec. This addresses `#181 `_. v0.10.1 ------- - Fix issue with new merge routine (`#152 `_) v0.10 ----- - Support very large chromosomes (fixed issues `#94 `_ and `#112 `_) - Expand `~` to user's home directory for filenames (issue `#105 `_). - When merging, make merging attributes optional (issue `#107 `_) - Use a proper context manager for open files, fixes `issue #110 `_. - Update code to reflect changes in later Python versions (`#121 `_ and `#123 `_ thanks @abhishekkumaresan) - Dramatically improved merging routine -- many thanks to Nolan Wood @innovate-invent (`#130 `_). - Previously, when merging the second feature's attributes were not deep-copied, resulting in unintended changes to the underlying dict (`#133 `_, thanks Nolan Wood @innovate-invent) - Fixed an issue that when imputing intron features, attributes were being pulled from the first (or last) exon (`#139 `_, thanks @stekaz). - Support creating Feature objects using empty values for attributes (`#144 `_). - Ensure that tests work post-installation (`#145 `_, thanks Michael Crusoe @mr-c) - Removed redundant ``inspection.py`` module (`#147 `_). - Improvements to ``FeatureDB.update``, especially with respect to handling autoincrementing feature IDs. Previously, upon updating a db with another, autoincrement integers would restart at 1. Thanks Nolan Wood (@innovate-invent) and @abhishekkumaresan (`#149 `_) v0.9 ---- Long-overdue release with performance improvements and better handling of corner-case GFF and GTF files. - performance tests (thanks Andrew Lando) - performance improvements by building additional indexes (thanks Andrew Lando) - performance improvments by running ``analyze features`` on created table (thanks Andrew Lando). Existing databases that have not had this run will trigger a warning suggesting that this should be run to speed up queries dramatically. - add test for corner-case GTFs (`issue #79 `_) - add fix for corner-case GFFs where `"="` is both a separator between fields as well as part of a value inside a field even when not quoted (`issue #82 `_) - fix handling of strandedness in :meth:`gffutils.feature.Feature.sequence` (`issue #87 `_) - fix handling of corner-case GFFs that are completely missing a start or end position (`issue #85 `_) - improvements to test framework - All percent-encoded characters are decoded upon parsing (regardless of if the GFF3 spec says they should have been encoded in the first place), and then re-encoded when converting the Feature to a string (`issue #98 `_). Only characters specified in the GFF3 spec are re-encoded. Note that some GFF files have spaces encoded as `%20`, but spaces should not be encoded according to the GFF3 specs. In this case, they will be decoded into spaces upon parsing, but not re-encoded when converting to string. Set `gffutils.constants.ignore_url_escape_characters=True` to disable any encoding/decoding behavior. - improved testing framework v0.8.7.1 -------- Fixes bug in `gffutils.pybedtools_integration.tsses` where iterating over large databases and using the `as_bed6=True` argument could cause a deadlock. v0.8.7 ------ New module, :mod:`gffutils.pybedtools_integration`. In particular, the :func:`gffutils.pybedtools_integration.tsses` function provides many options for creating a GTF, GFF, or BED file of transcription start sites (TSSes) from an annotation. v0.8.6.1 -------- Only a warning -- and not an ImportError -- is raised if BioPython is not installed. Lots of updates in the testing framework to use docker containers on travis-ci.org. v0.8.4 ------ This version addresses issues `#48 `_ and `#20 `_. It only affects database creation using certain GTF files. To summarize, there are some publicly available GTF files that don't match the GTF specification and have transcripts and genes already added. By default, `gffutils` assumes a GTF matches spec and that there are no transcript or gene features. It infers transcript and gene extents from exons alone. So for these off-spec GTF files, `gffutils` would do a lot of extra work inferring the transcript and gene extents, and then it would try to the inferred features back into the database. Since they were already there, it triggered `gffutils`' feature-merging machinery. The point is, if you didn't specifically tell `gffutils` to skip this step, all of this extra merging work would cause database creation to take far longer than it should have (possibly 10-100x longer). With v0.8.4, if you create a database out of a GTF file and there are transcript or gene features in it, `gffutils` will emit a warning and a recommendation to disable inferring transcripts and/or genes to speed things up dramatically. The new keyword arguments for controlling this in :func:`gffutils.create_db` are `disable_infer_transcripts` and `disable_infer_genes`. These are both set to *False* by default. The previous, soon-to-be-deprecated way of doing this was to use `infer_gene_extent=False`. The new equivalent is to use `disable_infer_transcripts=True` and `disable_infer_genes=True`. If you use the old method, it will be automatically converted to the new method and a warning will be emitted. This new behavior is more flexible since it gives us the ability to infer transcripts if genes exist, or infer genes if transcripts exist (rather than the previous all-or-nothing approach). v0.8.3.1 -------- Thanks to Sven-Eric Schelhorn (@schellhorn on github), this version fixes a bug where, if multiple gffutils processes try to create databases from GTF files simultaneously, the resulting databases would be incomplete and incorrect. v0.8.3 ------ New features ~~~~~~~~~~~~ - New :func:`inspect.inspect` function for examining the contents of a GFF or GTF file. - New :meth:`Feature.sequence` method to extract the sequence for a feature (uses `pyfaidx `_). - Expose `ignore_strand` kwarg in :meth:`FeatureDB.children_bp` method - When creating or updating a database, the provided `transform` function can return a value evaluating to False which will cause that feature to be skipped. - :func:`create_db()` can use remote gzipped files as input - New :meth:`FeatureDB.delete` method to delete features from a database - Initial support for BioPython SeqFeature objects - `limit` kwarg can now be used for :meth:`FeatureDB.parents` and :meth:`FeatureDB.children` to restrict returned features to a genomic range - :meth:`FeatureDB.interfeatures` can now update attributes - Much more flexible :meth:`FeatureDB.region` that allows slice-like operations. - Improve :meth:`FeatureDB.update` so that entire features (rather than just attributes) can be replaced or updated (thanks Rintze Zelle for ideas and testing) Bug fixes ~~~~~~~~~ - fix a bug when using a function as an `id_spec` for `create_db()` function (thanks @moritzbuck on github)