fextract_batch_coverage package

Submodules

fextract_batch_coverage.plugin module

class lbfextract.fextract_batch_coverage.plugin.CliHook[source]

Bases: object

get_command() Command | List[Command][source]
class lbfextract.fextract_batch_coverage.plugin.FextractHooks[source]

Bases: object

fetch_reads(path_to_bam: Path, path_to_bed: Path, config: Any, extra_config: Any) IntervalIterator[source]
Parameters:
  • path_to_bam – path to the bam file

  • path_to_bed – path to the bed file with the regions to be filtered

  • config – configuration file containing the configuration object required by the fetch_reads function

  • extra_config – extra configuration that may be used in the hook implementation

Returns:

ReadsPerIntervalContainer object containing all the ReadsPerInterval objects in all the intervals contained in the bed file

load_fetched_reads(config: Any, extra_config: AppExtraConfig) DataFrame[source]
Parameters:
  • config – config specific to the function

  • extra_config – extra configuration that may be used in the hook implementation

plot_signal(signal: Signal, config: PlotConfig, extra_config: Any) dict[str, Path][source]
Parameters:
  • signal – Signal object containing the signals per interval

  • config – object containing the parameters of the plot

  • extra_config – extra configuration that may be used in the hook implementation

save_fetched_reads(reads_per_interval_container: IntervalIterator, config: Any, extra_config: Any) None[source]

Hook implementing the strategy to save the reads fetched from the intervals :param reads_per_interval_container: ReadsPerIntervalContainer containing information about the genomic region

and the reads mapping to it

Parameters:
  • config – object contaiing the configuration for saving the reads

  • extra_config – extra configuration that may be used in the hook implementation

Returns:

None

save_signal(signal: Signal, config: Any, extra_config: Any) None[source]
Parameters:
  • signal – Signal object containing the signals per interval

  • extra_config – extra configuration that may be used in the hook implementation

transform_all_intervals(single_intervals_transformed_reads: IntervalIterator, config: Any, extra_config: Any) Signal[source]
Parameters:
  • single_intervals_transformed_reads – Signal object containing the signals per interval

  • config – config specific to the function

  • extra_config – extra configuration that may be used in the hook implementation

transform_single_intervals(transformed_reads: IntervalIterator, config: Any, extra_config: Any) IntervalIterator[source]
Parameters:
  • transformed_reads – ReadsPerIntervalContainer containing a list of ReadsPerInterval which are basically lists with information about start and end of the interval

  • config – config specific to the function

  • extra_config – config containing context information plus extra parameters

class lbfextract.fextract_batch_coverage.plugin.IntervalIterator(df: DataFrame, path_to_bam: Path, multiple_iterators: bool, extra_bases: int, flanking_window: int, flip_based_on_strand: bool | None = None)[source]

Bases: object

set_signal_summarizer(signal_summarizer)[source]
set_signal_transformer(signal_transformer)[source]
lbfextract.fextract_batch_coverage.plugin.extract_coverage(coverage_extractor, transformed_reads)[source]
lbfextract.fextract_batch_coverage.plugin.identity(x, axis=None)[source]

fextract_batch_coverage.schemas module

class lbfextract.fextract_batch_coverage.schemas.PlotConfig(config_dict: dict | None = None)[source]

Bases: Config

annotation_center_line: str = None
apply_savgol: bool = None
bottom: int = None
color: str = None
flanking: int = None
general_font_size: int = None
savgol_polyorder: int = None
savgol_window_length: int = None
schema = <Schema({'title_font_size': Coerce(int, msg='title_font_size should be a integer'), 'general_font_size': Coerce(int, msg='general_font_size should be a integer'), 'tf_to_annotate': typing.List[str], 'ylabel': <class 'str'>, 'flanking': Coerce(int, msg='flanking should be a integer'), 'annotation_center_line': <class 'str'>, 'apply_savgol': <class 'bool'>, 'savgol_window_length': Coerce(int, msg='savgol_window_length should be a integer'), 'savgol_polyorder': Coerce(int, msg='savgol_polyorder should be a integer'), 'color': <class 'str'>, 'xlabel': <class 'str'>, 'window_center': Coerce(int, msg='window_center should be a integer'), 'top': Coerce(int, msg='top should be a integer'), 'bottom': Coerce(int, msg='bottom should be a integer')}, extra=PREVENT_EXTRA, required=False) object>
tf_to_annotate: List[str] = None
title_font_size: int = None
top: int = None
window_center: int = None
xlabel: str = None
ylabel: str = None

Module contents