seismicrna.filter package

seismicrna.filter.run(input_path: Iterable[str | Path] = Sentinel.UNSET, *, branch: str = '', tmp_pfx: str | Path = './tmp', keep_tmp: bool = False, region_coords: Iterable[tuple[str, int, int]] = (), region_primers: Iterable[tuple[str, DNA, DNA]] = (), primer_gap: int = 0, regions_file: str | None = None, count_del: bool = True, count_ins: bool = True, no_mut: Iterable[str] = (), only_mut: Iterable[str] = (), probe: str = 'DMS', mask_a: bool | None = None, mask_c: bool | None = None, mask_g: bool | None = None, mask_u: bool | None = None, mask_polya: int | None = None, mask_pos: Iterable[tuple[str, int]] = (), mask_pos_file: Iterable[str | Path] = (), drop_read: Iterable[str] = (), drop_read_file: Iterable[str | Path] = (), drop_discontig: bool = True, min_ninfo_pos: int = 1000, max_fmut_pos: float = 1.0, min_ncov_read: int = 1, min_fcov_read: float = 0.0, min_finfo_read: float = 0.95, max_fmut_read: float = 1.0, min_mut_gap: int | None = None, mut_collisions: str = 'auto', quick_unbias: bool = True, quick_unbias_thresh: float = 0.001, max_filter_iter: int = 0, filter_pos_table: bool = True, filter_read_table: bool = True, brotli_level: int = 10, self_contained: bool = False, num_cpus: int = 4, force: bool = False) list[Path]

Define mutations and regions to filter reads and positions.

Parameters:
  • branch (str) – Create a new branch of the workflow with this name [keyword-only, default: ‘’]

  • tmp_pfx (str | pathlib._local.Path) – Write all temporary files to a directory with this prefix [keyword-only, default: ‘./tmp’]

  • keep_tmp (bool) – Keep temporary files after finishing [keyword-only, default: False]

  • region_coords (Iterable) – Select a region of a reference given its 5’ and 3’ end coordinates [keyword-only, default: ()]

  • region_primers (Iterable) – Select a region of a reference given its forward and reverse primers [keyword-only, default: ()]

  • primer_gap (int) – Leave a gap of this many bases between the primer and the region [keyword-only, default: 0]

  • regions_file (str | None) – Select regions of references from coordinates/primers in a CSV file [keyword-only, default: None]

  • count_del (bool) – Count deletions as mutations [keyword-only, default: True]

  • count_ins (bool) – Count insertions as mutations [keyword-only, default: True]

  • no_mut (Iterable) – Do not count this type of mutation (overrides –count-del/ins) [keyword-only, default: ()]

  • only_mut (Iterable) – Count only this type of mutation (overrides other mutation settings) [keyword-only, default: ()]

  • probe (str) – Use the default options for this chemical probe [keyword-only, default: ‘DMS’]

  • mask_a (bool | None) – Mask positions with base A [keyword-only, default: None]

  • mask_c (bool | None) – Mask positions with base C [keyword-only, default: None]

  • mask_g (bool | None) – Mask positions with base G [keyword-only, default: None]

  • mask_u (bool | None) – Mask positions with base U [keyword-only, default: None]

  • mask_polya (int | None) – Mask stretches of at least this many consecutive A bases (0 disables); defaults to 5 for chemical probes, 0 for none [keyword-only, default: None]

  • mask_pos (Iterable) – Mask this position in this reference [keyword-only, default: ()]

  • mask_pos_file (Iterable) – Mask positions in references from a file [keyword-only, default: ()]

  • drop_read (Iterable) – Drop the read with this name [keyword-only, default: ()]

  • drop_read_file (Iterable) – Drop the reads with names in this file [keyword-only, default: ()]

  • drop_discontig (bool) – Drop paired-end reads with discontiguous mates [keyword-only, default: True]

  • min_ninfo_pos (int) – Mask positions with fewer than this many informative base calls [keyword-only, default: 1000]

  • max_fmut_pos (float) – Mask positions with more than this fraction of mutated base calls [keyword-only, default: 1.0]

  • min_ncov_read (int) – Drop reads with fewer than this many bases covering the region [keyword-only, default: 1]

  • min_fcov_read (float) – Drop reads covering less than this fraction of the region [keyword-only, default: 0.0]

  • min_finfo_read (float) – Drop reads with less than this fraction of informative base calls [keyword-only, default: 0.95]

  • max_fmut_read (float) – Drop reads with more than this fraction of mutated base calls [keyword-only, default: 1.0]

  • min_mut_gap (int | None) – Filter out mutations separated by fewer than this many bases [keyword-only, default: None]

  • mut_collisions (str) – If two mutations are closer than –min-mut-gap positions, MERGE the mutations, DROP the read, or AUTO-select based on the probe. [keyword-only, default: ‘auto’]

  • quick_unbias (bool) – Correct observer bias using a quick (typically linear time) heuristic [keyword-only, default: True]

  • quick_unbias_thresh (float) – Treat mutated fractions under this threshold as 0 with –quick-unbias [keyword-only, default: 0.001]

  • max_filter_iter (int) – Stop the filter step after this many iterations (0 for no limit) [keyword-only, default: 0]

  • filter_pos_table (bool) – Tabulate relationships per position for filter data [keyword-only, default: True]

  • filter_read_table (bool) – Tabulate relationships per read for filter data [keyword-only, default: True]

  • brotli_level (int) – Compress pickle files with this level of Brotli (0 - 11) [keyword-only, default: 10]

  • self_contained (bool) – Write self-contained batch files that do not require loading predecessor batches (Filter and Cluster steps), at the cost of larger files on disk [keyword-only, default: False]

  • num_cpus (int) – Use up to this many CPUs simultaneously [keyword-only, default: 4]

  • force (bool) – Force all tasks to run, overwriting any existing output files [keyword-only, default: False]

Subpackages

Submodules

class seismicrna.filter.batch.FilterMutsBatch(*, read_nums: np.ndarray, **kwargs)

Bases: FilterReadBatch, PartialRegionMutsBatch

property read_weights

Weights for each read when computing counts.

class seismicrna.filter.batch.FilterReadBatch(*, read_nums: np.ndarray, **kwargs)

Bases: PartialReadBatch

property num_reads

Number of reads.

property read_nums

Read numbers.

class seismicrna.filter.batch.PartialReadBatch(*, batch: int, **kwargs)

Bases: ReadBatch, ABC

property max_read

Maximum possible value for a read index.

property read_indexes

Map each read number to its index in self.read_nums.

class seismicrna.filter.batch.PartialRegionMutsBatch(*, region: Region, **kwargs)

Bases: PartialReadBatch, RegionMutsBatch, ABC

seismicrna.filter.batch.apply_filters(batch: RegionMutsBatch, read_nums: np.ndarray | None = None, region: Region | None = None, sanitize: bool = False)

Apply read/position filters to a batch, returning a FilterMutsBatch.

Parameters:
  • batch (RegionMutsBatch) – Source batch to filter.

  • read_nums (np.ndarray or None, optional) – Array of read numbers to keep; if None, all reads are kept.

  • region (Region or None, optional) – Region to clip reads to; if None, the batch’s existing region is used.

  • sanitize (bool, optional) – Whether to run extra validation checks on the new batch (default False).

Returns:

A new batch containing only the filtered reads and positions.

Return type:

FilterMutsBatch

class seismicrna.filter.dataset.FilterDataset(report_file: str | Path, verify_times: bool = True)

Bases: AverageDataset, ABC

Dataset of filtered data.

class seismicrna.filter.dataset.FilterMutsDataset(dataset2_report_file: Path, **kwargs)

Bases: FilterDataset, MultistepDataset, UnbiasDataset

Chain mutation data with filtered reads.

FILTER_NAME = 'filter'
classmethod get_dataset1_load_func()

Function to load Dataset 1.

classmethod get_dataset2_type()

Type of Dataset 2.

property min_mut_gap

Minimum gap between two mutations.

property mut_collisions

Method for handling mutations that are too close.

property pattern

Pattern of mutations to count.

property probe

Chemical probe used for the experiment.

property quick_unbias

Use the quick heuristic for unbiasing.

property quick_unbias_thresh

Consider mutation rates less than or equal to this threshold to be 0 when using the quick heuristic for unbiasing.

property region

Region of the dataset.

class seismicrna.filter.dataset.FilterReadDataset(*args, masked_read_nums: dict[int, list] | None = None, **kwargs)

Bases: FilterDataset, LoadedDataset, UnbiasDataset

Load batches of filtered data.

classmethod get_batch_type()

Type of batch.

classmethod get_report_type()

Type of report.

property min_mut_gap

