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