Determine whether it is required to run the MLST analyses

def strainer(self):
        """
        Determine whether it is required to run the MLST analyses
        """
        # Initialise a variable to store whether the analyses need to be performed
        analyse = list()
        for sample in self.runmetadata.samples:
            if sample.general.bestassemblyfile != 'NA':
                try:
                    # Try to open the final report from the analyses. If it exists, then the analyses don't need to be
                    # performed again.
                    if os.path.isfile('{}{}_{}.csv'.format(sample[self.analysistype].reportdir, sample.name,
                                                           self.analysistype)):
                        if self.analysistype == 'rmlst':
                            # Run the allele updater method
                            updatecall, allelefolder = getrmlsthelper(self.referencefilepath, self.updatedatabases,
                                                                      self.start)
                        else:
                            # referencefilepath, start, organism, update
                            allelefolder = getmlsthelper(self.referencefilepath, self.start,
                                                                     sample.general.referencegenus, self.updatedatabases)
                        # Alleles have a .tfa extension
                        self.alleles = glob('{}/*.tfa'.format(allelefolder))
                        sample[self.analysistype].alleles = self.alleles
                        sample[self.analysistype].allelenames = [os.path.split(x)[1].split('.')[0] for x in
                                                                 self.alleles]
                        # The analyses have already been successfully completed
                        analyse.append(False)
                    # Otherwise run the analyses
                    else:
                        self.populator(sample)
                        analyse.append(True)
                # If the attribute doesn't exist, then the analyses haven't been performed yet.
                except (KeyError, AttributeError):
                    self.populator(sample)
                    analyse.append(True)
            else:
                self.populator(sample)
                analyse.append(False)
        # Only run the analyses if they have not completed successfully before
        # if any(analyse):
        # Run the MLST analyses
        MLST(self)