| 1 | import sys |
| 2 | from typing import List, Union, NoReturn, Iterable, Any, Tuple, Optional, TypeVar |
| 3 | |
| 4 | if sys.version_info < (3, 8): |
| 5 | from typing_extensions import Protocol |
| 6 | else: |
| 7 | from typing import Protocol |
| 8 | |
| 9 | class _HasFileNo(Protocol): |
| 10 | def fileno(self) -> int: ... |
| 11 | |
| 12 | def get_verbosity() -> int: ... |
| 13 | def set_verbosity(level: int): ... |
| 14 | |
| 15 | THFile = TypeVar("THFile", bound="HFile") |
| 16 | |
| 17 | class HFile: |
| 18 | def __init__(self, name: Union[int, str], mode: str = ...) -> None: ... |
| 19 | def __enter__(self: THFile) -> THFile: ... |
| 20 | def __exit__(self, type, value, tb): ... |
| 21 | def __iter__(self) -> Any: ... |
| 22 | def __next__(self) -> str: ... |
| 23 | @property |
| 24 | def closed(self) -> bool: ... |
| 25 | @property |
| 26 | def mode(self) -> str: ... |
| 27 | @property |
| 28 | def name(self) -> Union[int, str]: ... |
| 29 | def close(self) -> None: ... |
| 30 | def fileno(self) -> int: ... |
| 31 | def flush(self) -> None: ... |
| 32 | def isatty(self) -> bool: ... |
| 33 | def readable(self) -> bool: ... |
| 34 | def read(self, size: int = ...) -> bytes: ... |
| 35 | def readall(self) -> bytes: ... |
| 36 | def readinto(self, buf: Any) -> bytes: ... |
| 37 | def readline(self, size: int = ...) -> bytes: ... |
| 38 | def readlines(self) -> List[bytes]: ... |
| 39 | def seek(self, offset: int, whence: int = ...) -> int: ... |
| 40 | def seekable(self) -> bool: ... |
| 41 | def tell(self) -> int: ... |
| 42 | def truncate(self, *args) -> NoReturn: ... |
| 43 | def writable(self) -> bool: ... |
| 44 | def write(self, b: bytes) -> int: ... |
| 45 | def writelines(self, lines: Iterable[bytes]) -> None: ... |
| 46 | |
| 47 | THTSFile = TypeVar("THTSFile", bound="HTSFile") |
| 48 | |
| 49 | class HTSFile: |
| 50 | def __enter__(self: THTSFile) -> THTSFile: ... |
| 51 | def __exit__(self, type, value, traceback) -> Any: ... |
| 52 | @property |
| 53 | def filename(self) -> Any: ... |
| 54 | @property |
| 55 | def mode(self) -> str: ... |
| 56 | @property |
| 57 | def threads(self) -> int: ... |
| 58 | @property |
| 59 | def index_filename(self) -> Optional[str]: ... |
| 60 | @property |
| 61 | def is_stream(self) -> bool: ... |
| 62 | @property |
| 63 | def is_remote(self) -> bool: ... |
| 64 | @property |
| 65 | def duplicate_filehandle(self) -> bool: ... |
| 66 | def close(self) -> None: ... |
| 67 | def flush(self) -> None: ... |
| 68 | def check_truncation(self, ignore_truncation: bool = ...) -> None: ... |
| 69 | @property |
| 70 | def category(self) -> str: ... |
| 71 | @property |
| 72 | def format(self) -> str: ... |
| 73 | @property |
| 74 | def version(self) -> Tuple[int, int]: ... |
| 75 | @property |
| 76 | def compression(self) -> str: ... |
| 77 | @property |
| 78 | def description(self) -> str: ... |
| 79 | @property |
| 80 | def is_open(self) -> bool: ... |
| 81 | @property |
| 82 | def is_closed(self) -> bool: ... |
| 83 | @property |
| 84 | def closed(self) -> bool: ... |
| 85 | @property |
| 86 | def is_write(self) -> bool: ... |
| 87 | @property |
| 88 | def is_read(self) -> bool: ... |
| 89 | @property |
| 90 | def is_sam(self) -> bool: ... |
| 91 | @property |
| 92 | def is_bam(self) -> bool: ... |
| 93 | @property |
| 94 | def is_cram(self) -> bool: ... |
| 95 | @property |
| 96 | def is_vcf(self) -> bool: ... |
| 97 | @property |
| 98 | def is_bcf(self) -> bool: ... |
| 99 | def reset(self) -> None: ... |
| 100 | def seek(self, offset: int, whence: int = ...) -> int: ... |
| 101 | def tell(self) -> int: ... |
| 102 | def add_hts_options(self, format_options: Optional[List[str]] = ...) -> None: ... |
| 103 | def parse_region( |
| 104 | self, |
| 105 | contig: Optional[str] = ..., |
| 106 | start: Optional[int] = ..., |
| 107 | stop: Optional[int] = ..., |
| 108 | region: Optional[str] = ..., |
| 109 | tid: Optional[int] = ..., |
| 110 | reference: Optional[str] = ..., |
| 111 | end: Optional[int] = ..., |
| 112 | ) -> Tuple[int, int, int, int]: ... |
| 113 | def is_valid_tid(self, tid: int) -> bool: ... |
| 114 | def is_valid_reference_name(self, contig: str) -> bool: ... |
| 115 | def get_tid(self, contig: str) -> int: ... |
| 116 | def get_reference_name(self, tid: int) -> Optional[str]: ... |