Conversation
7f02e5f to
9bd7737
Compare
The `IntEnum` already existed, but the docstrings and documentation still referred to the removed string offsets. Closes biotite-dev#923
`align_ungapped()`, `align_optimal()`, `align_banded()`, `align_local_gapped()`, `align_multiple()` and `score()` now default to a match score of 1, a mismatch score of -1 and a linear gap penalty of -1. To allow a default for `matrix`, the required `band` and `seed`/`threshold` parameters of `align_banded()` and `align_local_gapped()` now precede it. Closes biotite-dev#930
`annotate_sse()` and `pdbx.get_sse()` return `SecondaryStructure` values, `DsspApp` returns `DsspElement` values. Both enums provide conversion from/to the one-letter symbols. Closes biotite-dev#924
The former `CGO` enum listing the directives is now `CGO.Type`. Closes biotite-dev#909
`load_color_scheme()` returns a `ColorScheme` instead of an untyped dictionary and the plotting functions accept it as `color_scheme`. Closes biotite-dev#908
`GFFFile` entries are now represented by `GFFRecord` objects instead of 9-tuples. Closes biotite-dev#906
`get_locus()` returns a `GenBankLocus` and `set_locus()` accepts one instead of the 6-tuple of locus properties. Closes biotite-dev#925
`GenBankFile` fields are now represented by `GenBankRecord` objects instead of (name, content, subfields) tuples. Closes biotite-dev#907
- The transformation now consists of a single rotation and translation - Transformations can be combined via `*` and inverted via unary `-` - `align_vectors()` and `orient_principal_components()` return the transformation instead of transformed coordinates Closes biotite-dev#844
- `use_author_fields` defaults to `False` in `get_structure()`, `get_assembly()` and `get_unit_cell()` - `get_sequence()` keys the sequences by `label_asym_id` (via `struct_asym`) - `get_sse()` uses `label_asym_id` as chain ID - Tests and documentation that rely on author fields (PDB, PDBQT, PyMOL, foldseek references and hard-coded author IDs) request them explicitly Closes biotite-dev#773
- Remove the `biotite.application` package in favor of `biotite.application_v2` - Remove `align_local_ungapped()`, `set_font_size_in_coord()` and `get_symmetry_mates()` - Remove the deprecated parameters `as_bytes` (`LetterAlphabet.decode*()`), `distance_range` (`connect_via_distances()`), `float_tolerance` (`pdbx.compress()`), `include_bonds` (`pdbx.set_structure()`) and `as_mask` (`CellList.get_atoms*()`) - Remove the `label_entity_id` annotation fallback in `pdbx.set_structure()`
`biotite.application_v2` remains as deprecated shim that forwards to `biotite.application`.
9bd7737 to
20b75c3
Compare
Merging this PR will regress 2 benchmarks
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
This PR implements the currently open 'major release' issues and removes all deprecated functionality from the code base.
.py,.pyiand.rstfiles.EValueEstimatoraccept aGeneratorEValueEstimator.from_samples()got anrng: numpy.random.Generatorparameter (default: freshdefault_rng()); sampling usesrng.choice(). Tests and gallery scripts pass a seeded generator instead ofnp.random.seed().FastaFileby defaultchars_per_lineofFastaFile,FastaFile.read()andFastaFile.write_iter()acceptsNoneand defaults to it, analogous toFastqFile. Internal callers that used a huge line width now rely on the default.FastqFileoffset anIntEnumFastqFile.Offsetalready existed; the docstrings still advertised string offsets and the docs still passedoffset="Sanger". Docstrings now document the enum members, and tutorial/gallery scripts useFastqFile.Offset.SANGER.verboseparameter fromfetch()functionsprint()calls and the docstring entries fromrcsb,afdb,uniprot,entrezandpubchemfetch().fetch()functions should accept and returnPathobjectsfetch()functions (andentrez.fetch_single_file()) acceptstr | PathLiketargets, create directories viaPath.mkdir()and returnpathlib.Pathobjects (or lists thereof). Tutorials use.nameinstead ofos.path.basename().align_ungapped(),align_optimal(),align_banded(),align_local_gapped(),align_multiple()andscore()default tomatrix=(1, -1)andgap_penalty=-1;score()accepts(match, mismatch)tuples. To makematrixoptional,band(inalign_banded()) andseed/threshold(inalign_local_gapped()) now precedematrix. Doctest examples that illustrate specific alignments pingap_penalty=-10. The RustSeedExtensionconstructor and the deprecatedalign_local_ungapped()are unchanged.IntEnumbiotite.structure.PSeaElement(NONE=-1,COIL,HELIX,STRAND) returned byannotate_sse()andpdbx.get_sse(), andDsspElement(COIL…POLYPROLINE_HELIX) returned by the v1 and v2DsspApp. Both enums providesymbol,from_symbol(),from_symbols()andto_symbols()for one-letter conversion.CGOclass wrapping the float values (valuesproperty,__eq__,__len__); the former directive enum becameCGO.Type.get_*_cgo()returnCGO,draw_cgo()takesSequence[CGO]and rejects raw lists.ColorSchemeColorScheme(name, alphabet, colors)withfit(alphabet, default).load_color_scheme()returns it;LetterTypePlotter,plot_alignment_type_based()andplot_sequence_logo()accept it ascolor_scheme/scheme.get_color_scheme()keeps returning a color list.GFFRecordGFFRecord(seqid, source, type, start, end, score, strand, phase, attributes).GFFFileindexing/iteration yields records,insert()/append()/__setitem__()take a record; converters updated.GenBankLocusGenBankLocus(name, length, mol_type, is_circular, division, date).get_locus()returns it andset_locus(gb_file, locus)accepts it.GenBankRecordGenBankRecord(name, content, subfields).GenBankFileindexing/iteration andget_fields()return records;insert()/append()/set_field()/__setitem__()take a record. The metadata, annotation and sequence converters use record attributes.ColorScheme,GFFRecord,GenBankLocus,GenBankRecordandCGOcommits above; no separate commit.AffineTransformationRigidTransformation(rotation, translation)using a single rotation and translation (x' = R x + t);__mul__composes transformations ((a * b).apply(x) == a.apply(b.apply(x))) and unary__neg__inverts them.apply()also handles singleAtoms.superimpose*(),space_group_transforms()and PDBx assembly code produce it;align_vectors()andorient_principal_components()now return the transformation instead of transformed coordinates.application_v2toapplicationbiotite.application_v2was moved tobiotite.application(sources, tests, docs, CI config). A deprecatedbiotite.application_v2shim remains: importing it emits aDeprecationWarning, re-exportsbiotite.applicationand aliases all subpackages insys.modules, sobiotite.application_v2.dssp.DsspAppis the same object asbiotite.application.dssp.DsspApp. The shim is excluded from the API documentation.biotite.applicationpackage (and its tests, doctests and API docs; the formerapplication_v2was left untouched in this commit),align_local_ungapped(),set_font_size_in_coord(),PDBFile.get_symmetry_mates()/pdb.get_symmetry_mates(), theas_bytesparameter ofLetterAlphabet.decode*(), thedistance_rangeparameter ofconnect_via_distances(), thefloat_toleranceparameter ofpdbx.compress(), theinclude_bondsparameter ofpdbx.set_structure()and itslabel_entity_idannotation fallback, and theas_maskparameter ofCellList.get_atoms*()(Rust + stub).plot_nucleotide_secondary_structure()and the MUSCLE reference tests now use the v2 apps.use_author_fieldsdefault toTrue(i.e. uselabelfields)use_author_fieldsinget_structure(),get_assembly()andget_unit_cell()flipped toFalse.get_sequence()keys its result bystruct_asym.id(=label_asym_id),get_sse()usesbeg_label_asym_id/label_asym_id. Tests and docs that compare against PDB/PDBQT/PyMOL/foldseek data (which only know author fields) or select chains by author IDs (2RTG, 2OR1) requestuse_author_fields=Trueexplicitly; #553 was already fixed.Closed issues
Closes #703.
Closes #905.
Closes #923.
Closes #900.
Closes #899.
Closes #930.
Closes #924.
Closes #909.
Closes #908.
Closes #906.
Closes #925.
Closes #907.
Closes #902.
Closes #844.
Closes #773.