def calc_custom(custom, genome, scaffold, sequence, scaffold_coverage, total_bases):
index = <NUM_LIT:0><EOL>if scaffold in scaffold_coverage: <EOL><INDENT>if genome not in custom:<EOL><INDENT>custom[genome] = [[] for i in scaffold_coverage[scaffold]]<EOL><DEDENT>for cov in scaffold_coverage[scaffold]:<EOL><INDENT>length = float(len(sequence[<NUM_LIT:1>]))<EOL>bases = cov * length<EOL>custom_value = ((bases) / (total_bases[index])) / length<EOL>custom[genome][index].append(custom_value)<EOL>index += <NUM_LIT:1><EOL><DEDENT><DEDENT>return custom<EOL>
custom = {(reads mapped to scaffold)/(total reads for sample)}/(length of scaffold)