# -*- coding: utf-8 -*-
"""deepalu.ipynb

Automatically generated by Colaboratory.

Original file is located at
    https://colab.research.google.com/drive/1sTG4i6kvVYFm3keyIIkb58BdeXwtIKrS
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import pysam
import sys
import random
import os.path
import numpy as np
import datetime, os
from tensorflow import keras
from tensorflow.keras import layers
from tensorflow.keras import callbacks
from tensorflow.keras.callbacks import ModelCheckpoint
from tensorflow.io import TFRecordWriter
#from nucleus.io.genomics_writer import TFRecordWriter
from deepalu_base import *


_TRAIN = 'train.tfrecord'
_EVAL = 'eval.tfrecord'
_TEST = 'test.tfrecord'        
hparams=PileupImageOptions(3)
def make_test_dataset(hparams,shuffle_depth):
  num_test_examples = 0
  input_gt=sys.argv[1]
  out_tf='test.tfrecord'
  with TFRecordWriter(os.path.join(hparams.out_dir, out_tf)) as test_out:
    all_examples = make_alu_examples(hparams,input_gt,0,shuffle_depth)
    for data_type,example in all_examples:
#        print(example)
        test_out.write(example)
        num_test_examples += 1
  print('# of training examples: %d' % num_test_examples)
hparams.reference=hparams.model_base_dir+'/reference/hs37d5.fa'
make_test_dataset(hparams,95)
#example_path = "example.tfrecords"
#np.random.seed(0)
#with tf.io.TFRecordWriter(example_path) as file_writer:
#  for _ in range(4):
#    x, y = np.random.random(), np.random.random()
#
#    record_bytes = tf.train.Example(features=tf.train.Features(feature={
#        "x": tf.train.Feature(float_list=tf.train.FloatList(value=[x])),
#        "y": tf.train.Feature(float_list=tf.train.FloatList(value=[y])),
#    })).SerializeToString()
#    file_writer.write(record_bytes)
#
