{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# FATCAT - Structure Similarity\n", "\n", "This notebook shows how to run and parse FATCAT, a structural similarity calculator." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "import ssbio.protein.structure.properties.fatcat as fatcat" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "import os\n", "import os.path as op\n", "import tempfile\n", "\n", "ROOT_DIR = tempfile.gettempdir()\n", "OUT_DIR = op.join(ROOT_DIR, 'fatcat_testing')\n", "if not op.exists(OUT_DIR):\n", " os.mkdir(OUT_DIR)\n", "FATCAT_SH = 'fatcat'" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Pairwise" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "fatcat_outfile = fatcat.run_fatcat(structure_path_1='../../ssbio/test/test_files/structures/12as-A_clean.pdb', \n", " structure_path_2='../../ssbio/test/test_files/structures/1a9x-A_clean.pdb',\n", " outdir=OUT_DIR,\n", " fatcat_sh=FATCAT_SH, print_cmd=True, force_rerun=True)\n", "print('Output file:', fatcat_outfile)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "fatcat.parse_fatcat(fatcat_outfile)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### All-by-all" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "structs = ['../../ssbio/test/test_files/structures/12as-A_clean.pdb', \n", " '../../ssbio/test/test_files/structures/1af6-A_clean.pdb',\n", " '../../ssbio/test/test_files/structures/1a9x-A_clean.pdb']" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "tm_scores = fatcat.run_fatcat_all_by_all(structs, fatcat_sh=FATCAT_SH, outdir=OUT_DIR)\n", "tm_scores" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "%matplotlib inline\n", "import seaborn as sns\n", "sns.heatmap(tm_scores)" ] } ], "metadata": { "anaconda-cloud": {}, "kernelspec": { "display_name": "Python [default]", "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.3" } }, "nbformat": 4, "nbformat_minor": 1 }