jpayne@68: import enum jpayne@68: import re jpayne@68: import sys jpayne@68: from array import array jpayne@68: from typing import Any, List, Optional, Dict, Tuple, Union, overload jpayne@68: jpayne@68: if sys.version_info < (3, 8): jpayne@68: from typing_extensions import Literal jpayne@68: else: jpayne@68: from typing import Literal jpayne@68: jpayne@68: from pysam import AlignmentHeader # type: ignore jpayne@68: jpayne@68: CMATCH: int jpayne@68: CINS: int jpayne@68: CDEL: int jpayne@68: CREF_SKIP: int jpayne@68: CSOFT_CLIP: int jpayne@68: CHARD_CLIP: int jpayne@68: CPAD: int jpayne@68: CEQUAL: int jpayne@68: CDIFF: int jpayne@68: CBACK: int jpayne@68: jpayne@68: FPAIRED: int jpayne@68: FPROPER_PAIR: int jpayne@68: FUNMAP: int jpayne@68: FMUNMAP: int jpayne@68: FREVERSE: int jpayne@68: FMREVERSE: int jpayne@68: FREAD1: int jpayne@68: FREAD2: int jpayne@68: FSECONDARY: int jpayne@68: FQCFAIL: int jpayne@68: FDUP: int jpayne@68: FSUPPLEMENTARY: int jpayne@68: jpayne@68: CIGAR2CODE: Dict[int, str] jpayne@68: CIGAR_REGEX: re.Pattern jpayne@68: DATATYPE2FORMAT: Dict[int, Tuple[str, int]] jpayne@68: KEY_NAMES: List[str] jpayne@68: jpayne@68: TagValue = Union[str, int, float, array] jpayne@68: jpayne@68: class CIGAR_OPS(enum.IntEnum): jpayne@68: CBACK = ... jpayne@68: CDEL = ... jpayne@68: CDIFF = ... jpayne@68: CEQUAL = ... jpayne@68: CHARD_CLIP = ... jpayne@68: CINS = ... jpayne@68: CMATCH = ... jpayne@68: CPAD = ... jpayne@68: CREF_SKIP = ... jpayne@68: CSOFT_CLIP = ... jpayne@68: jpayne@68: class SAM_FLAGS(enum.IntEnum): jpayne@68: FDUP = ... jpayne@68: FMREVERSE = ... jpayne@68: FMUNMAP = ... jpayne@68: FPAIRED = ... jpayne@68: FPROPER_PAIR = ... jpayne@68: FQCFAIL = ... jpayne@68: FREAD1 = ... jpayne@68: FREAD2 = ... jpayne@68: FREVERSE = ... jpayne@68: FSECONDARY = ... jpayne@68: FSUPPLEMENTARY = ... jpayne@68: FUNMAP = ... jpayne@68: jpayne@68: class AlignedSegment: jpayne@68: header: AlignmentHeader jpayne@68: query_name: Optional[str] jpayne@68: flag: int jpayne@68: reference_name: Optional[str] jpayne@68: reference_id: int jpayne@68: reference_start: int jpayne@68: mapping_quality: int jpayne@68: cigarstring: Optional[str] jpayne@68: next_reference_id: int jpayne@68: next_reference_name: Optional[str] jpayne@68: next_reference_start: int jpayne@68: template_length: int jpayne@68: query_sequence: Optional[str] jpayne@68: query_qualities: Optional[array] jpayne@68: bin: int jpayne@68: is_paired: bool jpayne@68: is_proper_pair: bool jpayne@68: is_unmapped: bool jpayne@68: mate_is_unmapped: bool jpayne@68: is_mapped: bool jpayne@68: mate_is_mapped: bool jpayne@68: is_reverse: bool jpayne@68: mate_is_reverse: bool jpayne@68: is_forward: bool jpayne@68: mate_is_forward: bool jpayne@68: is_read1: bool jpayne@68: is_read2: bool jpayne@68: is_secondary: bool jpayne@68: is_qcfail: bool jpayne@68: is_duplicate: bool jpayne@68: is_supplementary: bool jpayne@68: cigartuples: Optional[List[Tuple[int, int]]] jpayne@68: def __init__(self, header: Optional[AlignmentHeader] = ...) -> None: ... jpayne@68: def compare(self, other: Any) -> int: ... jpayne@68: def to_string(self) -> str: ... jpayne@68: @classmethod jpayne@68: def fromstring(cls, sam: str, header: AlignmentHeader) -> AlignedSegment: ... jpayne@68: def to_dict(self) -> Dict: ... jpayne@68: @classmethod jpayne@68: def from_dict(cls, sam_dict: Dict[str, Any], header: AlignmentHeader) -> Any: ... jpayne@68: def get_reference_positions(self, full_length: bool = ...) -> List[int]: ... jpayne@68: @property jpayne@68: def query_length(self) -> int: ... jpayne@68: @property jpayne@68: def reference_end(self) -> Optional[int]: ... jpayne@68: @property jpayne@68: def reference_length(self) -> Optional[int]: ... jpayne@68: @property jpayne@68: def query_alignment_sequence(self) -> Optional[str]: ... jpayne@68: @property jpayne@68: def query_alignment_qualities(self) -> Optional[array]: ... jpayne@68: @property jpayne@68: def query_alignment_start(self) -> int: ... jpayne@68: @property jpayne@68: def query_alignment_end(self) -> int: ... jpayne@68: @property jpayne@68: def modified_bases(self) -> Optional[Dict[Tuple[str, int, str], List[Tuple[int, int]]]]: ... jpayne@68: @property jpayne@68: def modified_bases_forward(self) -> Optional[Dict[Tuple[str, int, str], List[Tuple[int, int]]]]: ... jpayne@68: @property jpayne@68: def query_alignment_length(self) -> int: ... jpayne@68: def infer_query_length(self) -> Optional[int]: ... jpayne@68: def infer_read_length(self) -> Optional[int]: ... jpayne@68: def get_reference_sequence(self) -> str: ... jpayne@68: def get_forward_sequence(self) -> Optional[str]: ... jpayne@68: def get_forward_qualities(self) -> Optional[array]: ... jpayne@68: def get_aligned_pairs( jpayne@68: self, matches_only: bool = ..., with_seq: bool = ..., with_cigar: bool = ... jpayne@68: ) -> List[Tuple[int, int]]: ... jpayne@68: def get_blocks(self) -> List[Tuple[int, int]]: ... jpayne@68: def get_overlap(self, start: int, end: int) -> Optional[int]: ... jpayne@68: def get_cigar_stats(self) -> Tuple[array, array]: ... jpayne@68: def set_tag( jpayne@68: self, jpayne@68: tag: str, jpayne@68: value: Union[int, float, str, bytes, array, List, Tuple, None], jpayne@68: value_type: Optional[ jpayne@68: Literal["A", "i", "f", "Z", "H", "B", "c", "C", "s", "S", "I"] jpayne@68: ] = ..., jpayne@68: replace: bool = ..., jpayne@68: ) -> None: ... jpayne@68: def has_tag(self, tag: str) -> bool: ... jpayne@68: @overload jpayne@68: def get_tag(self, tag: str, with_value_type: Literal[False] = ...) -> TagValue: ... jpayne@68: @overload jpayne@68: def get_tag( jpayne@68: self, tag: str, with_value_type: Literal[True] jpayne@68: ) -> Tuple[TagValue, str]: ... jpayne@68: @overload jpayne@68: def get_tag( jpayne@68: self, tag: str, with_value_type: bool jpayne@68: ) -> Union[TagValue, Tuple[TagValue, str]]: ... jpayne@68: @overload jpayne@68: def get_tags( jpayne@68: self, with_value_type: Literal[False] = ... jpayne@68: ) -> List[Tuple[str, TagValue]]: ... jpayne@68: @overload jpayne@68: def get_tags( jpayne@68: self, with_value_type: Literal[True] jpayne@68: ) -> List[Tuple[str, TagValue, str]]: ... jpayne@68: @overload jpayne@68: def get_tags( jpayne@68: self, with_value_type: bool jpayne@68: ) -> Union[List[Tuple[str, TagValue]], List[Tuple[str, TagValue, str]]]: ... jpayne@68: @overload jpayne@68: def get_tags( jpayne@68: self, with_value_type: bool = ... jpayne@68: ) -> Union[List[Tuple[str, TagValue, str]], List[Tuple[str, TagValue]]]: ... jpayne@68: def set_tags(self, tags: Any) -> None: ... jpayne@68: def __eq__(self, other): ... jpayne@68: def __ge__(self, other): ... jpayne@68: def __gt__(self, other): ... jpayne@68: def __le__(self, other): ... jpayne@68: def __lt__(self, other): ... jpayne@68: def __ne__(self, other): ... jpayne@68: jpayne@68: class PileupRead: jpayne@68: @property jpayne@68: def alignment(self) -> AlignedSegment: ... jpayne@68: @property jpayne@68: def query_position(self) -> Optional[int]: ... jpayne@68: @property jpayne@68: def query_position_or_next(self) -> int: ... jpayne@68: @property jpayne@68: def indel(self) -> int: ... jpayne@68: @property jpayne@68: def level(self) -> int: ... jpayne@68: @property jpayne@68: def is_del(self) -> int: ... jpayne@68: @property jpayne@68: def is_head(self) -> int: ... jpayne@68: @property jpayne@68: def is_tail(self) -> int: ... jpayne@68: @property jpayne@68: def is_refskip(self) -> int: ... jpayne@68: jpayne@68: class PileupColumn: jpayne@68: nsegments: int jpayne@68: def set_min_base_quality(self, min_base_quality: int) -> None: ... jpayne@68: def __len__(self) -> int: ... jpayne@68: @property jpayne@68: def reference_id(self) -> int: ... jpayne@68: @property jpayne@68: def reference_name(self) -> Optional[str]: ... jpayne@68: @property jpayne@68: def reference_pos(self) -> int: ... jpayne@68: @property jpayne@68: def pileups(self) -> List[PileupRead]: ... jpayne@68: def get_num_aligned(self) -> int: ... jpayne@68: def get_query_sequences( jpayne@68: self, jpayne@68: mark_matches: bool = ..., jpayne@68: mark_ends: bool = ..., jpayne@68: add_indels: bool = ..., jpayne@68: ) -> List[str]: ... jpayne@68: def get_query_qualities(self) -> List[int]: ... jpayne@68: def get_mapping_qualities(self) -> List[int]: ... jpayne@68: def get_query_positions(self) -> List[int]: ... jpayne@68: def get_query_names(self) -> List[str]: ...