{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/Users/alexsha/miniconda3/envs/seq_tools/lib/python3.6/site-packages/Bio/SearchIO/__init__.py:211: BiopythonExperimentalWarning: Bio.SearchIO is an experimental submodule which may undergo significant changes prior to its future official release.\n", " BiopythonExperimentalWarning)\n" ] } ], "source": [ "import seq_tools.plot4seq as p" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "from Bio.Align import MultipleSeqAlignment\n", "from Bio.Seq import Seq\n", "from Bio.SeqRecord import SeqRecord\n", "import seq_tools.hist_ss as st\n", "import numpy as np\n", "#import get_hist_ss_in_aln_for_shade\n", "\n", "human_h2a_z_core=Seq('SRSQRAGLQFPVGRIHRHLKSRTTSHGRVGATAAVYSAAILEYLTAEVLELAGNASKDLKVKRITPRHLQLAIRGDEELDSLI-KATIAGGGVIPHIHKSLIG')\n", "xenopus_h2a_core=Seq('TRSSRAGLQFPVGRVHRLLRKGNYAE-RVGAGAPVYLAAVLEYLTAEILELAGNAARDNKKTRIIPRHLQLAVRNDEELNKLLGRVTIAQGGVLPNIQSVLLP')\n", " \n", "msa=MultipleSeqAlignment([SeqRecord(xenopus_h2a_core,id='H2A',name='H2A'),SeqRecord(human_h2a_z_core,id='H2Ah',name='H2Ah')])\n" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from importlib import reload \n", "reload(st)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "SingleLetterAlphabet() alignment with 2 rows and 129 columns\n", "SGRGKQGGKTRAKAKTRSSRAGLQFPVGRVHR-LLRKGNYAERV...KSK H2A\n", "---------------XRSXRAGLQFPVGRXHRXLXXXXXXXXRV...--- Query\n", "Type detected= H2A\n" ] } ], "source": [ "reload(st)\n", "features=st.get_hist_ss_in_aln_for_shade(msa,below=True)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Chosen splitting parameters\n", "2 20\n", "Launcning Latex:\n", "pdflatex --file-line-error --synctex=1 -output-directory=/tmp --save-size=10000 /tmp/align.tex > /dev/null\n", "mv /tmp/align.pdf /tmp/tempshade.pdf\n", "Converting PDF to PNG\n", "convert -density 150 /tmp/tempshade.pdf -trim -bordercolor White -border 0.000%x0% /tmp/tempprofseq.png\n" ] } ], "source": [ "reload(p)\n", "p.plot_prof4seq('default',list(map(np.abs,map(np.sin,range(len(msa[0]))))),msa,features,axis='conservation')" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\"Plot\"\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "%%HTML\n", "\"Plot\"" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "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.7" } }, "nbformat": 4, "nbformat_minor": 2 }