Minimum gap between two mutations.

property mut_collisions

Method for handling mutations that are too close.

property pattern

Pattern of mutations to count.

property pos_kept

Positions kept after filtering.

property probe

Chemical probe used for the experiment.

property quick_unbias

Use the quick heuristic for unbiasing.

property quick_unbias_thresh

Consider mutation rates less than or equal to this threshold to be 0 when using the quick heuristic for unbiasing.

class seismicrna.filter.dataset.JoinFilterMutsDataset(*args, **kwargs)

Bases: FilterDataset, JoinMutsDataset, MergedUnbiasDataset

classmethod get_batch_type()

Type of batch.

classmethod get_dataset_load_func()

Function to load one constituent dataset.

classmethod get_report_type()

Type of report.

classmethod name_batch_attrs()

Name the attributes of each batch.

class seismicrna.filter.io.FilterBatchIO(*args, region: Region | None = None, seg_end5s: np.ndarray | None = None, seg_end3s: np.ndarray | None = None, muts: dict | None = None, **kwargs)

Bases: FilterReadBatch, ReadBatchIO, RegBrickleIO, FilterIO

classmethod get_file_seg_type()

Type of the last segment in the path.

to_muts_batch() FilterMutsBatch

Build a FilterMutsBatch from stored self-contained data.

class seismicrna.filter.io.FilterFile

Bases: HasRegFilePath, ABC

classmethod get_step()

Step of the workflow.

class seismicrna.filter.io.FilterIO

Bases: FilterFile, RegFileIO, ABC

class seismicrna.filter.lists.FilterList(*, reg: str, **kwargs)

Bases: List, FilterFile, ABC

class seismicrna.filter.lists.FilterPositionList(*, reg: str, **kwargs)

Bases: PositionList, FilterList

classmethod get_table_type()

Type of table that this type of list can process.

classmethod list_init_table_attrs()

List the table attribute names to pass to __init__().

seismicrna.filter.main.load_regions(input_path: Iterable[str | Path], coords: Iterable[tuple[str, int, int]], primers: Iterable[tuple[str, DNA, DNA]], primer_gap: int, regions_file: Path | None = None)

Load regions of idmut reports.

seismicrna.filter.main.run(input_path: Iterable[str | Path] = Sentinel.UNSET, *, branch: str = '', tmp_pfx: str | Path = './tmp', keep_tmp: bool = False, region_coords: Iterable[tuple[str, int, int]] = (), region_primers: Iterable[tuple[str, DNA, DNA]] = (), primer_gap: int = 0, regions_file: str | None = None, count_del: bool = True, count_ins: bool = True, no_mut: Iterable[str] = (), only_mut: Iterable[str] = (), probe: str = 'DMS', mask_a: bool | None = None, mask_c: bool | None = None, mask_g: bool | None = None, mask_u: bool | None = None, mask_polya: int | None = None, mask_pos: Iterable[tuple[str, int]] = (), mask_pos_file: Iterable[str | Path] = (), drop_read: Iterable[str] = (), drop_read_file: Iterable[str | Path] = (), drop_discontig: bool = True, min_ninfo_pos: int = 1000, max_fmut_pos: float = 1.0, min_ncov_read: int = 1, min_fcov_read: float = 0.0, min_finfo_read: float = 0.95, max_fmut_read: float = 1.0, min_mut_gap: int | None = None, mut_collisions: str = 'auto', quick_unbias: bool = True, quick_unbias_thresh: float = 0.001, max_filter_iter: int = 0, filter_pos_table: bool = True, filter_read_table: bool = True, brotli_level: int = 10, self_contained: bool = False, num_cpus: int = 4, force: bool = False) list[Path]

Define mutations and regions to filter reads and positions.

