Skip to content

Commit

Permalink
added print statements
Browse files Browse the repository at this point in the history
  • Loading branch information
dmcmanam committed Jul 3, 2024
1 parent 15504d4 commit cc240c1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/ont_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def get_read_length_and_summary(file_path):

def write_to_csv(sample_dict):
file_name = "summary.csv"
print("Writing stats file: " + file_name)
with open(file_name,'w') as file:
file.write("sample_id, Reads, Bases, N50, Meidan Read Length\n")
for key, value in sample_dict.items():
Expand All @@ -38,9 +39,11 @@ def write_to_csv(sample_dict):
sample_dict = OrderedDict()
sample_list.sort()
for sample in sample_list:
print("Processing sample: " + sample)
destination = project_directory + "/" + sample
file = glob.glob(destination + "/*/sequencing_summary_*")
if len(file) != 0:
sample_dict[sample] = get_read_length_and_summary(file[0])

write_to_csv(sample_dict)
print("ONT stats complete for: " + project_directory)

0 comments on commit cc240c1

Please sign in to comment.