Skip to content

Instantly share code, notes, and snippets.

@sbassi
Created September 20, 2020 01:18
Show Gist options
  • Save sbassi/fb3e80e069adfaa807ccf666f92708e1 to your computer and use it in GitHub Desktop.
Save sbassi/fb3e80e069adfaa807ccf666f92708e1 to your computer and use it in GitHub Desktop.
from itertools import product
# Chenage AA number here:
repeat = 7
# pepgen
aas = ('ALA', 'ARG', 'ASN', 'ASP', 'CYS', 'GLN', 'GLU', 'GLY',
'HIS', 'ILE', 'LEU', 'LYS', 'MET', 'PHE', 'PRO', 'SER',
'THR', 'TRP', 'TYR', 'VAL')
all_pep = product(aas, repeat=repeat)
with open('{0}pept.txt'.format(repeat), 'w') as tp:
for t in all_pep:
pep = '{0} N{1} {2} C{3} {4}\n'.format('{', t[0],
" ".join(t[1:-1]),
t[-1], '}')
tp.write(pep)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment