Skip to Content

purify_bedpe

def chr3d.peak_based.purifying.purify_bedpe( bedpe_file: str, fragment_index: FragmentIndex, output_kept: str, output_removed: str, compute_inserts: bool = True, ) -> Dict[str, Any]

Purify BEDPE file by removing reads from same-fragment PETs.

Parameters:

ParameterTypeDescription
bedpe_filestrInput BEDPE file path
fragment_indexFragmentIndexFragment index for overlap lookup
output_keptstrOutput path for kept (purified) PETs
output_removedstrOutput path for removed (same-fragment) PETs
compute_insertsboolCompute insert sizes (default: True)

Returns:

Dict[str, Any] with purification statistics.

Example:

from chr3d.peak_based.purifying import FragmentIndex, purify_bedpe frag_idx = FragmentIndex("restriction_fragments.bed") stats = purify_bedpe( bedpe_file="dedup.bedpe", fragment_index=frag_idx, output_kept="purified.bedpe", output_removed="removed.bedpe", ) print(f"Kept: {stats['n_kept']}, Removed: {stats['n_removed']}")
Last updated on