See More

{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "prot_seq = 'MKALIVLGLVLLSVTVQGKVFERCELARTLKRLGMDGYRGISLANWMCLAKWESGYNTRATNYNAGDRSTDYGIFQINSRYWCNDGKTPGAVNACHLSCSALLQDNIADAVACAKRVVRDPQGIRAWVAWRNRCQNRDVRQYVQGCGV'\n", "\n", "print(sorted(list(set(prot_seq))))\n", "\n", "f_dict = {}\n", "f_dict['A'] = prot_seq.count('A')\n", "f_dict['C'] = prot_seq.count('C')\n", "f_dict['D'] = prot_seq.count('D')\n", "f_dict['E'] = prot_seq.count('E')\n", "print(f_dict)\n", "\n", "print('frequency of A is', prot_seq.count('A'))\n", "print('frequency of C is', prot_seq.count('C'))\n", "print('frequency of D is', prot_seq.count('D'))\n", "print('frequency of E is', prot_seq.count('E'))\n", "\n", "print('frequency of A is', f_dict['A'])\n", "print('frequency of C is', f_dict['C'])\n", "print('frequency of D is', f_dict['D'])\n", "print('frequency of E is', f_dict['E'])" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.4" } }, "nbformat": 4, "nbformat_minor": 2 }