def fasta_stats(files, records):
<EOL>contig_len_dict = dict()<EOL>gc_dict = dict()<EOL>for file_name in files:<EOL><INDENT>contig_lengths = list()<EOL>fasta_sequence = str()<EOL>for contig, record in records[file_name].items():<EOL><INDENT>contig_lengths.append(len(record.seq))<EOL>fasta_sequence += record.seq<EOL><DEDENT>contig_len_dict[file_name] = sorted(contig_lengths, reverse=True)<EOL>gc_dict[file_name] = float('<STR_LIT>'.format(GC(fasta_sequence)))<EOL><DEDENT>return contig_len_dict, gc_dict<EOL>
Parse the lengths of all contigs for each sample, as well as the total GC%
:param files: dictionary of stain name: /sequencepath/strain_name.extension
:param records: Dictionary of strain name: SeqIO records
:return: contig_len_dict, gc_dict: dictionaries of list of all contig length, and total GC% for all strains