{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Alternative Way to Create RegionDS " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Parse Methylpy DMRfind output\n", "If 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 `" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "ExecuteTime": { "end_time": "2022-01-09T18:07:30.500681Z", "start_time": "2022-01-09T18:07:28.875254Z" } }, "outputs": [], "source": [ "from ALLCools.mcds import RegionDS\n", "from ALLCools.dmr.parse_methylpy import methylpy_to_region_ds" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "ExecuteTime": { "end_time": "2022-01-09T17:37:41.793014Z", "start_time": "2022-01-09T17:37:41.790481Z" } }, "outputs": [], "source": [ "# DMR output of methylpy DMRfind\n", "methylpy_dmr = '../../data/HIPBulk/DMR/snmC_CT/_rms_results_collapsed.tsv'\n", "methylpy_to_region_ds(dmr_path=methylpy_dmr, output_dir='test_HIP_methylpy')" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "ExecuteTime": { "end_time": "2022-01-09T17:38:00.451178Z", "start_time": "2022-01-09T17:37:56.434908Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
<xarray.RegionDS>\n",
       "Dimensions:      (dmr: 2337497, sample: 10)\n",
       "Coordinates:\n",
       "  * dmr          (dmr) <U15 'snmC_CT-0' 'snmC_CT-1' ... 'snmC_CT-2337496'\n",
       "    dmr_chrom    (dmr) <U5 'chr1' 'chr1' 'chr1' 'chr1' ... 'chrY' 'chrY' 'chrY'\n",
       "    dmr_end      (dmr) int64 3001020 3003900 3006189 ... 90811943 90812481\n",
       "    dmr_ndms     (dmr) int64 1 3 2 1 3 2 1 1 1 1 3 1 ... 11 5 4 2 5 7 2 6 9 1 4\n",
       "    dmr_start    (dmr) int64 3001018 3003640 3005998 ... 90811941 90812266\n",
       "  * sample       (sample) <U17 'snmC_ASC' 'snmC_CA1' ... 'snmC_ODC' 'snmC_OPC'\n",
       "Data variables:\n",
       "    dmr_da_frac  (sample, dmr) float64 ...\n",
       "    dmr_state    (sample, dmr) int16 ...\n",
       "Attributes:\n",
       "    region_dim:          dmr\n",
       "    region_ds_location:  /home/hanliu/pkg/ALLCools_pycharm/docs/allcools/clus...
" ], "text/plain": [ "\n", "Dimensions: (dmr: 2337497, sample: 10)\n", "Coordinates:\n", " * dmr (dmr) \n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
<xarray.RegionDS>\n",
       "Dimensions:           (bed_region: 100)\n",
       "Coordinates:\n",
       "    bed_region_end    (bed_region) int64 45388519 58086005 ... 161863422\n",
       "    bed_region_start  (bed_region) int64 45388517 58086003 ... 161863420\n",
       "  * bed_region        (bed_region) <U15 'snmC_CT-40246' ... 'snmC_CT-2330818'\n",
       "    bed_region_chrom  (bed_region) <U5 'chr1' 'chr1' 'chr2' ... 'chrX' 'chrX'\n",
       "Data variables:\n",
       "    *empty*\n",
       "Attributes:\n",
       "    chrom_size_path:     /home/hanliu/pkg/ALLCools_pycharm/docs/allcools/clus...\n",
       "    region_dim:          bed_region\n",
       "    region_ds_location:  /home/hanliu/pkg/ALLCools_pycharm/docs/allcools/clus...
" ], "text/plain": [ "\n", "Dimensions: (bed_region: 100)\n", "Coordinates:\n", " bed_region_end (bed_region) int64 45388519 58086005 ... 161863422\n", " bed_region_start (bed_region) int64 45388517 58086003 ... 161863420\n", " * bed_region (bed_region)