Parameters:
  • branch (str) – Create a new branch of the workflow with this name [keyword-only, default: ‘’]

  • tmp_pfx (str | pathlib._local.Path) – Write all temporary files to a directory with this prefix [keyword-only, default: ‘./tmp’]

  • keep_tmp (bool) – Keep temporary files after finishing [keyword-only, default: False]

  • region_coords (Iterable) – Select a region of a reference given its 5’ and 3’ end coordinates [keyword-only, default: ()]

  • region_primers (Iterable) – Select a region of a reference given its forward and reverse primers [keyword-only, default: ()]

  • primer_gap (int) – Leave a gap of this many bases between the primer and the region [keyword-only, default: 0]

  • regions_file (str | None) – Select regions of references from coordinates/primers in a CSV file [keyword-only, default: None]

  • count_del (bool) – Count deletions as mutations [keyword-only, default: True]

  • count_ins (bool) – Count insertions as mutations [keyword-only, default: True]

  • no_mut (Iterable) – Do not count this type of mutation (overrides –count-del/ins) [keyword-only, default: ()]

  • only_mut (Iterable) – Count only this type of mutation (overrides other mutation settings) [keyword-only, default: ()]

  • probe (str) – Use the default options for this chemical probe [keyword-only, default: ‘DMS’]

  • mask_a (bool | None) – Mask positions with base A [keyword-only, default: None]

  • mask_c (bool | None) – Mask positions with base C [keyword-only, default: None]

  • mask_g (bool | None) – Mask positions with base G [keyword-only, default: None]

  • mask_u (bool | None) – Mask positions with base U [keyword-only, default: None]

  • mask_polya (int | None) – Mask stretches of at least this many consecutive A bases (0 disables); defaults to 5 for chemical probes, 0 for none [keyword-only, default: None]

  • mask_pos (Iterable) – Mask this position in this reference [keyword-only, default: ()]

  • mask_pos_file (Iterable) – Mask positions in references from a file [keyword-only, default: ()]

  • drop_read (Iterable) – Drop the read with this name [keyword-only, default: ()]

  • drop_read_file (Iterable) – Drop the reads with names in this file [keyword-only, default: ()]

  • drop_discontig (bool) – Drop paired-end reads with discontiguous mates [keyword-only, default: True]

  • min_ninfo_pos (int) – Mask positions with fewer than this many informative base calls [keyword-only, default: 1000]

  • max_fmut_pos (float) – Mask positions with more than this fraction of mutated base calls [keyword-only, default: 1.0]

  • min_ncov_read (int) – Drop reads with fewer than this many bases covering the region [keyword-only, default: 1]

  • min_fcov_read (float) – Drop reads covering less than this fraction of the region [keyword-only, default: 0.0]

  • min_finfo_read (float) – Drop reads with less than this fraction of informative base calls [keyword-only, default: 0.95]

  • max_fmut_read (float) – Drop reads with more than this fraction of mutated base calls [keyword-only, default: 1.0]

  • min_mut_gap (int | None) – Filter out mutations separated by fewer than this many bases [keyword-only, default: None]

  • mut_collisions (str) – If two mutations are closer than –min-mut-gap positions, MERGE the mutations, DROP the read, or AUTO-select based on the probe. [keyword-only, default: ‘auto’]

  • quick_unbias (bool) – Correct observer bias using a quick (typically linear time) heuristic [keyword-only, default: True]

  • quick_unbias_thresh (float) – Treat mutated fractions under this threshold as 0 with –quick-unbias [keyword-only, default: 0.001]

  • max_filter_iter (int) – Stop the filter step after this many iterations (0 for no limit) [keyword-only, default: 0]

  • filter_pos_table (bool) – Tabulate relationships per position for filter data [keyword-only, default: True]

  • filter_read_table (bool) – Tabulate relationships per read for filter data [keyword-only, default: True]

  • brotli_level (int) – Compress pickle files with this level of Brotli (0 - 11) [keyword-only, default: 10]

  • self_contained (bool) – Write self-contained batch files that do not require loading predecessor batches (Filter and Cluster steps), at the cost of larger files on disk [keyword-only, default: False]

  • num_cpus (int) – Use up to this many CPUs simultaneously [keyword-only, default: 4]

  • force (bool) – Force all tasks to run, overwriting any existing output files [keyword-only, default: False]

seismicrna.filter.main.set_mask_acgu(probe: str, mask_a: bool | None = None, mask_c: bool | None = None, mask_g: bool | None = None, mask_u: bool | None = None)

Resolve per-base masking flags based on the probe type.

Parameters:
  • probe (str) – Probe type (one of the values in PROBES), used to set defaults when a flag is None.

  • mask_a (bool or None, optional) – Whether to mask adenine positions; if None, inferred from probe.

  • mask_c (bool or None, optional) – Whether to mask cytosine positions; if None, inferred from probe.

  • mask_g (bool or None, optional) – Whether to mask guanine positions; if None, inferred from probe.

  • mask_u (bool or None, optional) – Whether to mask uracil/thymine positions; if None, inferred from probe.

