Пример #1
0
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(dat)
res = sc.average()
cor, data = sc.compare(dataset.X, mas, zero)

# Plotaj vse potrebno
# Primerjava bioloskih podatkov z imputiranimi vrednostmi
fig, (ax0, ax1, ax2) = plt.subplots(3, 1)
c = ax0.pcolormesh(dataset.X,
                   norm=colors.LogNorm(vmin=np.amin(dataset.X) + 1,
                                       vmax=np.amax(dataset.X)),
                   cmap=plt.get_cmap("binary"))
fig.colorbar(c, ax=ax0)
ax0.set_title('Biološki podatki')

c = ax1.pcolormesh(res,
                   norm=colors.LogNorm(vmin=np.amin(res) + 1,
Пример #2
0
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
fig, (ax0, ax1) = plt.subplots(2, 1)
Пример #3
0
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
data_gen = scimpute.generate()
dat, mas, zero = scimpute.zero_inflate(data_gen)
sc = scimpute.ScImpute(data_gen)
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
fig, (ax0, ax1) = plt.subplots(2, 1)
c = ax0.pcolormesh(res[0], cmap=plt.get_cmap("binary"))
fig.colorbar(c, ax=ax0)
ax0.set_title('Latentni prostor iz podatkov po vstavljanju ničel')