annotate CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/lib/python3.8/site-packages/pysam/libcbcf.pyi @ 68:5028fdace37b

planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author jpayne
date Tue, 18 Mar 2025 16:23:26 -0400
parents
children
rev   line source
jpayne@68 1 import sys
jpayne@68 2 from typing import (
jpayne@68 3 Optional,
jpayne@68 4 Union,
jpayne@68 5 Any,
jpayne@68 6 Sequence,
jpayne@68 7 Tuple,
jpayne@68 8 Iterator,
jpayne@68 9 List,
jpayne@68 10 Iterable,
jpayne@68 11 Dict,
jpayne@68 12 overload,
jpayne@68 13 TypeVar,
jpayne@68 14 Mapping,
jpayne@68 15 Generic,
jpayne@68 16 )
jpayne@68 17
jpayne@68 18 if sys.version_info < (3, 8):
jpayne@68 19 from typing_extensions import Literal
jpayne@68 20 else:
jpayne@68 21 from typing import Literal
jpayne@68 22
jpayne@68 23 from pysam.libchtslib import HTSFile, _HasFileNo
jpayne@68 24
jpayne@68 25 _D = TypeVar("_D")
jpayne@68 26 _K = TypeVar("_K", str, Union[int, str])
jpayne@68 27 _V = TypeVar("_V")
jpayne@68 28
jpayne@68 29 class _Mapping(Generic[_K, _V]):
jpayne@68 30 def __len__(self) -> int: ...
jpayne@68 31 def __contains__(self, key: _K) -> bool: ...
jpayne@68 32 def __iter__(self) -> Iterator[_K]: ...
jpayne@68 33 def iterkeys(self) -> Iterator[_K]: ...
jpayne@68 34 def itervalues(self) -> Iterator[_V]: ...
jpayne@68 35 def iteritems(self) -> Iterator[Tuple[_K, _V]]: ...
jpayne@68 36 def keys(self) -> List[_K]: ...
jpayne@68 37 def items(self) -> List[Tuple[_K, _V]]: ...
jpayne@68 38 def values(self) -> List[_V]: ...
jpayne@68 39 def __bool__(self) -> bool: ...
jpayne@68 40 def __getitem__(self, key: _K) -> _V: ...
jpayne@68 41 def get(self, key: _K, default: _D = ...) -> Union[_D, _V]: ...
jpayne@68 42
jpayne@68 43 class VariantHeaderRecord(_Mapping[str, str]):
jpayne@68 44 @property
jpayne@68 45 def header(self) -> VariantHeader: ...
jpayne@68 46 @property
jpayne@68 47 def type(self) -> Optional[str]: ...
jpayne@68 48 @property
jpayne@68 49 def key(self) -> Optional[str]: ...
jpayne@68 50 @property
jpayne@68 51 def value(self) -> Optional[str]: ...
jpayne@68 52 @property
jpayne@68 53 def attrs(self) -> Sequence[Tuple[str, str]]: ...
jpayne@68 54 def update(self, items: Union[Iterable, Dict] = ..., **kwargs) -> None: ...
jpayne@68 55 def pop(self, key: str, default: str = ...) -> str: ...
jpayne@68 56 def remove(self) -> None: ... # crashes
jpayne@68 57
jpayne@68 58 class VariantHeaderRecords:
jpayne@68 59 @property
jpayne@68 60 def header(self) -> VariantHeader: ...
jpayne@68 61 def __len__(self) -> int: ...
jpayne@68 62 def __bool__(self) -> bool: ...
jpayne@68 63 def __getitem__(self, index) -> VariantHeaderRecord: ...
jpayne@68 64 def __iter__(self) -> Iterator[VariantHeaderRecord]: ...
jpayne@68 65
jpayne@68 66 class VariantMetadata:
jpayne@68 67 @property
jpayne@68 68 def header(self) -> VariantHeader: ...
jpayne@68 69 @property
jpayne@68 70 def name(self) -> str: ...
jpayne@68 71 # @property # should this be exposed?
jpayne@68 72 # def id(self) -> int: ...
jpayne@68 73 @property
jpayne@68 74 def number(self) -> Optional[str]: ...
jpayne@68 75 @property
jpayne@68 76 def type(self) -> Optional[str]: ...
jpayne@68 77 @property
jpayne@68 78 def description(self) -> Optional[str]: ...
jpayne@68 79 @property
jpayne@68 80 def record(self) -> Optional[VariantHeaderRecord]: ...
jpayne@68 81 def remove_header(self) -> None: ...
jpayne@68 82
jpayne@68 83 class VariantHeaderMetadata(_Mapping[str, VariantMetadata]):
jpayne@68 84 @property
jpayne@68 85 def header(self) -> VariantHeader: ...
jpayne@68 86 def add(
jpayne@68 87 self,
jpayne@68 88 id: str,
jpayne@68 89 number: Optional[Union[int, str]],
jpayne@68 90 type: Optional[str],
jpayne@68 91 description: str,
jpayne@68 92 **kwargs
jpayne@68 93 ) -> None: ...
jpayne@68 94 def remove_header(self, key: str) -> None: ...
jpayne@68 95 def clear_header(self) -> None: ...
jpayne@68 96
jpayne@68 97 class VariantContig:
jpayne@68 98 @property
jpayne@68 99 def header(self) -> VariantHeader: ...
jpayne@68 100 @property
jpayne@68 101 def name(self) -> str: ...
jpayne@68 102 @property
jpayne@68 103 def id(self) -> int: ...
jpayne@68 104 @property
jpayne@68 105 def length(self) -> Optional[int]: ...
jpayne@68 106 @property
jpayne@68 107 def header_record(self) -> VariantHeaderRecord: ...
jpayne@68 108 def remove_header(self) -> None: ...
jpayne@68 109
jpayne@68 110 class VariantHeaderContigs(_Mapping[Union[int, str], VariantContig]):
jpayne@68 111 @property
jpayne@68 112 def header(self) -> VariantHeader: ...
jpayne@68 113 def remove_header(self, key: Union[int, str]) -> None: ...
jpayne@68 114 def clear_header(self) -> None: ...
jpayne@68 115 def add(self, id: str, length: Optional[int] = ..., **kwargs) -> None: ...
jpayne@68 116
jpayne@68 117 class VariantHeaderSamples:
jpayne@68 118 @property
jpayne@68 119 def header(self) -> VariantHeader: ...
jpayne@68 120 def __len__(self) -> int: ...
jpayne@68 121 def __bool__(self) -> bool: ...
jpayne@68 122 def __getitem__(self, index: int) -> str: ...
jpayne@68 123 def __iter__(self) -> Iterator[str]: ...
jpayne@68 124 def __contains__(self, key: str) -> bool: ...
jpayne@68 125 def add(self, name: str) -> None: ...
jpayne@68 126
jpayne@68 127 class VariantHeader:
jpayne@68 128 def __init__(self) -> None: ...
jpayne@68 129 def __bool__(self) -> bool: ...
jpayne@68 130 def copy(self) -> VariantHeader: ...
jpayne@68 131 def merge(self, header: VariantHeader) -> None: ...
jpayne@68 132 @property
jpayne@68 133 def version(self) -> str: ...
jpayne@68 134 @property
jpayne@68 135 def samples(self) -> VariantHeaderSamples: ...
jpayne@68 136 @property
jpayne@68 137 def records(self) -> VariantHeaderRecords: ...
jpayne@68 138 @property
jpayne@68 139 def contigs(self) -> VariantHeaderContigs: ...
jpayne@68 140 @property
jpayne@68 141 def filters(self) -> VariantHeaderMetadata: ...
jpayne@68 142 @property
jpayne@68 143 def info(self) -> VariantHeaderMetadata: ...
jpayne@68 144 @property
jpayne@68 145 def formats(self) -> VariantHeaderMetadata: ...
jpayne@68 146 @property
jpayne@68 147 def alts(self) -> Dict[str, VariantHeaderRecord]: ...
jpayne@68 148 def new_record(
jpayne@68 149 self,
jpayne@68 150 contig: Optional[str] = ...,
jpayne@68 151 start: int = ...,
jpayne@68 152 stop: int = ...,
jpayne@68 153 alleles: Optional[Tuple[str, ...]] = ...,
jpayne@68 154 id: Optional[str] = ...,
jpayne@68 155 qual: Optional[float] = ...,
jpayne@68 156 filter: Optional[Any] = ...,
jpayne@68 157 info: Optional[Mapping[str, _InfoValue]] = ...,
jpayne@68 158 samples: Optional[Iterable[Optional[Mapping[str, _FormatValue]]]] = ...,
jpayne@68 159 **kwargs
jpayne@68 160 ) -> VariantRecord: ...
jpayne@68 161 def add_record(self, record: VariantHeaderRecord) -> None: ...
jpayne@68 162 def add_line(self, line: str) -> None: ...
jpayne@68 163 @overload
jpayne@68 164 def add_meta(
jpayne@68 165 self, key: str, value: None = ..., items: Iterable[Tuple[str, str]] = ...
jpayne@68 166 ) -> None: ...
jpayne@68 167 @overload
jpayne@68 168 def add_meta(self, key: str, value: str = ..., items: None = ...) -> None: ...
jpayne@68 169 def add_sample(self, name: str) -> None: ...
jpayne@68 170 def add_samples(self, *args: Union[str, Iterable[str]]) -> None: ...
jpayne@68 171
jpayne@68 172 class VariantRecordFilter(_Mapping[Union[int, str], VariantMetadata]):
jpayne@68 173 def add(self, key: str) -> None: ...
jpayne@68 174 def __delitem__(self, key: Union[int, str]) -> None: ...
jpayne@68 175 def clear(self) -> None: ...
jpayne@68 176 def __eq__(self, other) -> bool: ...
jpayne@68 177 def __ne__(self, other) -> bool: ...
jpayne@68 178
jpayne@68 179 class VariantRecordFormat(_Mapping[str, VariantMetadata]):
jpayne@68 180 def __delitem__(self, key: str) -> None: ...
jpayne@68 181 def clear(self) -> None: ...
jpayne@68 182
jpayne@68 183 _InfoValue = Any # TODO see bcf_info_get_value
jpayne@68 184
jpayne@68 185 class VariantRecordInfo(_Mapping[str, _InfoValue]):
jpayne@68 186 def __setitem__(self, key: str, object: _InfoValue) -> None: ...
jpayne@68 187 def __delitem__(self, key: str) -> None: ...
jpayne@68 188 def clear(self) -> None: ...
jpayne@68 189 def update(
jpayne@68 190 self, items: Optional[_Mapping[str, _InfoValue]] = ..., **kwargs
jpayne@68 191 ) -> None: ...
jpayne@68 192 def pop(self, key: str, default: _D = ...) -> Union[_D, _InfoValue]: ...
jpayne@68 193 def __eq__(self, other) -> bool: ...
jpayne@68 194 def __ne__(self, other) -> bool: ...
jpayne@68 195
jpayne@68 196 class VariantRecordSamples(_Mapping[Union[str, int], "VariantRecordSample"]):
jpayne@68 197 def __eq__(self, other) -> bool: ...
jpayne@68 198 def __ne__(self, other) -> bool: ...
jpayne@68 199 # TODO Do these work? Isn’t the container read only?
jpayne@68 200 def update(
jpayne@68 201 self,
jpayne@68 202 items: Optional[Mapping[Union[str, int], VariantRecordSample]] = ...,
jpayne@68 203 **kwargs
jpayne@68 204 ) -> None: ...
jpayne@68 205 def pop(
jpayne@68 206 self, key: Union[str, int], default: _D = ...
jpayne@68 207 ) -> Union[_D, VariantRecordSample]: ...
jpayne@68 208
jpayne@68 209 class VariantRecord:
jpayne@68 210 @property
jpayne@68 211 def header(self) -> VariantHeader: ...
jpayne@68 212 def copy(self) -> VariantRecord: ...
jpayne@68 213 def translate(self, dst_header: VariantHeader) -> None: ...
jpayne@68 214 rid: int
jpayne@68 215 chrom: str
jpayne@68 216 contig: str
jpayne@68 217 pos: int
jpayne@68 218 start: int
jpayne@68 219 stop: int
jpayne@68 220 rlen: int
jpayne@68 221 qual: Optional[float]
jpayne@68 222 id: Optional[str]
jpayne@68 223 ref: Optional[str]
jpayne@68 224 alleles: Optional[Tuple[str, ...]]
jpayne@68 225 alts: Optional[Tuple[str, ...]]
jpayne@68 226 @property
jpayne@68 227 def filter(self) -> VariantRecordFilter: ...
jpayne@68 228 @property
jpayne@68 229 def info(self) -> VariantRecordInfo: ...
jpayne@68 230 @property
jpayne@68 231 def format(self) -> VariantRecordFormat: ...
jpayne@68 232 @property
jpayne@68 233 def samples(self) -> VariantRecordSamples: ...
jpayne@68 234 def __eq__(self, other) -> bool: ...
jpayne@68 235 def __ne__(self, other) -> bool: ...
jpayne@68 236
jpayne@68 237 _FormatValue = Any # TODO see bcf_format_get_value
jpayne@68 238
jpayne@68 239 class VariantRecordSample(_Mapping[str, _FormatValue]):
jpayne@68 240 @property
jpayne@68 241 def index(self) -> int: ...
jpayne@68 242 @property
jpayne@68 243 def name(self) -> str: ...
jpayne@68 244 allele_indices: Optional[Tuple[Optional[int], ...]]
jpayne@68 245 alleles: Optional[Tuple[Optional[str], ...]]
jpayne@68 246 phased: bool
jpayne@68 247 def __setitem__(self, key: str, value: _FormatValue) -> None: ...
jpayne@68 248 def __delitem__(self, key: str) -> None: ...
jpayne@68 249 def clear(self) -> None: ...
jpayne@68 250 def update(
jpayne@68 251 self, items: Optional[Mapping[str, _FormatValue]] = ..., **kwargs
jpayne@68 252 ) -> None: ...
jpayne@68 253 def pop(self, key: str, default: _D = ...) -> Union[_D, _FormatValue]: ...
jpayne@68 254 def __eq__(self, other) -> Any: ...
jpayne@68 255 def __ne__(self, other) -> Any: ...
jpayne@68 256
jpayne@68 257 class BaseIndex(_Mapping[Union[int, str], str]):
jpayne@68 258 refs: Sequence[str]
jpayne@68 259 refmap: Dict[str, str]
jpayne@68 260 def __init__(self) -> None: ...
jpayne@68 261 # TODO Do these work? Isn’t the container read only?
jpayne@68 262 def update(self, items: Optional[Mapping[str, str]] = ..., **kwargs) -> None: ...
jpayne@68 263 def pop(self, key: str, default: _D = ...) -> Union[_D, str]: ...
jpayne@68 264
jpayne@68 265 class BCFIndex(BaseIndex):
jpayne@68 266 @property
jpayne@68 267 def header(self) -> VariantHeader: ...
jpayne@68 268 def __init__(self) -> None: ...
jpayne@68 269 def fetch(
jpayne@68 270 self,
jpayne@68 271 bcf: VariantFile,
jpayne@68 272 contig: str,
jpayne@68 273 start: Optional[int],
jpayne@68 274 stop: Optional[int],
jpayne@68 275 reopen: bool,
jpayne@68 276 ) -> BCFIterator: ...
jpayne@68 277
jpayne@68 278 class TabixIndex(BaseIndex):
jpayne@68 279 def __init__(self) -> None: ...
jpayne@68 280 def fetch(
jpayne@68 281 self,
jpayne@68 282 bcf: VariantFile,
jpayne@68 283 contig: str,
jpayne@68 284 start: Optional[int],
jpayne@68 285 stop: Optional[int],
jpayne@68 286 reopen: bool,
jpayne@68 287 ) -> TabixIterator: ...
jpayne@68 288
jpayne@68 289 class BaseIterator:
jpayne@68 290 def __init__(self) -> None: ...
jpayne@68 291
jpayne@68 292 class BCFIterator(BaseIterator):
jpayne@68 293 def __init__(
jpayne@68 294 self,
jpayne@68 295 bcf: VariantFile,
jpayne@68 296 contig: str,
jpayne@68 297 start: Optional[int] = ...,
jpayne@68 298 stop: Optional[int] = ...,
jpayne@68 299 reopen: bool = ...,
jpayne@68 300 ) -> None: ...
jpayne@68 301 def __iter__(self) -> BCFIterator: ...
jpayne@68 302 def __next__(self) -> VariantRecord: ...
jpayne@68 303
jpayne@68 304 class TabixIterator(BaseIterator):
jpayne@68 305 def __init__(
jpayne@68 306 self,
jpayne@68 307 bcf: VariantFile,
jpayne@68 308 contig: str,
jpayne@68 309 start: Optional[int] = ...,
jpayne@68 310 stop: Optional[int] = ...,
jpayne@68 311 reopen: bool = ...,
jpayne@68 312 ) -> None: ...
jpayne@68 313 def __iter__(self) -> TabixIterator: ...
jpayne@68 314 def __next__(self) -> VariantRecord: ...
jpayne@68 315
jpayne@68 316 class VariantFile(HTSFile):
jpayne@68 317 @property
jpayne@68 318 def header(self) -> VariantHeader: ...
jpayne@68 319 @property
jpayne@68 320 def index(self) -> BaseIndex: ...
jpayne@68 321 @property
jpayne@68 322 def drop_samples(self) -> bool: ...
jpayne@68 323 @property
jpayne@68 324 def is_reading(self) -> bool: ...
jpayne@68 325 @property
jpayne@68 326 def header_written(self) -> bool: ...
jpayne@68 327 def __init__(
jpayne@68 328 self,
jpayne@68 329 filename: Union[str, bytes, int, _HasFileNo],
jpayne@68 330 mode: Optional[Literal["r", "w", "wh", "rb", "wb", "wbu", "wb0"]] = ...,
jpayne@68 331 index_filename: Optional[str] = ...,
jpayne@68 332 header: Optional[VariantHeader] = ...,
jpayne@68 333 drop_samples: bool = ...,
jpayne@68 334 duplicate_filehandle: bool = ...,
jpayne@68 335 ignore_truncation: bool = ...,
jpayne@68 336 threads: int = ...,
jpayne@68 337 ) -> None: ...
jpayne@68 338 def close(self) -> None: ...
jpayne@68 339 def __iter__(self) -> VariantFile: ...
jpayne@68 340 def __next__(self) -> VariantRecord: ...
jpayne@68 341 def copy(self) -> VariantFile: ...
jpayne@68 342 def open(
jpayne@68 343 self,
jpayne@68 344 filename: Union[str, bytes, int, _HasFileNo],
jpayne@68 345 mode: Optional[Literal["r", "w", "wh", "rb", "wb", "wbu", "wb0"]] = ...,
jpayne@68 346 index_filename: Optional[str] = ...,
jpayne@68 347 header: Optional[VariantHeader] = ...,
jpayne@68 348 drop_samples: bool = ...,
jpayne@68 349 duplicate_filehandle: bool = ...,
jpayne@68 350 ignore_truncation: bool = ...,
jpayne@68 351 threads: int = ...,
jpayne@68 352 ) -> None: ...
jpayne@68 353 def reset(self) -> None: ...
jpayne@68 354 def is_valid_tid(self, tid: int) -> bool: ...
jpayne@68 355 def get_tid(self, reference: str) -> int: ...
jpayne@68 356 def get_reference_name(self, tid: int) -> str: ...
jpayne@68 357 def fetch(
jpayne@68 358 self,
jpayne@68 359 contig: Optional[str] = ...,
jpayne@68 360 start: Optional[int] = ...,
jpayne@68 361 stop: Optional[int] = ...,
jpayne@68 362 region: Optional[str] = ...,
jpayne@68 363 reopen: bool = ...,
jpayne@68 364 end: Optional[int] = ...,
jpayne@68 365 reference: Optional[str] = ...,
jpayne@68 366 ) -> Iterator[VariantRecord]: ...
jpayne@68 367 def new_record(self, *args, **kwargs) -> Any: ...
jpayne@68 368 def write(self, record: VariantRecord) -> int: ...
jpayne@68 369 def subset_samples(self, include_samples: Iterable[str]) -> None: ...