Returns:

Resolved (mask_a, mask_c, mask_g, mask_u) flags.

Return type:

tuple[bool, bool, bool, bool]

seismicrna.filter.main.set_mask_polya(probe: str, mask_polya: int | None = None)

Resolve poly(A) masking threshold based on the probe type.

Parameters:
  • probe (str) – Probe type (one of the values in PROBES), used to set the default when mask_polya is None.

  • mask_polya (int or None, optional) – Minimum consecutive-A stretch length to mask; if None, a probe-specific default is used.

Returns:

Resolved mask_polya value.

Return type:

int

seismicrna.filter.main.set_mut_gap_params(probe: str, min_mut_gap: int | None = None, mut_collisions: str = 'auto')

Resolve mutation-gap and collision parameters based on the probe type.

Parameters:
  • probe (str) – Probe type (one of the values in PROBES), used to set defaults when a parameter is None / MUT_COLLISIONS_AUTO.

  • min_mut_gap (int or None, optional) – Minimum gap (in nucleotides) between two mutations in the same read; if None, a probe-specific default is used.

  • mut_collisions (str, optional) – How to handle reads with mutations closer than min_mut_gap; if MUT_COLLISIONS_AUTO, a probe-specific default is used.

Returns:

Resolved (min_mut_gap, mut_collisions) values.

Return type:

tuple[int, str]

class seismicrna.filter.report.BaseFilterReport(**kwargs: Any | Callable[[Report], Any])

Bases: RegReport, FilterIO, ABC

classmethod get_file_seg_type()

Type of the last segment in the path.

class seismicrna.filter.report.FilterReport(**kwargs: Any | Callable[[Report], Any])

Bases: BatchedReport, BaseFilterReport

classmethod get_param_report_fields()

Parameter fields of the report.

classmethod get_result_report_fields()

Result fields of the report.

class seismicrna.filter.report.JoinFilterReport(**kwargs: Any | Callable[[Report], Any])

Bases: JoinReport, BaseFilterReport

classmethod get_param_report_fields()

Parameter fields of the report.

class seismicrna.filter.table.FilterBatchTabulator(*, get_batch_count_all: Callable, num_batches: int, num_cpus: int = 1, **kwargs)

Bases: BatchTabulator, FilterTabulator

class seismicrna.filter.table.FilterCountTabulator(*, batch_counts: Iterable[tuple[Any, Any, Any, Any]], **kwargs)

Bases: CountTabulator, FilterTabulator

class seismicrna.filter.table.FilterDatasetTabulator(*, dataset: MutsDataset, validate: bool = False, **kwargs)

Bases: PartialDatasetTabulator, FilterTabulator

class seismicrna.filter.table.FilterPositionTable

Bases: FilterTable, PartialPositionTable, ABC

class seismicrna.filter.table.FilterPositionTableLoader(table_file: str | Path, **kwargs)

Bases: PositionTableLoader, FilterPositionTable

class seismicrna.filter.table.FilterPositionTableWriter(tabulator: Tabulator)

Bases: PositionTableWriter, FilterPositionTable

class seismicrna.filter.table.FilterReadTable

Bases: FilterTable, PartialReadTable, ABC

class seismicrna.filter.table.FilterReadTableLoader(table_file: str | Path, **kwargs)

Bases: ReadTableLoader, FilterReadTable

class seismicrna.filter.table.FilterReadTableWriter(tabulator: Tabulator)

Bases: ReadTableWriter, FilterReadTable

class seismicrna.filter.table.FilterTable

Bases: AverageTable, FilterFile, ABC

classmethod get_load_function()

LoadFunction for all Dataset types for this Table.

class seismicrna.filter.table.FilterTabulator(*, refseq: DNA, region: Region, pattern: RelPattern, min_mut_gap: int, mut_collisions: str, quick_unbias: bool, quick_unbias_thresh: float, count_ends: bool = True, **kwargs)

Bases: PartialTabulator, AverageTabulator, ABC

classmethod table_types()

Types of tables that this tabulator can write.

class seismicrna.filter.table.PartialDatasetTabulator(*, dataset: MutsDataset, validate: bool = False, **kwargs)

Bases: DatasetTabulator, PartialTabulator, ABC

classmethod init_kws()

Attributes of the dataset to use as keyword arguments in super().__init__().

class seismicrna.filter.table.PartialPositionTable

Bases: PartialTable, PositionTable, ABC

