Commit cc0a67af authored by Sean Leavey's avatar Sean Leavey

Add fibre file start rows to verbose output

parent 4fcb7002
...@@ -75,16 +75,29 @@ def extract_data(fibre_dir, fibre_files): ...@@ -75,16 +75,29 @@ def extract_data(fibre_dir, fibre_files):
filepath_mid = os.path.join(fibre_dir, fibre_files["Middle"]) filepath_mid = os.path.join(fibre_dir, fibre_files["Middle"])
filepath_bot = os.path.join(fibre_dir, fibre_files["Bottom Neck"]) filepath_bot = os.path.join(fibre_dir, fibre_files["Bottom Neck"])
# row counter
row_count = 0
# return the appropriate columns in each dataset # return the appropriate columns in each dataset
logging.getLogger().debug("Extracting columns 1 and 2 from top file") logging.getLogger().debug("Extracting columns 1 and 2 from top file")
logging.getLogger().info("Top file data starts at row {0}".format(row_count + 1))
for row in csv.reader(open(filepath_top, 'r'), delimiter='\t'): for row in csv.reader(open(filepath_top, 'r'), delimiter='\t'):
yield [row[0], row[1]] yield [row[0], row[1]]
row_count += 1
logging.getLogger().debug("Extracting columns 1 and 4 from middle file") logging.getLogger().debug("Extracting columns 1 and 4 from middle file")
logging.getLogger().info("Middle file data starts at row {0}".format(row_count + 1))
for row in csv.reader(open(filepath_mid, 'r'), delimiter='\t'): for row in csv.reader(open(filepath_mid, 'r'), delimiter='\t'):
yield [row[0], row[3]] yield [row[0], row[3]]
row_count += 1
logging.getLogger().debug("Extracting columns 1 and 2 from bottom file") logging.getLogger().debug("Extracting columns 1 and 2 from bottom file")
logging.getLogger().info("Bottom file data starts at row {0}".format(row_count + 1))
for row in csv.reader(open(filepath_bot, 'r'), delimiter='\t'): for row in csv.reader(open(filepath_bot, 'r'), delimiter='\t'):
yield [row[0], row[1]] yield [row[0], row[1]]
row_count += 1
logging.getLogger().info("Output file contains {0} rows".format(row_count))
def write_csv_data(target_file, data): def write_csv_data(target_file, data):
"""Writes comma separated data from an iterator into the target file""" """Writes comma separated data from an iterator into the target file"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment