# -*- 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_parall import *
os.environ["CUDA_VISIBLE_DEVICES"]="-1"


hparams=PileupImageOptions(3)
def make_test_dataset(hparams,shuffle_depth):
  num_test_examples = 0
  input_gt=sys.argv[1]
  out_tf='test.tfrecord'
#  options=tf.io.TFRecordOptions(compression_type='')
  with tf.io.TFRecordWriter(os.path.join(hparams.out_dir, out_tf)) as test_out:
    all_examples = make_alu_examples(hparams,input_gt,0,shuffle_depth)
    print("Generating output!")
#    make_alu_examples(hparams,input_gt,0,shuffle_depth)
    for data_type,example in all_examples:
        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)
