Commit 6b0e7bcd authored by Martin Larralde's avatar Martin Larralde
Browse files

Deprecate the `ignore_gaps` keyword argument of `SequenceFile`

parent 6778ca92
......@@ -7,6 +7,11 @@ import sys
import types
import typing
try:
from typing import Literal
except ImportError:
from typing_extensions import Literal # type: ignore
BUFFER = typing.Union[bytes, bytearray, memoryview]
# --- Alphabet ---------------------------------------------------------------
......@@ -491,18 +496,12 @@ class Sequence(typing.Sized, abc.ABC):
@abc.abstractmethod
def copy(self) -> Sequence: ...
def write(self, fh: typing.BinaryIO) -> None: ...
if sys.version_info >= (3, 8):
@typing.overload
def reverse_complement(self, inplace: typing.Literal[True]) -> None: ...
@typing.overload
def reverse_complement(
self, inplace: typing.Literal[False] = False
) -> Sequence: ...
else:
@typing.overload
def reverse_complement(
self, inplace: bool = False
) -> typing.Optional[Sequence]: ...
@typing.overload
def reverse_complement(self, inplace: Literal[True]) -> None: ...
@typing.overload
def reverse_complement(
self, inplace: Literal[False] = False
) -> Sequence: ...
class TextSequence(Sequence):
def __init__(
......@@ -517,17 +516,12 @@ class TextSequence(Sequence):
def digitize(self, alphabet: Alphabet) -> DigitalSequence: ...
@property
def sequence(self) -> str: ...
if sys.version_info >= (3, 8):
@typing.overload
def reverse_complement(self, inplace: typing.Literal[True]) -> None: ...
@typing.overload
def reverse_complement(
self, inplace: typing.Literal[False] = False
) -> TextSequence: ...
else:
def reverse_complement(
self, inplace: bool = False
) -> typing.Optional[TextSequence]: ...
@typing.overload
def reverse_complement(self, inplace: Literal[True]) -> None: ...
@typing.overload
def reverse_complement(
self, inplace: Literal[False] = False
) -> TextSequence: ...
class DigitalSequence(Sequence):
alphabet: Alphabet
......@@ -544,17 +538,12 @@ class DigitalSequence(Sequence):
def textize(self) -> TextSequence: ...
@property
def sequence(self) -> VectorU8: ...
if sys.version_info >= (3, 8):
@typing.overload
def reverse_complement(self, inplace: typing.Literal[True]) -> None: ...
@typing.overload
def reverse_complement(
self, inplace: typing.Literal[False] = False
) -> DigitalSequence: ...
else:
def reverse_complement(
self, inplace: bool = False
) -> typing.Optional[DigitalSequence]: ...
@typing.overload
def reverse_complement(self, inplace: Literal[True]) -> None: ...
@typing.overload
def reverse_complement(
self, inplace: Literal[False] = False
) -> DigitalSequence: ...
# --- Sequence File ----------------------------------------------------------
......
......@@ -5185,6 +5185,18 @@ cdef class SequenceFile:
cdef int status
cdef bytes fspath
# TODO: Remove in v0.7.0
if ignore_gaps:
warnings.warn(
(
"`ignore_gaps` is deprecated and will be removed from future "
"versions, use the aligned FASTA format ('afa') to read a "
"FASTA file with gap characters."
),
DeprecationWarning,
stacklevel=2
)
# get format from string passed as input
fmt = libeasel.sqio.eslSQFILE_UNKNOWN
if format is not None:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment