def load_stats(self, input_file_name):
    self.log('Starting conversion of FASTA to KBaseGenomeAnnotations.Assembly')
    self.log('Building Object.')
    if (not os.path.isfile(input_file_name)):
        raise Exception('The input file name {0} is not a file!'.format(input_file_name))
    with open(input_file_name, 'r') as input_file_handle:
        contig_id = None
        sequence_len = 0
        fasta_dict = dict()
        first_header_found = False
        pattern = re.compile('\\s+')
        for current_line in input_file_handle:
            if (current_line[0] == '>'):
                if (not first_header_found):
                    first_header_found = True
                else:
                    fasta_dict[contig_id] = sequence_len
                    sequence_len = 0
                fasta_header = current_line.replace('>', '').strip()
                try:
                    contig_id = fasta_header.strip().split(' ', 1)[0]
                except:
                    contig_id = fasta_header.strip()
            else:
                sequence_len += len(re.sub(pattern, '', current_line))
    if (not first_header_found):
        raise Exception('There are no contigs in this file')
    else:
        fasta_dict[contig_id] = sequence_len
    return fasta_dict
def load_stats(self, input_file_name):
    self.log('Starting conversion of FASTA to KBaseGenomeAnnotations.Assembly')
    self.log('Building Object.')
    if (not os.path.isfile(input_file_name)):
        raise Exception('The input file name {0} is not a file!'.format(input_file_name))
    with open(input_file_name, 'r') as input_file_handle:
        contig_id = None
        sequence_len = 0
        fasta_dict = dict()
        first_header_found = False
        pattern = re.compile('\\s+')
        for current_line in input_file_handle:
            if (current_line[0] == '>'):
                if (not first_header_found):
                    first_header_found = True
                else:
                    fasta_dict[contig_id] = sequence_len
                    sequence_len = 0
                fasta_header = current_line.replace('>', ).strip()
                try:
                    contig_id = fasta_header.strip().split(' ', 1)[0]
                except:
                    contig_id = fasta_header.strip()
            else:
                sequence_len += len(re.sub(pattern, , current_line))
    if (not first_header_found):
        raise Exception('There are no contigs in this file')
    else:
        fasta_dict[contig_id] = sequence_len
    return fasta_dict