class seismicrna.filter.table.PartialReadTable

Bases: PartialTable, ReadTable, ABC

class seismicrna.filter.table.PartialTable

Bases: Table, HasRegFilePath, ABC

Table of filtered reads over a region of the sequence.

class seismicrna.filter.table.PartialTabulator(*, refseq: DNA, region: Region, pattern: RelPattern, min_mut_gap: int, mut_collisions: str, quick_unbias: bool, quick_unbias_thresh: float, count_ends: bool = True, **kwargs)

Bases: Tabulator, ABC

property correct_bias

Whether to correct for observer bias.

property data_per_pos

DataFrame of per-position data.

classmethod get_null_value()

The null value for a count: either 0 or NaN.

property p_ends_given_clust_noclose

Probability of each end coordinate.

seismicrna.filter.table.adjust_counts(table_per_pos: pd.DataFrame, p_ends_given_clust_noclose: np.ndarray, n_reads_clust: pd.Series | int, region: Region, min_mut_gap: int, mut_collisions: str, quick_unbias: bool, quick_unbias_thresh: float)

Adjust the given table of Filtered/Clustered counts per position to correct for observer bias.

class seismicrna.filter.write.Filterer(dataset: IDmutMutsDataset | PoolMutsDataset, region: Region, pattern: RelPattern, *, max_filter_iter: int, mask_polya: int, mask_a: bool, mask_c: bool, mask_g: bool, mask_u: bool, mask_pos: list[tuple[str, int]], mask_pos_file: list[Path], drop_read: list[str], drop_read_file: list[Path], drop_discontig: bool, min_ncov_read: int, min_fcov_read: float, min_finfo_read: float, max_fmut_read: float, min_mut_gap: int, mut_collisions: str, probe: str, min_ninfo_pos: int, max_fmut_pos: float, quick_unbias: bool, quick_unbias_thresh: float, count_read: bool, brotli_level: int, top: Path, branch: str, self_contained: bool, num_cpus: int = 1)

Bases: object

Filter batches of relationships.

CHECKSUM_KEY = 'filter'
DROP_READ_DISCONTIG = 'read-discontig'
DROP_READ_FCOV = 'read-fcov'
DROP_READ_FINFO = 'read-finfo'
DROP_READ_FMUT = 'read-fmut'
DROP_READ_GAP = 'read-gap'
DROP_READ_INIT = 'read-init'
DROP_READ_KEPT = 'read-kept'
DROP_READ_LIST = 'read-exclude'
DROP_READ_NCOV = 'read-ncov'
MASK_POS_FMUT = 'pos-fmut'
MASK_POS_NINFO = 'pos-ninfo'
PATTERN_KEY = 'pattern'
create_report()
property n_reads_discontig
property n_reads_init
property n_reads_kept

Number of reads kept.

property n_reads_list
property n_reads_max_fmut
property n_reads_min_fcov
property n_reads_min_finfo
property n_reads_min_gap
property n_reads_min_ncov
property pos_a

Positions masked for having base A.

property pos_c

Positions masked for having base C.

property pos_g

Positions masked for having base G.

property pos_kept

Positions kept.

property pos_list

Positions masked arbitrarily from a list.

property pos_max_fmut

Positions masked for having too many mutations.

property pos_min_ninfo

Positions masked for having too few informative reads.

property pos_n

Positions masked for having base N.

property pos_polya

Positions masked for lying in a poly(A) sequence.

property pos_u

Positions masked for having base T or U.

property read_names_dataset

Dataset of the read names.

run_filtering()
seismicrna.filter.write.filter_region(dataset: IDmutMutsDataset | PoolMutsDataset, region: Region, *, branch: str, count_del: bool, count_ins: bool, no_mut: Iterable[str], only_mut: Iterable[str], filter_pos_table: bool, filter_read_table: bool, self_contained: bool, force: bool, num_cpus: int, tmp_pfx, keep_tmp, **kwargs)

Filter reads, positions, and relationships in a dataset.

seismicrna.filter.write.list_mask_pos(ref: str, mask_pos: Iterable[tuple[str, int]], mask_pos_file: Iterable[str | Path], end5: int | None = None, end3: int | None = None)

List the positions to mask for one reference.

Combine the positions given directly with those loaded from files, keeping only the positions for the given reference. If end5 and end3 are given, keep only positions within [end5, end3]. Return a sorted array of unique positions.