Last active
April 13, 2021 07:22
-
-
Save bougui505/39149033d0d7a8667827c54fb867f1e1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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