deepbiop.utils ============== .. py:module:: deepbiop.utils Classes ------- .. autoapisummary:: deepbiop.utils.GenomicInterval deepbiop.utils.PslAlignment deepbiop.utils.CompressedType deepbiop.utils.SequenceFileType Functions --------- .. autoapisummary:: deepbiop.utils.check_compressed_type deepbiop.utils.generate_unmaped_intervals deepbiop.utils.highlight_targets deepbiop.utils.majority_voting deepbiop.utils.parse_psl_by_qname deepbiop.utils.remove_intervals_and_keep_left Module Contents --------------- .. py:class:: GenomicInterval A segment is a genomic interval defined by a chromosome, a start position and an end position. The start position is inclusive and the end position is exclusive. .. py:property:: start :type: int .. py:property:: end :type: int .. py:property:: chr :type: str .. py:method:: overlap(other) .. py:method:: __repr__() .. py:class:: PslAlignment .. py:property:: qname :type: str .. py:property:: qsize :type: int .. py:property:: qstart :type: int .. py:property:: qend :type: int .. py:property:: qmatch :type: int .. py:property:: tname :type: str .. py:property:: tsize :type: int .. py:property:: tstart :type: int .. py:property:: tend :type: int .. py:property:: identity :type: float .. py:method:: __repr__() .. py:class:: CompressedType Bases: :py:obj:`enum.Enum` Represents different types of file compression formats. This enum is used to identify and handle various compression formats commonly used for files. It can be used in Python through the deepbiop.utils module. # Variants * `Uncompress` - Uncompressed/raw file format * `Gzip` - Standard gzip compression (.gz files) * `Bgzip` - Blocked gzip format, commonly used in bioinformatics * `Zip` - ZIP archive format * `Bzip2` - bzip2 compression format * `Xz` - XZ compression format (LZMA2) * `Zstd` - Zstandard compression format * `Unknown` - Unknown or unrecognized compression format .. py:attribute:: Uncompress :value: Ellipsis .. py:attribute:: Gzip :value: Ellipsis .. py:attribute:: Bgzip :value: Ellipsis .. py:attribute:: Zip :value: Ellipsis .. py:attribute:: Bzip2 :value: Ellipsis .. py:attribute:: Xz :value: Ellipsis .. py:attribute:: Zstd :value: Ellipsis .. py:attribute:: Unknown :value: Ellipsis .. py:class:: SequenceFileType Bases: :py:obj:`enum.Enum` Represents different types of sequence file formats. .. py:attribute:: Fasta :value: Ellipsis .. py:attribute:: Fastq :value: Ellipsis .. py:attribute:: Unknown :value: Ellipsis .. py:function:: check_compressed_type(path) Check the compression type of a file. :param path: Path to the file to check :rtype: The compression type of the file (None, Gzip, Bzip2, Xz) :raises IOError: If the file cannot be opened or read: .. py:function:: generate_unmaped_intervals(input, total_length) .. py:function:: highlight_targets(sequence, targets, text_width = None) .. py:function:: majority_voting(labels, window_size) .. py:function:: parse_psl_by_qname(file_path) Parse PSL file by query name. .. py:function:: remove_intervals_and_keep_left(seq, intervals)