-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbin.py
27 lines (20 loc) · 843 Bytes
/
bin.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import json
import numpy as np
import pandas as pd
import numba
from matplotlib import pyplot as plt
from metdense2 import *
from hilbert import *
with open("scnmt_data__CpG_filtered.metdense/metadata.json") as f:
info = json.load(f)
meta = pd.read_table("21-11-10_cell-annotation.tsv").set_index("cell_id_dna").reindex( info["cells"] )
cell_idcs_qNSC = np.where( meta["celltype"]=="qNSC" )[0]
cell_idcs_aNSC = np.where( meta["celltype"]=="oligodendrocyte" )[0]
md = MetdenseDataset( "scnmt_data__CpG_filtered.metdense" )
chrom = md.chroms["9"]
smoothed_bins = chrom.bin_smoothed( 200 )
vals_qNSC = chrom.bin_residual_sums( cell_idcs_qNSC, 200 )
vals_aNSC = chrom.bin_residual_sums( cell_idcs_aNSC, 200 )
#plt.scatter( smoothed_bins + vals_qNSC, smoothed_bins + vals_aNSC, s=.4 )
plt.imshow( vec2hilbert(vals_qNSC, 10 ) )
plt.show()