Commit 66bdbe71 authored by Audrey Gibert's avatar Audrey Gibert
Browse files

[ont_qc]demultiplexont

Adding the parsing of SeqKit file
it returns a dictionary

Not tested yet, but will be soon with the sources of Maxime Manno!
parent 07725731
......@@ -51,6 +51,26 @@ class Demultiplex_ONT (Analysis):
@param stat_file : the stdout porechop
@return : {"read_trim_start" : read_trim_start, ...}
"""
#File parsing : recording into a list
list_stats= []
with open(stat_file, "r") as f_stat :
for line in f_stat.readlines():
list_stat.append(line.split())
# Registering file's header into a list
header = list_stats.pop(0)
# Creating a dictionnary on this model
# dico_stats[SampleName][parameterName] = Value
dico_stats = {}
for sample_number in range(len(list_stats)):
print("Le numero de sample est : "+str(sample_number))
dico_stats[list_stats[sample_number][0]] = {}
for parameter_idx in range(1, len(header)):
print(" Le numero de parametre est : " + str(parameter_idx))
print(" Dans : dico [list_stats[spl_nb][0]] [header[param_idx]]")
print(" on va mettre: list_stats[spl_nb][param_idx]")
dico_stats[list_stats[sample_number][0]][header[parameter_idx]] = list_stats[sample_number][parameter_idx]
return dico_stats
def post_process(self):
......
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