Skip to content

Instantly share code, notes, and snippets.

@skaae
Created October 7, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skaae/7250cff8eb39ac9bf722 to your computer and use it in GitHub Desktop.
Save skaae/7250cff8eb39ac9bf722 to your computer and use it in GitHub Desktop.
def find_prot(fasta_dict, protein_name):
'''Function to find protein in fasta_dictionary'''
# Check if fasta_dict contains the protein name key
if protein_name in fasta_dict:
# Return biological sequence
return fasta_dict[protein_name]
else:
# Print error message
print "Error: %s not found" % protein_name
return None # We'll see how to deal with this properly next week
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment