Use SeqIO to create dictionaries of all records for each FASTA file

def fasta_records(self):
        """
        Use SeqIO to create dictionaries of all records for each FASTA file
        """
        for sample in self.metadata:
            # Create the analysis-type specific attribute
            setattr(sample, self.analysistype, GenObject())
            # Create a dictionary of records for each file
            try:
                record_dict = SeqIO.to_dict(SeqIO.parse(sample.general.bestassemblyfile, "fasta"))
            except FileNotFoundError:
                record_dict = dict()
            # Set the records dictionary as the attribute for the object
            sample[self.analysistype].record_dict = record_dict