import scimpute import Orange.data from Orange.data import Table import numpy as np import matplotlib.pyplot as plt import matplotlib.colors as colors # how to load files into numpy # file_inflated = np.genfromtxt('biological_inflated.csv', delimiter=',') # Load filename = "../../data/ccp_normCounts_mESCquartz.counts.cycle_genes.csv" dataset = Orange.data.Table(filename) # Izracunaj vse potrebno dat, mas, zero = scimpute.zero_inflate(dataset.X) sc = scimpute.ScImpute(dataset.X) res = sc.scvis(dat) cor, data = sc.compare_embedded(res) print(cor) razlika1 = [] razlika2 = [] for x in range(len(data[0])): if (data[0][x] > 0.7 or data[0][x] < -0.7): razlika1.append(data[1][x] - data[0][x]) if (data[0][x] < 0.3 and data[0][x] > -0.3): razlika2.append(data[1][x] - data[0][x]) # Plotaj vse potrebno # Primerjava bioloskih podatkov z imputiranimi vrednostmi
import sys sys.path.append("../..") import scimpute import Orange.data from Orange.data import Table import numpy as np import matplotlib.pyplot as plt import matplotlib.colors as colors # Izracunaj vse potrebno z uporabo modula data_org = scimpute.generate() dat, mas, zero = scimpute.zero_inflate(data_org) sc = scimpute.ScImpute(dat) res = sc.WMean_chisquared() cor, data = sc.compare(data_org, mas) print(cor) # Plotaj vse potrebno # Primerjava bioloskih podatkov z imputiranimi vrednostmi fig, (ax0, ax1, ax2) = plt.subplots(3, 1) c = ax0.pcolormesh(data_org, norm=colors.LogNorm(vmin=np.amin(data_org)+1, vmax=np.amax(data_org)), cmap=plt.get_cmap("binary")) fig.colorbar(c, ax=ax0) ax0.set_title('Sintetični podatki') c = ax1.pcolormesh(res,norm=colors.LogNorm(vmin=np.amin(res)+1, vmax=np.amax(res)), cmap=plt.get_cmap("binary")) ax1.set_title('Imputirani sintetični podatki') fig.colorbar(c, ax=ax1) c = ax2.pcolormesh(data_org-res, norm=colors.LogNorm(vmin=np.amin(data_org)+1, vmax=np.amax(data_org)), cmap=plt.get_cmap("binary")) ax2.set_title('Razlika med sintetičnimi in imputiranimi podatki')