""" modifyClusterHead : given the previous id and a sequence object (new_cluster_head), set this sequence as cluster head in the cluster corresponding to the previous cluster head id.
"""
# get the cluster corresponding to previous_cluster_head_id
""" assignTaxonomy: given the blastn results (comparison of sequences with a reference database) stored in blast_dictionnary and the taxonomy collection extracted from the reference database, to attribute a taxonomy to the clusters of the cluster collection """
# go through all the clusters contained in the cluster collecion
forcluster_head_idinself.cluster_collection:
# set the best match reference id of the cluster to the value given by the blast_dictionnary
""" buildClusterTables : construct the table of the evolution of the clusters in the different samples, can be used to construct a heat map. The number of sequences per sample are normalised (so that every sample has the same amount of sequences) and then given in log(n+1) to lower the influence of the big clusters. A taxonomy table is also given as output, it contains the correspondance between the cluster ids and their taxonomic affiliation """
# open the output file (tab separated output file)
output_file=open(output_filename,'w')
# construct the output name of the taxonomy table from the output_filename