https://github.com/tansey/smoothfdr
Raw File
Tip revision: c5b693d0a66e83c9387433b33c0eab481bd4a763 authored by Wesley Tansey on 08 May 2020, 15:42:20 UTC
Fixed bug in easy that created too large a support for the alternative distribution
Tip revision: c5b693d
hmrfPrep2.py
import sys
import numpy as np

exp_dir = sys.argv[1]

if not exp_dir.endswith('/'):
    exp_dir += '/'

x = np.zeros((3,130,130))
x[1, 1:129, 1:129] = np.loadtxt(exp_dir + 'data.csv', delimiter=',')
np.savetxt(exp_dir + 'bufferdata.csv', x.flatten(), delimiter=',', fmt='%f')

# Buffered regions
x = np.arange(3*130*130).reshape((3,130,130))+1
np.savetxt(exp_dir + 'bufferregions.csv', x[1,1:129,1:129].flatten(), delimiter=',', fmt='%d')

# Buffered p-values
x = np.zeros((3,130,130))
y = np.loadtxt(exp_dir + 'flatdata_pvalues.csv', delimiter=',')
x[1, 1:129, 1:129] = y.reshape((128,128))
np.savetxt(exp_dir + 'bufferpvalues.csv', x.flatten(), delimiter=',', fmt='%f')
back to top