deepbiop.fq

Classes

Functions

convert_multiple_fqs_to_one_fq(paths, result_path, ...)

encode_fq_path_to_parquet(fq_path, bases, qual_offset)

encode_fq_path_to_parquet_chunk(fq_path, chunk_size, ...)

encode_fq_paths_to_parquet(fq_path, bases, qual_offset)

encode_qual(qual, qual_offset)

Convert ASCII quality to Phred score for Phred+33 encoding.

fastq_to_fasta(fastq_path, fasta_path)

get_label_region(labels)

load_predicts_from_batch_pt(pt_path, ignore_label, ...)

load_predicts_from_batch_pts(pt_path, ignore_label, ...)

select_record_from_fq(selected_reads, fq, output)

select_record_from_fq_by_random(fq, number, output)

test_predicts(predicts)

write_fq(records_data[, file_path])

write_fq_parallel(records_data, file_path, threads)

Module Contents

class deepbiop.fq.EncoderOption
property qual_offset: int
Return type:

int

property bases: list[int]
Return type:

list[int]

property threads: int
Return type:

int

class deepbiop.fq.FastqDataset
__len__()
Return type:

int

__getitem__(idx)
Parameters:

idx (int)

Return type:

Any

__iter__()
Return type:

FastqIterator

static from_file(file_path, chunk_size)
Parameters:
  • file_path (str)

  • chunk_size (int)

Return type:

FastqDataset

get_stats()
Return type:

Any

get_records(start, end)
Parameters:
Return type:

list[FastqRecord]

get_records_indexed(start, end)
Parameters:
Return type:

list[FastqRecord]

get_records_sequential(start, end)
Parameters:
Return type:

list[FastqRecord]

class deepbiop.fq.FastqIterator
__iter__()
Return type:

FastqIterator

__next__()
Return type:

Any | None

class deepbiop.fq.FastqRecord
property header: str
Return type:

str

property sequence: str
Return type:

str

property quality: str
Return type:

str

__repr__()
Return type:

str

class deepbiop.fq.ParquetEncoder
class deepbiop.fq.Predict

A struct to store the prediction result.

property prediction: list[int]
Return type:

list[int]

property seq: str
Return type:

str

property id: str
Return type:

str

property is_truncated: bool
Return type:

bool

property qual: str | None
Return type:

str | None

__repr__()
Return type:

str

prediction_region()

Get the prediction region.

Return type:

list[tuple[int, int]]

smooth_prediction(window_size)

Get the smooth prediction region.

Parameters:

window_size (int)

Return type:

list[tuple[int, int]]

smooth_label(window_size)

Get the smooth label.

Parameters:

window_size (int)

Return type:

list[int]

smooth_and_select_intervals(smooth_window_size, min_interval_size, append_interval_number)

Smooth and select intervals.

Parameters:
  • smooth_window_size (int)

  • min_interval_size (int)

  • append_interval_number (int)

Return type:

list[tuple[int, int]]

seq_len()

Get the sequence length.

Return type:

int

qual_array()

Get the quality score array.

Return type:

list[int]

show_info(smooth_interval, text_width=None)

Show the information of the prediction.

Parameters:
Return type:

str

__getstate__()
Return type:

Any

__setstate__(state)
Parameters:

state (Any)

Return type:

None

class deepbiop.fq.RecordData
property id: str
Return type:

str

property seq: str
Return type:

str

property qual: str
Return type:

str

deepbiop.fq.convert_multiple_fqs_to_one_fq(paths, result_path, parallel)
Parameters:
Return type:

None

deepbiop.fq.encode_fq_path_to_parquet(fq_path, bases, qual_offset, result_path=None)
Parameters:
Return type:

None

deepbiop.fq.encode_fq_path_to_parquet_chunk(fq_path, chunk_size, parallel, bases, qual_offset)
Parameters:
Return type:

None

deepbiop.fq.encode_fq_paths_to_parquet(fq_path, bases, qual_offset)
Parameters:
Return type:

None

deepbiop.fq.encode_qual(qual, qual_offset)

Convert ASCII quality to Phred score for Phred+33 encoding.

Parameters:
  • qual (str)

  • qual_offset (int)

Return type:

list[int]

deepbiop.fq.fastq_to_fasta(fastq_path, fasta_path)
Parameters:
Return type:

None

deepbiop.fq.get_label_region(labels)
Parameters:

labels (Sequence[int])

Return type:

list[tuple[int, int]]

deepbiop.fq.load_predicts_from_batch_pt(pt_path, ignore_label, id_table)
Parameters:
Return type:

dict[str, Predict]

deepbiop.fq.load_predicts_from_batch_pts(pt_path, ignore_label, id_table, max_predicts=None)
Parameters:
Return type:

dict[str, Predict]

deepbiop.fq.select_record_from_fq(selected_reads, fq, output)
Parameters:
Return type:

None

deepbiop.fq.select_record_from_fq_by_random(fq, number, output)
Parameters:
Return type:

None

deepbiop.fq.test_predicts(predicts)
Parameters:

predicts (Sequence[Predict])

Return type:

None

deepbiop.fq.write_fq(records_data, file_path=None)
Parameters:
Return type:

None

deepbiop.fq.write_fq_parallel(records_data, file_path, threads)
Parameters:
Return type:

None