def subsample(self, down_to=<NUM_LIT:1>, new_path=None):
<EOL>if new_path is None: subsampled = self.__class__(new_temp_path())<EOL>elif isinstance(new_path, FASTA): subsampled = new_path<EOL>else:                subsampled = self.__class__(new_path)<EOL>if down_to > len(self):<EOL><INDENT>message = "<STR_LIT>"<EOL>print(Color.ylw + message % (self, down_to, len(self)) + Color.end)<EOL>self.copy(new_path)<EOL>return<EOL><DEDENT>subsampled.create()<EOL>for seq in isubsample(self, down_to): subsampled.add_seq(seq)<EOL>subsampled.close()<EOL>assert len(subsampled) == down_to<EOL>return subsampled<EOL>
Pick a number of sequences from the file pseudo-randomly.