def rename_sequences(self, mapping, new_path=None, in_place=False):
<EOL>if new_path is None: new_fasta = self.__class__(new_temp_path())<EOL>else:                new_fasta = self.__class__(new_path)<EOL>new_fasta.create()<EOL>for seq in self:<EOL><INDENT>new_name = mapping[seq.description]<EOL>nucleotides = str(seq.seq)<EOL>new_fasta.add_str(nucleotides, new_name)<EOL><DEDENT>new_fasta.close()<EOL>if in_place:<EOL><INDENT>os.remove(self.path)<EOL>shutil.move(new_fasta, self.path)<EOL>return self<EOL><DEDENT>else: return new_fasta<EOL>
Will rename all sequences in the current fasta file using
        the mapping dictionary also provided. In place or at a new path.