annotate CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/lib/python3.8/site-packages/pysam/libcalignedsegment.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 enum
jpayne@68 2 import re
jpayne@68 3 import sys
jpayne@68 4 from array import array
jpayne@68 5 from typing import Any, List, Optional, Dict, Tuple, Union, overload
jpayne@68 6
jpayne@68 7 if sys.version_info < (3, 8):
jpayne@68 8 from typing_extensions import Literal
jpayne@68 9 else:
jpayne@68 10 from typing import Literal
jpayne@68 11
jpayne@68 12 from pysam import AlignmentHeader # type: ignore
jpayne@68 13
jpayne@68 14 CMATCH: int
jpayne@68 15 CINS: int
jpayne@68 16 CDEL: int
jpayne@68 17 CREF_SKIP: int
jpayne@68 18 CSOFT_CLIP: int
jpayne@68 19 CHARD_CLIP: int
jpayne@68 20 CPAD: int
jpayne@68 21 CEQUAL: int
jpayne@68 22 CDIFF: int
jpayne@68 23 CBACK: int
jpayne@68 24
jpayne@68 25 FPAIRED: int
jpayne@68 26 FPROPER_PAIR: int
jpayne@68 27 FUNMAP: int
jpayne@68 28 FMUNMAP: int
jpayne@68 29 FREVERSE: int
jpayne@68 30 FMREVERSE: int
jpayne@68 31 FREAD1: int
jpayne@68 32 FREAD2: int
jpayne@68 33 FSECONDARY: int
jpayne@68 34 FQCFAIL: int
jpayne@68 35 FDUP: int
jpayne@68 36 FSUPPLEMENTARY: int
jpayne@68 37
jpayne@68 38 CIGAR2CODE: Dict[int, str]
jpayne@68 39 CIGAR_REGEX: re.Pattern
jpayne@68 40 DATATYPE2FORMAT: Dict[int, Tuple[str, int]]
jpayne@68 41 KEY_NAMES: List[str]
jpayne@68 42
jpayne@68 43 TagValue = Union[str, int, float, array]
jpayne@68 44
jpayne@68 45 class CIGAR_OPS(enum.IntEnum):
jpayne@68 46 CBACK = ...
jpayne@68 47 CDEL = ...
jpayne@68 48 CDIFF = ...
jpayne@68 49 CEQUAL = ...
jpayne@68 50 CHARD_CLIP = ...
jpayne@68 51 CINS = ...
jpayne@68 52 CMATCH = ...
jpayne@68 53 CPAD = ...
jpayne@68 54 CREF_SKIP = ...
jpayne@68 55 CSOFT_CLIP = ...
jpayne@68 56
jpayne@68 57 class SAM_FLAGS(enum.IntEnum):
jpayne@68 58 FDUP = ...
jpayne@68 59 FMREVERSE = ...
jpayne@68 60 FMUNMAP = ...
jpayne@68 61 FPAIRED = ...
jpayne@68 62 FPROPER_PAIR = ...
jpayne@68 63 FQCFAIL = ...
jpayne@68 64 FREAD1 = ...
jpayne@68 65 FREAD2 = ...
jpayne@68 66 FREVERSE = ...
jpayne@68 67 FSECONDARY = ...
jpayne@68 68 FSUPPLEMENTARY = ...
jpayne@68 69 FUNMAP = ...
jpayne@68 70
jpayne@68 71 class AlignedSegment:
jpayne@68 72 header: AlignmentHeader
jpayne@68 73 query_name: Optional[str]
jpayne@68 74 flag: int
jpayne@68 75 reference_name: Optional[str]
jpayne@68 76 reference_id: int
jpayne@68 77 reference_start: int
jpayne@68 78 mapping_quality: int
jpayne@68 79 cigarstring: Optional[str]
jpayne@68 80 next_reference_id: int
jpayne@68 81 next_reference_name: Optional[str]
jpayne@68 82 next_reference_start: int
jpayne@68 83 template_length: int
jpayne@68 84 query_sequence: Optional[str]
jpayne@68 85 query_qualities: Optional[array]
jpayne@68 86 bin: int
jpayne@68 87 is_paired: bool
jpayne@68 88 is_proper_pair: bool
jpayne@68 89 is_unmapped: bool
jpayne@68 90 mate_is_unmapped: bool
jpayne@68 91 is_mapped: bool
jpayne@68 92 mate_is_mapped: bool
jpayne@68 93 is_reverse: bool
jpayne@68 94 mate_is_reverse: bool
jpayne@68 95 is_forward: bool
jpayne@68 96 mate_is_forward: bool
jpayne@68 97 is_read1: bool
jpayne@68 98 is_read2: bool
jpayne@68 99 is_secondary: bool
jpayne@68 100 is_qcfail: bool
jpayne@68 101 is_duplicate: bool
jpayne@68 102 is_supplementary: bool
jpayne@68 103 cigartuples: Optional[List[Tuple[int, int]]]
jpayne@68 104 def __init__(self, header: Optional[AlignmentHeader] = ...) -> None: ...
jpayne@68 105 def compare(self, other: Any) -> int: ...
jpayne@68 106 def to_string(self) -> str: ...
jpayne@68 107 @classmethod
jpayne@68 108 def fromstring(cls, sam: str, header: AlignmentHeader) -> AlignedSegment: ...
jpayne@68 109 def to_dict(self) -> Dict: ...
jpayne@68 110 @classmethod
jpayne@68 111 def from_dict(cls, sam_dict: Dict[str, Any], header: AlignmentHeader) -> Any: ...
jpayne@68 112 def get_reference_positions(self, full_length: bool = ...) -> List[int]: ...
jpayne@68 113 @property
jpayne@68 114 def query_length(self) -> int: ...
jpayne@68 115 @property
jpayne@68 116 def reference_end(self) -> Optional[int]: ...
jpayne@68 117 @property
jpayne@68 118 def reference_length(self) -> Optional[int]: ...
jpayne@68 119 @property
jpayne@68 120 def query_alignment_sequence(self) -> Optional[str]: ...
jpayne@68 121 @property
jpayne@68 122 def query_alignment_qualities(self) -> Optional[array]: ...
jpayne@68 123 @property
jpayne@68 124 def query_alignment_start(self) -> int: ...
jpayne@68 125 @property
jpayne@68 126 def query_alignment_end(self) -> int: ...
jpayne@68 127 @property
jpayne@68 128 def modified_bases(self) -> Optional[Dict[Tuple[str, int, str], List[Tuple[int, int]]]]: ...
jpayne@68 129 @property
jpayne@68 130 def modified_bases_forward(self) -> Optional[Dict[Tuple[str, int, str], List[Tuple[int, int]]]]: ...
jpayne@68 131 @property
jpayne@68 132 def query_alignment_length(self) -> int: ...
jpayne@68 133 def infer_query_length(self) -> Optional[int]: ...
jpayne@68 134 def infer_read_length(self) -> Optional[int]: ...
jpayne@68 135 def get_reference_sequence(self) -> str: ...
jpayne@68 136 def get_forward_sequence(self) -> Optional[str]: ...
jpayne@68 137 def get_forward_qualities(self) -> Optional[array]: ...
jpayne@68 138 def get_aligned_pairs(
jpayne@68 139 self, matches_only: bool = ..., with_seq: bool = ..., with_cigar: bool = ...
jpayne@68 140 ) -> List[Tuple[int, int]]: ...
jpayne@68 141 def get_blocks(self) -> List[Tuple[int, int]]: ...
jpayne@68 142 def get_overlap(self, start: int, end: int) -> Optional[int]: ...
jpayne@68 143 def get_cigar_stats(self) -> Tuple[array, array]: ...
jpayne@68 144 def set_tag(
jpayne@68 145 self,
jpayne@68 146 tag: str,
jpayne@68 147 value: Union[int, float, str, bytes, array, List, Tuple, None],
jpayne@68 148 value_type: Optional[
jpayne@68 149 Literal["A", "i", "f", "Z", "H", "B", "c", "C", "s", "S", "I"]
jpayne@68 150 ] = ...,
jpayne@68 151 replace: bool = ...,
jpayne@68 152 ) -> None: ...
jpayne@68 153 def has_tag(self, tag: str) -> bool: ...
jpayne@68 154 @overload
jpayne@68 155 def get_tag(self, tag: str, with_value_type: Literal[False] = ...) -> TagValue: ...
jpayne@68 156 @overload
jpayne@68 157 def get_tag(
jpayne@68 158 self, tag: str, with_value_type: Literal[True]
jpayne@68 159 ) -> Tuple[TagValue, str]: ...
jpayne@68 160 @overload
jpayne@68 161 def get_tag(
jpayne@68 162 self, tag: str, with_value_type: bool
jpayne@68 163 ) -> Union[TagValue, Tuple[TagValue, str]]: ...
jpayne@68 164 @overload
jpayne@68 165 def get_tags(
jpayne@68 166 self, with_value_type: Literal[False] = ...
jpayne@68 167 ) -> List[Tuple[str, TagValue]]: ...
jpayne@68 168 @overload
jpayne@68 169 def get_tags(
jpayne@68 170 self, with_value_type: Literal[True]
jpayne@68 171 ) -> List[Tuple[str, TagValue, str]]: ...
jpayne@68 172 @overload
jpayne@68 173 def get_tags(
jpayne@68 174 self, with_value_type: bool
jpayne@68 175 ) -> Union[List[Tuple[str, TagValue]], List[Tuple[str, TagValue, str]]]: ...
jpayne@68 176 @overload
jpayne@68 177 def get_tags(
jpayne@68 178 self, with_value_type: bool = ...
jpayne@68 179 ) -> Union[List[Tuple[str, TagValue, str]], List[Tuple[str, TagValue]]]: ...
jpayne@68 180 def set_tags(self, tags: Any) -> None: ...
jpayne@68 181 def __eq__(self, other): ...
jpayne@68 182 def __ge__(self, other): ...
jpayne@68 183 def __gt__(self, other): ...
jpayne@68 184 def __le__(self, other): ...
jpayne@68 185 def __lt__(self, other): ...
jpayne@68 186 def __ne__(self, other): ...
jpayne@68 187
jpayne@68 188 class PileupRead:
jpayne@68 189 @property
jpayne@68 190 def alignment(self) -> AlignedSegment: ...
jpayne@68 191 @property
jpayne@68 192 def query_position(self) -> Optional[int]: ...
jpayne@68 193 @property
jpayne@68 194 def query_position_or_next(self) -> int: ...
jpayne@68 195 @property
jpayne@68 196 def indel(self) -> int: ...
jpayne@68 197 @property
jpayne@68 198 def level(self) -> int: ...
jpayne@68 199 @property
jpayne@68 200 def is_del(self) -> int: ...
jpayne@68 201 @property
jpayne@68 202 def is_head(self) -> int: ...
jpayne@68 203 @property
jpayne@68 204 def is_tail(self) -> int: ...
jpayne@68 205 @property
jpayne@68 206 def is_refskip(self) -> int: ...
jpayne@68 207
jpayne@68 208 class PileupColumn:
jpayne@68 209 nsegments: int
jpayne@68 210 def set_min_base_quality(self, min_base_quality: int) -> None: ...
jpayne@68 211 def __len__(self) -> int: ...
jpayne@68 212 @property
jpayne@68 213 def reference_id(self) -> int: ...
jpayne@68 214 @property
jpayne@68 215 def reference_name(self) -> Optional[str]: ...
jpayne@68 216 @property
jpayne@68 217 def reference_pos(self) -> int: ...
jpayne@68 218 @property
jpayne@68 219 def pileups(self) -> List[PileupRead]: ...
jpayne@68 220 def get_num_aligned(self) -> int: ...
jpayne@68 221 def get_query_sequences(
jpayne@68 222 self,
jpayne@68 223 mark_matches: bool = ...,
jpayne@68 224 mark_ends: bool = ...,
jpayne@68 225 add_indels: bool = ...,
jpayne@68 226 ) -> List[str]: ...
jpayne@68 227 def get_query_qualities(self) -> List[int]: ...
jpayne@68 228 def get_mapping_qualities(self) -> List[int]: ...
jpayne@68 229 def get_query_positions(self) -> List[int]: ...
jpayne@68 230 def get_query_names(self) -> List[str]: ...