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