deepbiop.utils¶
Classes¶
A segment is a genomic interval defined by a chromosome, a start position and an end position. |
|
Represents different types of file compression formats. |
|
Represents different types of sequence file formats. |
Functions¶
|
Check the compression type of a file. |
|
|
|
|
|
|
|
Parse PSL file by query name. |
|
Module Contents¶
- class deepbiop.utils.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.
- overlap(other)¶
- Parameters:
other (GenomicInterval)
- Return type:
- class deepbiop.utils.PslAlignment¶
- class deepbiop.utils.CompressedType¶
Bases:
enum.EnumRepresents 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
- Uncompress = Ellipsis¶
- Gzip = Ellipsis¶
- Bgzip = Ellipsis¶
- Zip = Ellipsis¶
- Bzip2 = Ellipsis¶
- Xz = Ellipsis¶
- Zstd = Ellipsis¶
- Unknown = Ellipsis¶
- class deepbiop.utils.SequenceFileType¶
Bases:
enum.EnumRepresents different types of sequence file formats.
- Fasta = Ellipsis¶
- Fastq = Ellipsis¶
- Unknown = Ellipsis¶
- deepbiop.utils.check_compressed_type(path)¶
Check the compression type of a file.
- Parameters:
path (str | os.PathLike | pathlib.Path) – Path to the file to check
- Return type:
The compression type of the file (None, Gzip, Bzip2, Xz)
- Raises:
IOError – If the file cannot be opened or read:
- deepbiop.utils.generate_unmaped_intervals(input, total_length)¶
- deepbiop.utils.highlight_targets(sequence, targets, text_width=None)¶
- deepbiop.utils.majority_voting(labels, window_size)¶
- deepbiop.utils.parse_psl_by_qname(file_path)¶
Parse PSL file by query name.
- Parameters:
file_path (str | os.PathLike | pathlib.Path)
- Return type:
dict[str, list[PslAlignment]]