<jupyter_start><jupyter_text>Alternative Way to Create RegionDS   Parse Methylpy DMRfind outputIf you used the [`methylpy DMRfind`](https://github.com/yupenghe/methylpy) function to identify DMRs, you can create a  {{ RegionDS }} by running {func}`methylpy_to_region_ds `<jupyter_code>from ALLCools.mcds import RegionDS
from ALLCools.dmr.parse_methylpy import methylpy_to_region_ds
# DMR output of methylpy DMRfind
methylpy_dmr = '../../data/HIPBulk/DMR/snmC_CT/_rms_results_collapsed.tsv'
methylpy_to_region_ds(dmr_path=methylpy_dmr, output_dir='test_HIP_methylpy')
RegionDS.open('test_HIP_methylpy', region_dim='dmr')<jupyter_output><empty_output><jupyter_text>Create RegionDS from a BED fileYou can create an empty {{ RegionDS }} with a BED file, with only the region coordinates recorded. You can then perform annotation, motif scan and further analysis using the methods described in the following sections.The BED file contains three columns: 1. chrom: required2. start: required3. end: required4. region_id: optional, but recommended to have. If not provided, RegionDS will automatically generate `f"{region_dim}_{i_row}"` as region_id. region_id must be unique.You also need to provide a `chrom_size_path` which tells RegionDS the sizes of your chromosomes.```{important} About BED SortingRegion order matters throughout the genomic analysis. The best practice is to sort your BED file according to the `chrom_size_path` you are providing. If your BED file is already sorted, you can set `sort_bed=False`, which is True by default```<jupyter_code># example BED file with region ID
!head test_from_bed_func.bed
bed_region_ds = RegionDS.from_bed(
    bed='test_from_bed_func.bed',
    location='test_from_bed_RegionDS',
    chrom_size_path='../../data/genome/mm10.main.nochrM.chrom.sizes',
    region_dim='bed_region',
    # True by default, set to False if bed is already sorted
    sort_bed=True)
# the RegionDS is stored at {location}
RegionDS.open('test_from_bed_RegionDS')<jupyter_output>Using bed_region as region_dim
{'fraction_non_alphanumeric': 0.08279940857565303, 'fraction_numerical': 0.002957121734844751, 'mean_word_length': 6.0, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '497078', 'license': 'MIT', 'n_tokens_mistral': 663, 'n_tokens_neox': 628, 'n_words': 206, 'path': 'docs/allcools/cluster_level/RegionDS/01b.other_option_to_init_region_ds.ipynb', 'repo_name': 'jksr/ALLCools', 'size': '2029'}