Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
tumour_counts_A = UInt32Col( pos=6 )
tumour_counts_C = UInt32Col( pos=7 )
tumour_counts_G = UInt32Col( pos=8 )
tumour_counts_T = UInt32Col( pos=9 )
p_AA_AA = Float64Col( pos=10 )
p_AA_AC = Float64Col( pos=11 )
p_AA_AG = Float64Col( pos=12 )
p_AA_AT = Float64Col( pos=13 )
p_AA_CC = Float64Col( pos=14 )
p_AA_CG = Float64Col( pos=15 )
p_AA_CT = Float64Col( pos=16 )
p_AA_GG = Float64Col( pos=17 )
p_AA_GT = Float64Col( pos=18 )
p_AA_TT = Float64Col( pos=19 )
p_AA_ACG = Float64Col( pos=20 )
p_AA_ACT = Float64Col( pos=21 )
p_AA_AGT = Float64Col( pos=22 )
p_AA_CGT = Float64Col( pos=23 )
p_AA_ACGT = Float64Col( pos=24 )
p_AC_AA = Float64Col( pos=25 )
p_AC_AC = Float64Col( pos=26 )
p_AC_AG = Float64Col( pos=27 )
p_AC_AT = Float64Col( pos=28 )
p_AC_CC = Float64Col( pos=29 )
p_AC_CG = Float64Col( pos=30 )
p_AC_CT = Float64Col( pos=31 )
p_AC_GG = Float64Col( pos=32 )
p_CC_CGT = Float64Col( pos=83 )
p_CC_ACGT = Float64Col( pos=84 )
p_CG_AA = Float64Col( pos=85 )
p_CG_AC = Float64Col( pos=86 )
p_CG_AG = Float64Col( pos=87 )
p_CG_AT = Float64Col( pos=88 )
p_CG_CC = Float64Col( pos=89 )
p_CG_CG = Float64Col( pos=90 )
p_CG_CT = Float64Col( pos=91 )
p_CG_GG = Float64Col( pos=92 )
p_CG_GT = Float64Col( pos=93 )
p_CG_TT = Float64Col( pos=94 )
p_CG_ACG = Float64Col( pos=95 )
p_CG_ACT = Float64Col( pos=96 )
p_CG_AGT = Float64Col( pos=97 )
p_CG_CGT = Float64Col( pos=98 )
p_CG_ACGT = Float64Col( pos=99 )
p_CT_AA = Float64Col( pos=100 )
p_CT_AC = Float64Col( pos=101 )
p_CT_AG = Float64Col( pos=102 )
p_CT_AT = Float64Col( pos=103 )
p_CT_CC = Float64Col( pos=104 )
p_CT_CG = Float64Col( pos=105 )
p_CT_CT = Float64Col( pos=106 )
p_CT_GG = Float64Col( pos=107 )
p_CT_GT = Float64Col( pos=108 )
p_CT_TT = Float64Col( pos=109 )
p_CT_ACG = Float64Col( pos=110 )
p_CT_ACT = Float64Col( pos=111 )
p_CT_AGT = Float64Col( pos=112 )
p_CT_CGT = Float64Col( pos=113 )
p_CT_ACGT = Float64Col( pos=114 )
p_AG_AG = Float64Col( pos=32 )
p_AG_AT = Float64Col( pos=33 )
p_AG_CC = Float64Col( pos=34 )
p_AG_CG = Float64Col( pos=35 )
p_AG_CT = Float64Col( pos=36 )
p_AG_GG = Float64Col( pos=37 )
p_AG_GT = Float64Col( pos=38 )
p_AG_TT = Float64Col( pos=39 )
p_AT_AA = Float64Col( pos=40 )
p_AT_AC = Float64Col( pos=41 )
p_AT_AG = Float64Col( pos=42 )
p_AT_AT = Float64Col( pos=43 )
p_AT_CC = Float64Col( pos=44 )
p_AT_CG = Float64Col( pos=45 )
p_AT_CT = Float64Col( pos=46 )
p_AT_GG = Float64Col( pos=47 )
p_AT_GT = Float64Col( pos=48 )
p_AT_TT = Float64Col( pos=49 )
p_CC_AA = Float64Col( pos=50 )
p_CC_AC = Float64Col( pos=51 )
p_CC_AG = Float64Col( pos=52 )
p_CC_AT = Float64Col( pos=53 )
p_CC_CC = Float64Col( pos=54 )
p_CC_CG = Float64Col( pos=55 )
p_CC_CT = Float64Col( pos=56 )
p_CC_GG = Float64Col( pos=57 )
p_CC_GT = Float64Col( pos=58 )
p_CC_TT = Float64Col( pos=59 )
p_CG_AA = Float64Col( pos=60 )
p_CG_AC = Float64Col( pos=61 )
p_CG_AG = Float64Col( pos=62 )
p_CG_AT = Float64Col( pos=63 )
tumour_counts_G = UInt32Col( pos=8 )
tumour_counts_T = UInt32Col( pos=9 )
p_AA_AA = Float64Col( pos=10 )
p_AA_AC = Float64Col( pos=11 )
p_AA_AG = Float64Col( pos=12 )
p_AA_AT = Float64Col( pos=13 )
p_AA_CC = Float64Col( pos=14 )
p_AA_CG = Float64Col( pos=15 )
p_AA_CT = Float64Col( pos=16 )
p_AA_GG = Float64Col( pos=17 )
p_AA_GT = Float64Col( pos=18 )
p_AA_TT = Float64Col( pos=19 )
p_AC_AA = Float64Col( pos=20 )
p_AC_AC = Float64Col( pos=21 )
p_AC_AG = Float64Col( pos=22 )
p_AC_AT = Float64Col( pos=23 )
p_AC_CC = Float64Col( pos=24 )
p_AC_CG = Float64Col( pos=25 )
p_AC_CT = Float64Col( pos=26 )
p_AC_GG = Float64Col( pos=27 )
p_AC_GT = Float64Col( pos=28 )
p_AC_TT = Float64Col( pos=29 )
p_AG_AA = Float64Col( pos=30 )
p_AG_AC = Float64Col( pos=31 )
p_AG_AG = Float64Col( pos=32 )
p_AG_AT = Float64Col( pos=33 )
p_AG_CC = Float64Col( pos=34 )
p_AG_CG = Float64Col( pos=35 )
p_AG_CT = Float64Col( pos=36 )
p_AG_GG = Float64Col( pos=37 )
# All the rest will be filled with defaults
row.append()
fileh.close()
# The sample nested class description
class Info(tables.IsDescription):
_v_pos = 2
Name = tables.StringCol(16, dflt='sample string')
Value = tables.Float64Col()
class Test(tables.IsDescription):
"""A description that has several columns"""
x = tables.Int32Col(shape=2, dflt=0, pos=0)
y = tables.Float64Col(dflt=1.2, shape=(2, 3))
z = tables.UInt8Col(dflt=1)
color = tables.EnumCol(colors, 'red', base='uint32', shape=(2,))
Info = Info()
class extra_info(tables.IsDescription):
_v_pos = 1
name = tables.StringCol(10)
value = tables.Float64Col(pos=0)
y2 = tables.Float64Col(dflt=1, shape=(2, 3), pos=1)
z2 = tables.UInt8Col(dflt=1)
class info2(tables.IsDescription):
y3 = tables.Float64Col(dflt=1, shape=(2, 3))
z3 = tables.UInt8Col(dflt=1)
name = tables.StringCol(10)
value = tables.EnumCol(colors, 'blue', base='uint32', shape=(1,))
class info3(tables.IsDescription):
name = tables.StringCol(10)
mas_ch1_adc_offset = tables.Float64Col()
mas_ch2_adc_gain = tables.Float64Col()
mas_ch2_adc_offset = tables.Float64Col()
mas_ch1_comp_gain = tables.Float64Col()
mas_ch1_comp_offset = tables.Float64Col()
mas_ch2_comp_gain = tables.Float64Col()
mas_ch2_comp_offset = tables.Float64Col()
slv_ch1_thres_low = tables.Float64Col()
slv_ch1_thres_high = tables.Float64Col()
slv_ch2_thres_low = tables.Float64Col()
slv_ch2_thres_high = tables.Float64Col()
slv_ch1_inttime = tables.Float64Col()
slv_ch2_inttime = tables.Float64Col()
slv_ch1_voltage = tables.Float64Col()
slv_ch2_voltage = tables.Float64Col()
slv_ch1_current = tables.Float64Col()
slv_ch2_current = tables.Float64Col()
slv_comp_thres_low = tables.Float64Col()
slv_comp_thres_high = tables.Float64Col()
slv_max_voltage = tables.Float64Col()
slv_reset = tables.BoolCol()
slv_ch1_gain_pos = tables.UInt8Col()
slv_ch1_gain_neg = tables.UInt8Col()
slv_ch2_gain_pos = tables.UInt8Col()
slv_ch2_gain_neg = tables.UInt8Col()
slv_ch1_offset_pos = tables.UInt8Col()
slv_ch1_offset_neg = tables.UInt8Col()
slv_ch2_offset_pos = tables.UInt8Col()
slv_ch2_offset_neg = tables.UInt8Col()
slv_common_offset = tables.UInt8Col()
slv_internal_voltage = tables.UInt8Col()
slv_ch1_adc_gain = tables.Float64Col()
p_AT_CT = Float64Col( pos=46 )
p_AT_GG = Float64Col( pos=47 )
p_AT_GT = Float64Col( pos=48 )
p_AT_TT = Float64Col( pos=49 )
p_CC_AA = Float64Col( pos=50 )
p_CC_AC = Float64Col( pos=51 )
p_CC_AG = Float64Col( pos=52 )
p_CC_AT = Float64Col( pos=53 )
p_CC_CC = Float64Col( pos=54 )
p_CC_CG = Float64Col( pos=55 )
p_CC_CT = Float64Col( pos=56 )
p_CC_GG = Float64Col( pos=57 )
p_CC_GT = Float64Col( pos=58 )
p_CC_TT = Float64Col( pos=59 )
p_CG_AA = Float64Col( pos=60 )
p_CG_AC = Float64Col( pos=61 )
p_CG_AG = Float64Col( pos=62 )
p_CG_AT = Float64Col( pos=63 )
p_CG_CC = Float64Col( pos=64 )
p_CG_CG = Float64Col( pos=65 )
p_CG_CT = Float64Col( pos=66 )
p_CG_GG = Float64Col( pos=67 )
p_CG_GT = Float64Col( pos=68 )
p_CG_TT = Float64Col( pos=69 )
p_CT_AA = Float64Col( pos=70 )
p_CT_AC = Float64Col( pos=71 )
p_CT_AG = Float64Col( pos=72 )
p_CT_AT = Float64Col( pos=73 )
p_CT_CC = Float64Col( pos=74 )
p_CT_CG = Float64Col( pos=75 )
p_CT_CT = Float64Col( pos=76 )
p_CT_GG = Float64Col( pos=77 )
p_AGT_ACG = Float64Col( pos=200 )
p_AGT_ACT = Float64Col( pos=201 )
p_AGT_AGT = Float64Col( pos=202 )
p_AGT_CGT = Float64Col( pos=203 )
p_AGT_ACGT = Float64Col( pos=204 )
p_CGT_AA = Float64Col( pos=205 )
p_CGT_AC = Float64Col( pos=206 )
p_CGT_AG = Float64Col( pos=207 )
p_CGT_AT = Float64Col( pos=208 )
p_CGT_CC = Float64Col( pos=209 )
p_CGT_CG = Float64Col( pos=210 )
p_CGT_CT = Float64Col( pos=211 )
p_CGT_GG = Float64Col( pos=212 )
p_CGT_GT = Float64Col( pos=213 )
p_CGT_TT = Float64Col( pos=214 )
p_CGT_ACG = Float64Col( pos=215 )
p_CGT_ACT = Float64Col( pos=216 )
p_CGT_AGT = Float64Col( pos=217 )
p_CGT_CGT = Float64Col( pos=218 )
p_CGT_ACGT = Float64Col( pos=219 )
p_ACGT_AA = Float64Col( pos=220 )
p_ACGT_AC = Float64Col( pos=221 )
p_ACGT_AG = Float64Col( pos=222 )
p_ACGT_AT = Float64Col( pos=223 )
p_ACGT_CC = Float64Col( pos=224 )
p_ACGT_CG = Float64Col( pos=225 )
p_ACGT_CT = Float64Col( pos=226 )
p_ACGT_GG = Float64Col( pos=227 )
p_ACGT_GT = Float64Col( pos=228 )
p_ACGT_TT = Float64Col( pos=229 )
p_ACGT_ACG = Float64Col( pos=230 )
p_ACGT_ACT = Float64Col( pos=231 )
detnum = tables.UInt16Col()
password = tables.Int32Col(dflt=-1)
spare_bytes = tables.UInt8Col()
use_filter = tables.BoolCol()
use_filter_threshold = tables.BoolCol()
reduce_data = tables.BoolCol()
buffer = tables.Int32Col(dflt=-1)
startmode = tables.BoolCol()
delay_screen = tables.Float64Col()
delay_check = tables.Float64Col()
delay_error = tables.Float64Col()
mas_ch1_thres_low = tables.Float64Col()
mas_ch1_thres_high = tables.Float64Col()
mas_ch2_thres_low = tables.Float64Col()
mas_ch2_thres_high = tables.Float64Col()
mas_ch1_inttime = tables.Float64Col()
mas_ch2_inttime = tables.Float64Col()
mas_ch1_voltage = tables.Float64Col()
mas_ch2_voltage = tables.Float64Col()
mas_ch1_current = tables.Float64Col()
mas_ch2_current = tables.Float64Col()
mas_comp_thres_low = tables.Float64Col()
mas_comp_thres_high = tables.Float64Col()
mas_max_voltage = tables.Float64Col()
mas_reset = tables.BoolCol()
mas_ch1_gain_pos = tables.UInt8Col()
mas_ch1_gain_neg = tables.UInt8Col()
mas_ch2_gain_pos = tables.UInt8Col()
mas_ch2_gain_neg = tables.UInt8Col()
mas_ch1_offset_pos = tables.UInt8Col()
mas_ch1_offset_neg = tables.UInt8Col()
mas_ch2_offset_pos = tables.UInt8Col()
import time
from six import print_
FORMAT = "%(asctime)-15s -8s %(message)s"
logging.basicConfig(format=FORMAT, level=logging.INFO)
class Usage(Exception):
def __init__(self, msg):
self.msg = msg
OHLCTableDescription = {'sid': tables.StringCol(14, pos=2),
'dt': tables.Int64Col(pos=1),
'open': tables.Float64Col(dflt=np.NaN, pos=3),
'high': tables.Float64Col(dflt=np.NaN, pos=4),
'low': tables.Float64Col(dflt=np.NaN, pos=5),
'close': tables.Float64Col(dflt=np.NaN, pos=6),
"volume": tables.Int64Col(dflt=0, pos=7)}
def process_line(line):
dt = np.datetime64(line["dt"]).astype(np.int64)
sid = line["sid"]
open_p = float(line["open"])
high_p = float(line["high"])
low_p = float(line["low"])
close_p = float(line["close"])
volume = int(line["volume"])
return (dt, sid, open_p, high_p, low_p, close_p, volume)