{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "DeltaSHAPE\n", "==========\n", "\n", "DeltaSHAPE analysis detects meaningful changes in SHAPE reactivity between two\n", "samples. Parameters are optimized for detecting in cell vs. cell free protein\n", "protections and enhancements, but they are flexible and useful for identifying\n", "any kind of meaningful differences.\n", "\n", "Import RNAvigate\n", "----------------" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import rnavigate as rnav\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Create RNAvigate samples\n", "------------------------\n", "\n", "These example data are available as ready-to-go samples in the examples module.\n", "\n", "I'll just verify the data keywords. DeltaSHAPE only requires \"shapemap\"." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from rnavigate.examples import rnasep_1, rnasep_2\n", "rnasep_1.print_data_keywords()\n", "rnasep_2.print_data_keywords()\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Perform and visualize deltaSHAPE analysis\n", "-----------------------------------------\n", "\n", "The DeltaSHAPE module provides functionality to quickly perform the analysis\n", "and visualize results. The deltaSHAPE profile is the difference between rolling\n", "average normalized SHAPE reactivities. Significant protections\n", "(sample 1 > sample 2) are highlighted green. Significant enhancements\n", "(sample 1 < sample 2) are highlighted purple.\n", "\n", "The additional optional arguments and default values are commented out below." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "delta12 = rnav.analysis.DeltaSHAPE(\n", " sample1=rnasep_1,\n", " sample2=rnasep_2,\n", " # profile=\"shapemap\",\n", " # smoothing_window=3,\n", " # zf_coeff=1.96,\n", " # ss_thresh=1,\n", " # site_window=3,\n", " # site_nts=2,\n", " )\n", "plot = delta12.plot()\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The returned value is an RNAvigate Sample\n", "-----------------------------------------\n", "\n", "DeltaSHAPE analysis returns an RNAvigate Sample. This can be used to create\n", "additional plots, and color or highlight significant protections and/or\n", "enhancements.\n", "\n", "DeltaSHAPE samples inherit all of the data keywords from sample 1 and 2. For\n", "keywords that are shared between samples 1 and 2, sample 1 data is inherited.\n", "\n", "New data keywords are:\n", "- deltashape: the deltashape profile\n", "- profile_1: the sample 1 profile\n", "- profile_2: the sample 2 profile\n", "- protections: an annotation of protections\n", "- enhancements: an annotation of enhancements" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "delta12.print_data_keywords()\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Using the Sample in other plots\n", "-------------------------------\n", "\n", "Below, I use the Sample returned from the DeltaSHAPE analysis to create a secondary structure diagram.\n", "I can use the `\"ss_pdb\"` data keyword that was inherited from the parent samples.\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plot = rnav.plot_ss(\n", " samples=[delta12],\n", " structure=\"ss_pdb\",\n", " annotations=[\"protections\", \"enhancements\"],\n", ")\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Help documentation\n", "------------------\n", "\n", "For more detailed information about the attributes of the DeltaSHAPE analysis\n", "and DeltaSHAPEProfile, use the help command." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "help(rnav.analysis.DeltaSHAPE)\n" ] } ], "metadata": { "kernelspec": { "display_name": "RNAvigate", "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.9.2" } }, "nbformat": 4, "nbformat_minor": 2 }