{ "cells": [ { "cell_type": "markdown", "id": "36bc5c4b-1171-4308-9d7e-4cd9637eb792", "metadata": {}, "source": [ "### Notebook index\n", "\n", "[3 Minimal examples](03-minimal.ipynb) \n", "[4 Plotting chromosomes](04-plotting.ipynb) \n", "[5 Multiple OTUs](05-multiple.ipynb) \n", "[6 Changing units](06-units.ipynb) \n", "[7 GISH](07-gish.ipynb) \n", "[8 Groups](08-groups.ipynb) \n", "[9 Circular Plots](09-circular.ipynb) \n", "[10 Plotting alongside phylogeny](10-phylogeny.ipynb) \n", "[11 Citrus](11-citrushelp.ipynb) \n", "[12 Human Karyotype](12-human.ipynb) " ] }, { "cell_type": "markdown", "id": "bb97bc3c-692a-404e-bc62-6ba0e442397f", "metadata": {}, "source": [ "# Plotting alongside phylogeny" ] }, { "cell_type": "code", "execution_count": 1, "id": "ce53f14c-feba-4855-af7a-bcb5901803cb", "metadata": {}, "outputs": [], "source": [ "# General jupyter instructions" ] }, { "cell_type": "code", "execution_count": 2, "id": "206c3e31-cc39-40e9-a4c4-4173d9ae6312", "metadata": { "jupyter": { "source_hidden": true }, "tags": [] }, "outputs": [], "source": [ "# press Ctrl + Enter to RUN active cell\n", "\n", "# SHOW keyboard shortcuts Ctrl + M then H (only jupyter notebooks and colab)\n", "\n", "# Ctrl + D (or X) DELETE a line of code\n", "\n", "# press Ctrl + M to escape from cell (opposite to ENTER)\n", "\n", "# then !\n", "# B to ADD cell below or A above\n", "# M to turn code cell into MARKDOWN\n", "# Y turn markdown to CODE\n", "# O to toggle OUTPUT\n", "# D D to DELETE cell\n", "\n", "# If in jupyter-lab:\n", "# collapse cell clicking in the blue left bar\n", "# use the settings menu to use the dark theme\n", "\n", "# if in colab:\n", "# remove bar at 80 in tools, preferences, 80 -> 0" ] }, { "cell_type": "code", "execution_count": 3, "id": "b1a73a58-ae83-41c5-852a-788c9c1149f5", "metadata": { "tags": [] }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "version 2.0.6 See help: ?idiogramFISH - browseVignettes('idiogramFISH') - https://ferroao.gitlab.io/manualidiogramfish\n", "\n" ] } ], "source": [ "# install if necessary\n", "\n", "if (system.file(package = \"idiogramFISH\") == '') {\n", " install.packages(\"idiogramFISH\")\n", "}\n", "\n", "library(idiogramFISH)" ] }, { "cell_type": "markdown", "id": "07fb5d02", "metadata": {}, "source": [ "This guide shows the files to plot idiograms alongside a phylogeny " ] }, { "cell_type": "markdown", "id": "5237bca2", "metadata": {}, "source": [ "## ggtree of iqtree and monocentrics\n", "\n", "idiogramFISH comes with two trees and data.frames with chr. and marks' data for the correspondent OTUs, first we will plot a tree produced with iqtree [@Nguyen2015c]\n", "\n", "### Load the iqtree:\n", "\n", "We will use phytools for that [@phytools2012]" ] }, { "cell_type": "code", "execution_count": 4, "id": "16c53995-9e2f-4e6a-83de-9e7de73f4b51", "metadata": {}, "outputs": [], "source": [ "if (!requireNamespace(\"BiocManager\", quietly = TRUE)) {\n", " install.packages(\"BiocManager\")\n", " }\n", "if (system.file(package = \"ggtree\") == '') {\n", " BiocManager::install(\"ggtree\")\n", " }\n", "if (system.file(package = \"treeio\") == '') {\n", " BiocManager::install(\"treeio\")\n", " }" ] }, { "cell_type": "code", "execution_count": 5, "id": "a75501e5-c11d-4bdd-a993-38ea9c34fc2a", "metadata": {}, "outputs": [], "source": [ "neededPkg <- c(\"grid\",\"ggpubr\",\"phytools\",\"plyr\")\n", "invisible(\n", "lapply(neededPkg, function(pkg) {\n", " if (system.file(package = pkg) == '') {\n", " install.packages(pkg)\n", " }\n", "})\n", ")" ] }, { "cell_type": "markdown", "id": "50124e62", "metadata": {}, "source": [ "