INNER CODE UNIT · Python
taxa_missing_too_much_data
nickjcroucher/gubbins · python/gubbins/PreProcessFasta.py:60
def taxa_missing_too_much_data(self):
taxa_to_remove = []
for taxa, percentage_missing in self.calculate_sequences_missing_data_percentage().items():
if percentage_missing > self.filter_percentage:
taxa_to_remove.append(taxa)
print("Excluded sequence " + taxa + " because it had " + str(percentage_missing) +
" percentage missing data while a maximum of " + str(self.filter_percentage) + " is allowed")
return taxa_to_remove
def taxa_of_duplicate_sequences(self):
taxa_to_remove = []
for sequence_hash, taxa in sorted(self.hash_sequences().items()):
if len(taxa) > 1:
taxon_to_keep = taxa.pop()
for taxon in taxa:
print("Sequences in " + taxon + " and " + taxon_to_keep + " are identical, removing " + taxon +
" from analysis")