def extract_length(self, lower_bound=None, upper_bound=None, new_path=None):
<EOL>if new_path is None: fraction = self.__class__(new_temp_path())<EOL>elif isinstance(new_path, FASTA): fraction = new_path<EOL>else:                fraction = self.__class__(new_path)<EOL>if lower_bound is None: lower_bound = <NUM_LIT:0><EOL>if upper_bound is None: upper_bound = sys.maxsize<EOL>def fraction_iterator():<EOL><INDENT>for read in self:<EOL><INDENT>if lower_bound <= len(read) <= upper_bound:<EOL><INDENT>yield read<EOL><DEDENT><DEDENT><DEDENT>fraction.write(fraction_iterator())<EOL>fraction.close()<EOL>return fraction<EOL>
Extract a certain length fraction and place them in a new file.