Skip to content

Instantly share code, notes, and snippets.

@bougui505
Last active April 13, 2021 07:22
Show Gist options
  • Save bougui505/39149033d0d7a8667827c54fb867f1e1 to your computer and use it in GitHub Desktop.
Save bougui505/39149033d0d7a8667827c54fb867f1e1 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
# -*- coding: UTF8 -*-
# Author: Guillaume Bouvier -- guillaume.bouvier@pasteur.fr
# https://research.pasteur.fr/en/member/guillaume-bouvier/
# 2018-11-19 16:26:10 (UTC+0100)
from pymol import cmd
import sys
try:
PDBFILENAME = sys.argv[1]
SELECTION = sys.argv[2]
except IndexError:
print("Help:")
print(" pdb2fasta input.pdb 'selection string'")
sys.exit()
cmd.load(PDBFILENAME)
seq = cmd.get_fastastr(SELECTION)
print(seq)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment