jpayne@68
|
1 import sys
|
jpayne@68
|
2 from typing import Optional, List, Any
|
jpayne@68
|
3
|
jpayne@68
|
4 if sys.version_info < (3, 8):
|
jpayne@68
|
5 from typing_extensions import Literal
|
jpayne@68
|
6 else:
|
jpayne@68
|
7 from typing import Literal
|
jpayne@68
|
8
|
jpayne@68
|
9 from pysam.libchtslib import HTSFile
|
jpayne@68
|
10
|
jpayne@68
|
11 _ParseResult = Any
|
jpayne@68
|
12
|
jpayne@68
|
13 class Parser:
|
jpayne@68
|
14 def __init__(self, encoding: str = ...) -> None: ...
|
jpayne@68
|
15 def get_encoding(self) -> str: ...
|
jpayne@68
|
16 def set_encoding(self, encoding: str) -> None: ...
|
jpayne@68
|
17 def __call__(self, buffer: str, length: int) -> _ParseResult: ...
|
jpayne@68
|
18
|
jpayne@68
|
19 class asTuple(Parser): ...
|
jpayne@68
|
20 class asGFF3(Parser): ...
|
jpayne@68
|
21 class asGTF(Parser): ...
|
jpayne@68
|
22 class asBed(Parser): ...
|
jpayne@68
|
23 class asVCF(Parser): ...
|
jpayne@68
|
24
|
jpayne@68
|
25 class TabixFile(HTSFile):
|
jpayne@68
|
26 filename_index: bytes = ...
|
jpayne@68
|
27 @property
|
jpayne@68
|
28 def header(self) -> List[str]: ...
|
jpayne@68
|
29 @property
|
jpayne@68
|
30 def contigs(self) -> List[str]: ...
|
jpayne@68
|
31 def __init__(
|
jpayne@68
|
32 self,
|
jpayne@68
|
33 filename: str,
|
jpayne@68
|
34 mode: str = ...,
|
jpayne@68
|
35 parser: Parser = ...,
|
jpayne@68
|
36 index: Optional[str] = ...,
|
jpayne@68
|
37 encoding: str = ...,
|
jpayne@68
|
38 threads: int = ...,
|
jpayne@68
|
39 *args,
|
jpayne@68
|
40 **kwargs
|
jpayne@68
|
41 ) -> None: ...
|
jpayne@68
|
42 def fetch(
|
jpayne@68
|
43 self,
|
jpayne@68
|
44 reference: Optional[str] = ...,
|
jpayne@68
|
45 start: Optional[int] = ...,
|
jpayne@68
|
46 end: Optional[int] = ...,
|
jpayne@68
|
47 region: Optional[str] = ...,
|
jpayne@68
|
48 parser: Optional[Parser] = ...,
|
jpayne@68
|
49 multiple_iterators: bool = ...,
|
jpayne@68
|
50 ) -> Any: ...
|
jpayne@68
|
51 def close(self) -> None: ...
|
jpayne@68
|
52
|
jpayne@68
|
53 class TabixIterator:
|
jpayne@68
|
54 def __init__(self, encoding: str = ...) -> None: ...
|
jpayne@68
|
55 def __iter__(self) -> TabixIterator: ...
|
jpayne@68
|
56 def __next__(self) -> str: ...
|
jpayne@68
|
57
|
jpayne@68
|
58 class EmptyIterator:
|
jpayne@68
|
59 def __iter__(self) -> Any: ...
|
jpayne@68
|
60 def __next__(self) -> Any: ...
|
jpayne@68
|
61
|
jpayne@68
|
62 class TabixIteratorParsed(TabixIterator):
|
jpayne@68
|
63 def __init__(self, parser: Parser) -> None: ...
|
jpayne@68
|
64 def __next__(self) -> Any: ...
|
jpayne@68
|
65
|
jpayne@68
|
66 class GZIterator:
|
jpayne@68
|
67 def __init__(
|
jpayne@68
|
68 self, filename: str, bufer_size: int = ..., encoding: str = ...
|
jpayne@68
|
69 ) -> None: ...
|
jpayne@68
|
70 def __iter__(self) -> GZIterator: ...
|
jpayne@68
|
71 def __next__(self) -> str: ...
|
jpayne@68
|
72
|
jpayne@68
|
73 class GZIteratorHead(GZIterator): ...
|
jpayne@68
|
74
|
jpayne@68
|
75 class GZIteratorParsed(GZIterator):
|
jpayne@68
|
76 def __init__(self, parser: Parser) -> None: ...
|
jpayne@68
|
77 def __next__(self) -> _ParseResult: ...
|
jpayne@68
|
78
|
jpayne@68
|
79 def tabix_compress(filename_in: str, filename_out: str, force: bool = ...) -> None: ...
|
jpayne@68
|
80 def tabix_index(
|
jpayne@68
|
81 filename: str,
|
jpayne@68
|
82 force: bool = ...,
|
jpayne@68
|
83 seq_col: Optional[int] = ...,
|
jpayne@68
|
84 start_col: Optional[int] = ...,
|
jpayne@68
|
85 end_col: Optional[int] = ...,
|
jpayne@68
|
86 preset: Optional[Literal["gff", "bed", "sam", "vcf", "psltbl", "pileup"]] = ...,
|
jpayne@68
|
87 meta_char: str = ...,
|
jpayne@68
|
88 line_skip: int = ...,
|
jpayne@68
|
89 zerobased: bool = ...,
|
jpayne@68
|
90 min_shift: int = ...,
|
jpayne@68
|
91 index: Optional[str] = ...,
|
jpayne@68
|
92 keep_original: bool = ...,
|
jpayne@68
|
93 csi: bool = ...,
|
jpayne@68
|
94 ) -> str: ...
|
jpayne@68
|
95
|
jpayne@68
|
96 class tabix_file_iterator:
|
jpayne@68
|
97 def __init__(self, infile: str, parser: Parser, buffer_size: int = ...) -> None: ...
|
jpayne@68
|
98 def __iter__(self) -> tabix_file_iterator: ...
|
jpayne@68
|
99 def __next__(self) -> _ParseResult: ...
|
jpayne@68
|
100
|
jpayne@68
|
101 class tabix_generic_iterator:
|
jpayne@68
|
102 def __init__(self, infile: str, parser: Parser) -> None: ...
|
jpayne@68
|
103 def __iter__(self) -> tabix_generic_iterator: ...
|
jpayne@68
|
104 def __next__(self) -> _ParseResult: ...
|
jpayne@68
|
105
|
jpayne@68
|
106 def tabix_iterator(infile: str, parser: Optional[Parser]) -> _ParseResult: ...
|
jpayne@68
|
107
|
jpayne@68
|
108 # backwards compatibility
|
jpayne@68
|
109 class Tabixfile(TabixFile): ...
|