@@ -0,0 +1,790 @@
+import sys%0Afrom Bio import SeqIO%0A%0A#as a stand-alone: %5Bpython3+%5D rename.py %5Boriginal_reference%5D %5Breference_to_rename%5D%0A%0Adef main():%0A    #get original IDs%0A    ids = %5B%5D%0A    with open(original, %22rU%22) as ref:%0A        for record in SeqIO.parse(ref, %22fasta%22):%0A            ids.append(record.id)%0A%0A    #get rename IDs%0A    with open(toRename, %22rU%22) as new:%0A        newseqs = list(SeqIO.parse(new, %22fasta%22))%0A        for i in range(0, len(ids), 1):%0A            newseqs%5Bi%5D.id = newseqs%5Bi%5D.name = newseqs%5Bi%5D.description = ids%5Bi%5D%0A%0A    #write new names and seqs to file%0A    with open(toRename, %22w%22) as outfile:%0A        SeqIO.write(newseqs, outfile, %22fasta%22)%0A%0A%0Aif __name__==%22__main__%22:%0A    original = sys.argv%5B1%5D%0A    toRename = sys.argv%5B2%5D%0A    print(%22Renaming: %22, toRename, %22 based on: %22, original)%0A    main()

add rename.py