{ "cells": [ { "cell_type": "markdown", "metadata": { "id": "IHkzHMNH1wRW" }, "source": [ "Downloading miniconda" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "CYK9y72ex1UO", "outputId": "53ca9d57-e72e-4c80-ed35-09c74598b928" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "--2025-09-18 04:17:33-- https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh\n", "Resolving repo.anaconda.com (repo.anaconda.com)... 104.16.32.241, 104.16.191.158, 2606:4700::6810:bf9e, ...\n", "Connecting to repo.anaconda.com (repo.anaconda.com)|104.16.32.241|:443... connected.\n", "HTTP request sent, awaiting response... 200 OK\n", "Length: 162129736 (155M) [application/octet-stream]\n", "Saving to: ‘Miniconda3-latest-Linux-x86_64.sh’\n", "\n", "Miniconda3-latest-L 100%[===================>] 154.62M 96.3MB/s in 1.6s \n", "\n", "2025-09-18 04:17:35 (96.3 MB/s) - ‘Miniconda3-latest-Linux-x86_64.sh’ saved [162129736/162129736]\n", "\n", "PREFIX=/usr/local\n", "Unpacking bootstrapper...\n", "Unpacking payload...\n", "\n", "Installing base environment...\n", "\n", "Preparing transaction: ...working... done\n", "Executing transaction: ...working... done\n", "installation finished.\n", "WARNING:\n", " You currently have a PYTHONPATH environment variable set. This may cause\n", " unexpected behavior when running the Python interpreter in Miniconda3.\n", " For best results, please verify that your PYTHONPATH only points to\n", " directories of packages that are compatible with the Python interpreter\n", " in Miniconda3: /usr/local\n" ] } ], "source": [ "# Download Miniconda (fresh download to ensure no corruption)\n", "!wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh\n", "\n", "# Update existing installation\n", "!bash Miniconda3-latest-Linux-x86_64.sh -b -u -p /usr/local" ] }, { "cell_type": "markdown", "metadata": { "id": "Vke8mD2N2AZ2" }, "source": [ "checking path" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "ygg_6Hg62Bwg", "outputId": "bdfdaf17-8091-48cb-9713-210de556b0af" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "/env/python\n" ] } ], "source": [ "!echo $PYTHONPATH\n", "\n", "# Unset it for this session (safe; it resets on restart)\n", "!unset PYTHONPATH" ] }, { "cell_type": "markdown", "metadata": { "id": "WoTLN6Ae2Dbm" }, "source": [ "Initialising conda for bash" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "jtjd7fyQ2Hhk", "outputId": "1fe0ceab-6660-4817-a652-a1e9856f2139" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "no change /usr/local/condabin/conda\n", "no change /usr/local/bin/conda\n", "no change /usr/local/bin/conda-env\n", "no change /usr/local/bin/activate\n", "no change /usr/local/bin/deactivate\n", "no change /usr/local/etc/profile.d/conda.sh\n", "no change /usr/local/etc/fish/conf.d/conda.fish\n", "no change /usr/local/shell/condabin/Conda.psm1\n", "no change /usr/local/shell/condabin/conda-hook.ps1\n", "no change /usr/local/lib/python3.13/site-packages/xontrib/conda.xsh\n", "no change /usr/local/etc/profile.d/conda.csh\n", "modified /root/.bashrc\n", "\n", "==> For changes to take effect, close and re-open your current shell. <==\n", "\n" ] } ], "source": [ "# Initialize Conda for bash (adds to PATH)\n", "!/usr/local/bin/conda init bash\n", "\n", "# Source the initialization script\n", "!source /usr/local/etc/profile.d/conda.sh" ] }, { "cell_type": "markdown", "metadata": { "id": "JkSaxeNs2Mjl" }, "source": [ "checking conda version and path" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "SGRsUj_F2PF6", "outputId": "34e4bb8f-7794-4567-b03a-c846e9e46d23" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "conda 25.7.0\n", "conda 25.7.0\n", "/usr/local/bin/conda\n" ] } ], "source": [ "!conda --version\n", "!/usr/local/bin/conda --version\n", "!which conda" ] }, { "cell_type": "markdown", "metadata": { "id": "qr5a8T2n2U2d" }, "source": [ "Accepting channels" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "D2jC9286Q6hD", "outputId": "085ae179-de7e-4fcd-e608-19d2c51ad945" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "accepted Terms of Service for \u001b[4;94mhttps://repo.anaconda.com/pkgs/main\u001b[0m\n", "accepted Terms of Service for \u001b[4;94mhttps://repo.anaconda.com/pkgs/r\u001b[0m\n" ] } ], "source": [ "# Accept ToS for both channels\n", "!/usr/local/bin/conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main\n", "!/usr/local/bin/conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r" ] }, { "cell_type": "markdown", "metadata": { "id": "BkTMEZZx2hsa" }, "source": [ "Clearing misconfigured channels" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "GF7VYcbP2fA5", "outputId": "f3a70d49-38ba-4399-9c0d-8183f87eabc9" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "\n", "CondaKeyError: 'channels': value 'bioconda' not present in config\n", "\n", "\n", "CondaKeyError: 'channels': value 'conda-forge' not present in config\n", "\n" ] } ], "source": [ "# Clear any misconfigured channels (optional, but ensures clean setup)\n", "!/usr/local/bin/conda config --remove channels defaults --force\n", "!/usr/local/bin/conda config --remove channels bioconda --force\n", "!/usr/local/bin/conda config --remove channels conda-forge --force\n", "\n", "# Add channels in correct order\n", "!/usr/local/bin/conda config --add channels defaults\n", "!/usr/local/bin/conda config --add channels bioconda\n", "!/usr/local/bin/conda config --add channels conda-forge" ] }, { "cell_type": "markdown", "metadata": { "id": "Bc0AEFHv2uvB" }, "source": [ "Showing channels" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "ni9kLqlk2wP5", "outputId": "8bafbc0d-348f-4b0a-9d0b-edc8687498cc" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "channels:\n", " - conda-forge\n", " - bioconda\n", " - defaults\n" ] } ], "source": [ "!/usr/local/bin/conda config --show channels" ] }, { "cell_type": "markdown", "metadata": { "id": "O3bqXlgz2yxk" }, "source": [ "Avoiding conflicts" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "0U8xhHvw21mI", "outputId": "bafc37c1-492a-4700-d9be-55db7f74e46a" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "\u001b[1;33mJupyter detected\u001b[0m\u001b[1;33m...\u001b[0m\n", "\u001b[1;32m2\u001b[0m\u001b[1;32m channel Terms of Service accepted\u001b[0m\n", "Retrieving notices: - \b\b\\ \b\b| \b\bdone\n", "Channels:\n", " - bioconda\n", " - conda-forge\n", " - defaults\n", "Platform: linux-64\n", "Collecting package metadata (repodata.json): - \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\bdone\n", "Solving environment: - \b\bdone\n", "\n", "## Package Plan ##\n", "\n", " environment location: /usr/local/envs/qtlseq\n", "\n", " added / updated specs:\n", " - qtlseq\n", "\n", "\n", "The following packages will be downloaded:\n", "\n", " package | build\n", " ---------------------------|-----------------\n", " _libgcc_mutex-0.1 | conda_forge 3 KB conda-forge\n", " _openmp_mutex-4.5 | 2_gnu 23 KB conda-forge\n", " alsa-lib-1.2.14 | hb9d3cd8_0 553 KB conda-forge\n", " bcftools-1.22 | h3a4d415_1 1.0 MB bioconda\n", " brotli-1.1.0 | hb03c661_4 19 KB conda-forge\n", " brotli-bin-1.1.0 | hb03c661_4 19 KB conda-forge\n", " bwa-0.7.19 | h577a1d6_1 639 KB bioconda\n", " bzip2-1.0.8 | hda65f42_8 254 KB conda-forge\n", " c-ares-1.34.5 | hb9d3cd8_0 202 KB conda-forge\n", " ca-certificates-2025.8.3 | hbd8a1cb_0 151 KB conda-forge\n", " cairo-1.18.4 | h3394656_0 955 KB conda-forge\n", " contourpy-1.3.3 | py313h7037e92_2 290 KB conda-forge\n", " cycler-0.12.1 | pyhd8ed1ab_1 13 KB conda-forge\n", " font-ttf-dejavu-sans-mono-2.37| hab24e00_0 388 KB conda-forge\n", " font-ttf-inconsolata-3.000 | h77eed37_0 94 KB conda-forge\n", " font-ttf-source-code-pro-2.038| h77eed37_0 684 KB conda-forge\n", " font-ttf-ubuntu-0.83 | h77eed37_3 1.5 MB conda-forge\n", " fontconfig-2.15.0 | h7e30c49_1 259 KB conda-forge\n", " fonts-conda-ecosystem-1 | 0 4 KB conda-forge\n", " fonts-conda-forge-1 | 0 4 KB conda-forge\n", " fonttools-4.60.0 | py313h3dea7bd_0 2.8 MB conda-forge\n", " freetype-2.14.1 | ha770c72_0 169 KB conda-forge\n", " giflib-5.2.2 | hd590300_0 75 KB conda-forge\n", " graphite2-1.3.14 | hecca717_2 97 KB conda-forge\n", " gsl-2.7 | he838d99_0 3.2 MB conda-forge\n", " harfbuzz-11.5.0 | h15599e2_0 2.0 MB conda-forge\n", " htslib-1.22.1 | h566b1c6_0 3.1 MB bioconda\n", " icu-75.1 | he02047a_0 11.6 MB conda-forge\n", " keyutils-1.6.3 | hb9d3cd8_0 131 KB conda-forge\n", " kiwisolver-1.4.9 | py313hc8edb43_1 75 KB conda-forge\n", " krb5-1.21.3 | h659f571_0 1.3 MB conda-forge\n", " lcms2-2.17 | h717163a_0 242 KB conda-forge\n", " ld_impl_linux-64-2.44 | h1423503_1 660 KB conda-forge\n", " lerc-4.0.0 | h0aef613_1 258 KB conda-forge\n", " libblas-3.9.0 |35_h4a7cf45_openblas 17 KB conda-forge\n", " libbrotlicommon-1.1.0 | hb03c661_4 68 KB conda-forge\n", " libbrotlidec-1.1.0 | hb03c661_4 33 KB conda-forge\n", " libbrotlienc-1.1.0 | hb03c661_4 283 KB conda-forge\n", " libcblas-3.9.0 |35_h0358290_openblas 17 KB conda-forge\n", " libcups-2.3.3 | hb8b1518_5 4.3 MB conda-forge\n", " libcurl-8.14.1 | h332b0f4_0 439 KB conda-forge\n", " libdeflate-1.24 | h86f0d12_0 71 KB conda-forge\n", " libedit-3.1.20250104 | pl5321h7949ede_0 132 KB conda-forge\n", " libev-4.33 | hd590300_2 110 KB conda-forge\n", " libexpat-2.7.1 | hecca717_0 73 KB conda-forge\n", " libffi-3.4.6 | h2dba641_1 56 KB conda-forge\n", " libfreetype-2.14.1 | ha770c72_0 7 KB conda-forge\n", " libfreetype6-2.14.1 | h73754d4_0 378 KB conda-forge\n", " libgcc-15.1.0 | h767d61c_5 805 KB conda-forge\n", " libgcc-ng-15.1.0 | h69a702a_5 29 KB conda-forge\n", " libgfortran-15.1.0 | h69a702a_5 28 KB conda-forge\n", " libgfortran5-15.1.0 | hcea5267_5 1.5 MB conda-forge\n", " libglib-2.86.0 | h1fed272_0 3.8 MB conda-forge\n", " libgomp-15.1.0 | h767d61c_5 437 KB conda-forge\n", " libiconv-1.18 | h3b78370_2 772 KB conda-forge\n", " libjpeg-turbo-3.1.0 | hb9d3cd8_0 614 KB conda-forge\n", " liblapack-3.9.0 |35_h47877c9_openblas 17 KB conda-forge\n", " liblzma-5.8.1 | hb9d3cd8_2 110 KB conda-forge\n", " libmpdec-4.0.0 | hb9d3cd8_0 89 KB conda-forge\n", " libnghttp2-1.67.0 | had1ee68_0 651 KB conda-forge\n", " libopenblas-0.3.30 |pthreads_h94d23a6_2 5.7 MB conda-forge\n", " libpng-1.6.50 | h421ea60_1 310 KB conda-forge\n", " libsqlite-3.50.4 | h0c1763c_0 911 KB conda-forge\n", " libssh2-1.11.1 | hcf80075_0 298 KB conda-forge\n", " libstdcxx-15.1.0 | h8f9b012_5 3.7 MB conda-forge\n", " libstdcxx-ng-15.1.0 | h4852527_5 29 KB conda-forge\n", " libtiff-4.7.0 | h8261f1e_6 423 KB conda-forge\n", " libuuid-2.41.1 | he9a06e4_0 36 KB conda-forge\n", " libwebp-base-1.6.0 | hd42ef1d_0 419 KB conda-forge\n", " libxcb-1.17.0 | h8a09558_0 387 KB conda-forge\n", " libxcrypt-4.4.36 | hd590300_1 98 KB conda-forge\n", " libzlib-1.3.1 | hb9d3cd8_2 60 KB conda-forge\n", " matplotlib-base-3.10.6 | py313h683a580_1 8.1 MB conda-forge\n", " munkres-1.0.7 | py_1 10 KB bioconda\n", " ncurses-6.5 | h2d0b736_3 871 KB conda-forge\n", " numpy-2.3.3 | py313hf6604e3_0 8.5 MB conda-forge\n", " openjdk-24.0.2 | h5755bd7_0 111.0 MB conda-forge\n", " openjpeg-2.5.3 | h55fea9a_1 349 KB conda-forge\n", " openssl-3.5.3 | h26f9b46_0 3.0 MB conda-forge\n", " packaging-25.0 | pyh29332c3_1 61 KB conda-forge\n", " pandas-2.3.2 | py313h08cd8bf_0 14.4 MB conda-forge\n", " pcre2-10.46 | h1321c63_0 1.2 MB conda-forge\n", " perl-5.32.1 | 7_hd590300_perl5 12.7 MB conda-forge\n", " pillow-11.3.0 | py313hf46931b_2 965 KB conda-forge\n", " pip-25.2 | pyh145f28c_0 1.1 MB conda-forge\n", " pixman-0.46.4 | h54a6638_1 440 KB conda-forge\n", " pthread-stubs-0.4 | hb9d3cd8_1002 8 KB conda-forge\n", " pyparsing-3.2.4 | pyhcf101f3_0 102 KB conda-forge\n", " python-3.13.7 |h2b335a9_100_cp313 32.0 MB conda-forge\n", " python-dateutil-2.9.0.post0| pyhe01879c_2 228 KB conda-forge\n", " python-tzdata-2025.2 | pyhd8ed1ab_0 141 KB conda-forge\n", " python_abi-3.13 | 8_cp313 7 KB conda-forge\n", " pytz-2025.2 | pyhd8ed1ab_0 185 KB conda-forge\n", " qhull-2020.2 | h434a139_5 540 KB conda-forge\n", " qtlseq-2.2.9 | pyhdfd78af_0 34 KB bioconda\n", " readline-8.2 | h8c095d6_2 276 KB conda-forge\n", " samtools-1.22.1 | h96c455f_0 488 KB bioconda\n", " scipy-1.16.2 | py313h11c21cd_0 16.2 MB conda-forge\n", " seaborn-base-0.13.2 | pyhd8ed1ab_3 223 KB conda-forge\n", " six-1.17.0 | pyhe01879c_1 18 KB conda-forge\n", " snpeff-5.2 | hdfd78af_1 26.7 MB bioconda\n", " tk-8.6.13 |noxft_hd72426e_102 3.1 MB conda-forge\n", " trimmomatic-0.40 | hdfd78af_0 193 KB bioconda\n", " tzdata-2025b | h78e105d_0 120 KB conda-forge\n", " xorg-libice-1.1.2 | hb9d3cd8_0 57 KB conda-forge\n", " xorg-libsm-1.2.6 | he73a12e_0 27 KB conda-forge\n", " xorg-libx11-1.8.12 | h4f16b4b_0 816 KB conda-forge\n", " xorg-libxau-1.0.12 | hb9d3cd8_0 14 KB conda-forge\n", " xorg-libxdmcp-1.1.5 | hb9d3cd8_0 19 KB conda-forge\n", " xorg-libxext-1.3.6 | hb9d3cd8_0 49 KB conda-forge\n", " xorg-libxfixes-6.0.1 | hb9d3cd8_0 19 KB conda-forge\n", " xorg-libxi-1.8.2 | hb9d3cd8_0 46 KB conda-forge\n", " xorg-libxrandr-1.5.4 | hb9d3cd8_0 29 KB conda-forge\n", " xorg-libxrender-0.9.12 | hb9d3cd8_0 32 KB conda-forge\n", " xorg-libxt-1.3.1 | hb9d3cd8_0 371 KB conda-forge\n", " xorg-libxtst-1.2.5 | hb9d3cd8_3 32 KB conda-forge\n", " zlib-1.3.1 | hb9d3cd8_2 90 KB conda-forge\n", " zstd-1.5.7 | hb8e6e7a_2 554 KB conda-forge\n", " ------------------------------------------------------------\n", " Total: 304.9 MB\n", "\n", "The following NEW packages will be INSTALLED:\n", "\n", " _libgcc_mutex conda-forge/linux-64::_libgcc_mutex-0.1-conda_forge \n", " _openmp_mutex conda-forge/linux-64::_openmp_mutex-4.5-2_gnu \n", " alsa-lib conda-forge/linux-64::alsa-lib-1.2.14-hb9d3cd8_0 \n", " bcftools bioconda/linux-64::bcftools-1.22-h3a4d415_1 \n", " brotli conda-forge/linux-64::brotli-1.1.0-hb03c661_4 \n", " brotli-bin conda-forge/linux-64::brotli-bin-1.1.0-hb03c661_4 \n", " bwa bioconda/linux-64::bwa-0.7.19-h577a1d6_1 \n", " bzip2 conda-forge/linux-64::bzip2-1.0.8-hda65f42_8 \n", " c-ares conda-forge/linux-64::c-ares-1.34.5-hb9d3cd8_0 \n", " ca-certificates conda-forge/noarch::ca-certificates-2025.8.3-hbd8a1cb_0 \n", " cairo conda-forge/linux-64::cairo-1.18.4-h3394656_0 \n", " contourpy conda-forge/linux-64::contourpy-1.3.3-py313h7037e92_2 \n", " cycler conda-forge/noarch::cycler-0.12.1-pyhd8ed1ab_1 \n", " font-ttf-dejavu-s~ conda-forge/noarch::font-ttf-dejavu-sans-mono-2.37-hab24e00_0 \n", " font-ttf-inconsol~ conda-forge/noarch::font-ttf-inconsolata-3.000-h77eed37_0 \n", " font-ttf-source-c~ conda-forge/noarch::font-ttf-source-code-pro-2.038-h77eed37_0 \n", " font-ttf-ubuntu conda-forge/noarch::font-ttf-ubuntu-0.83-h77eed37_3 \n", " fontconfig conda-forge/linux-64::fontconfig-2.15.0-h7e30c49_1 \n", " fonts-conda-ecosy~ conda-forge/noarch::fonts-conda-ecosystem-1-0 \n", " fonts-conda-forge conda-forge/noarch::fonts-conda-forge-1-0 \n", " fonttools conda-forge/linux-64::fonttools-4.60.0-py313h3dea7bd_0 \n", " freetype conda-forge/linux-64::freetype-2.14.1-ha770c72_0 \n", " giflib conda-forge/linux-64::giflib-5.2.2-hd590300_0 \n", " graphite2 conda-forge/linux-64::graphite2-1.3.14-hecca717_2 \n", " gsl conda-forge/linux-64::gsl-2.7-he838d99_0 \n", " harfbuzz conda-forge/linux-64::harfbuzz-11.5.0-h15599e2_0 \n", " htslib bioconda/linux-64::htslib-1.22.1-h566b1c6_0 \n", " icu conda-forge/linux-64::icu-75.1-he02047a_0 \n", " keyutils conda-forge/linux-64::keyutils-1.6.3-hb9d3cd8_0 \n", " kiwisolver conda-forge/linux-64::kiwisolver-1.4.9-py313hc8edb43_1 \n", " krb5 conda-forge/linux-64::krb5-1.21.3-h659f571_0 \n", " lcms2 conda-forge/linux-64::lcms2-2.17-h717163a_0 \n", " ld_impl_linux-64 conda-forge/linux-64::ld_impl_linux-64-2.44-h1423503_1 \n", " lerc conda-forge/linux-64::lerc-4.0.0-h0aef613_1 \n", " libblas conda-forge/linux-64::libblas-3.9.0-35_h4a7cf45_openblas \n", " libbrotlicommon conda-forge/linux-64::libbrotlicommon-1.1.0-hb03c661_4 \n", " libbrotlidec conda-forge/linux-64::libbrotlidec-1.1.0-hb03c661_4 \n", " libbrotlienc conda-forge/linux-64::libbrotlienc-1.1.0-hb03c661_4 \n", " libcblas conda-forge/linux-64::libcblas-3.9.0-35_h0358290_openblas \n", " libcups conda-forge/linux-64::libcups-2.3.3-hb8b1518_5 \n", " libcurl conda-forge/linux-64::libcurl-8.14.1-h332b0f4_0 \n", " libdeflate conda-forge/linux-64::libdeflate-1.24-h86f0d12_0 \n", " libedit conda-forge/linux-64::libedit-3.1.20250104-pl5321h7949ede_0 \n", " libev conda-forge/linux-64::libev-4.33-hd590300_2 \n", " libexpat conda-forge/linux-64::libexpat-2.7.1-hecca717_0 \n", " libffi conda-forge/linux-64::libffi-3.4.6-h2dba641_1 \n", " libfreetype conda-forge/linux-64::libfreetype-2.14.1-ha770c72_0 \n", " libfreetype6 conda-forge/linux-64::libfreetype6-2.14.1-h73754d4_0 \n", " libgcc conda-forge/linux-64::libgcc-15.1.0-h767d61c_5 \n", " libgcc-ng conda-forge/linux-64::libgcc-ng-15.1.0-h69a702a_5 \n", " libgfortran conda-forge/linux-64::libgfortran-15.1.0-h69a702a_5 \n", " libgfortran5 conda-forge/linux-64::libgfortran5-15.1.0-hcea5267_5 \n", " libglib conda-forge/linux-64::libglib-2.86.0-h1fed272_0 \n", " libgomp conda-forge/linux-64::libgomp-15.1.0-h767d61c_5 \n", " libiconv conda-forge/linux-64::libiconv-1.18-h3b78370_2 \n", " libjpeg-turbo conda-forge/linux-64::libjpeg-turbo-3.1.0-hb9d3cd8_0 \n", " liblapack conda-forge/linux-64::liblapack-3.9.0-35_h47877c9_openblas \n", " liblzma conda-forge/linux-64::liblzma-5.8.1-hb9d3cd8_2 \n", " libmpdec conda-forge/linux-64::libmpdec-4.0.0-hb9d3cd8_0 \n", " libnghttp2 conda-forge/linux-64::libnghttp2-1.67.0-had1ee68_0 \n", " libopenblas conda-forge/linux-64::libopenblas-0.3.30-pthreads_h94d23a6_2 \n", " libpng conda-forge/linux-64::libpng-1.6.50-h421ea60_1 \n", " libsqlite conda-forge/linux-64::libsqlite-3.50.4-h0c1763c_0 \n", " libssh2 conda-forge/linux-64::libssh2-1.11.1-hcf80075_0 \n", " libstdcxx conda-forge/linux-64::libstdcxx-15.1.0-h8f9b012_5 \n", " libstdcxx-ng conda-forge/linux-64::libstdcxx-ng-15.1.0-h4852527_5 \n", " libtiff conda-forge/linux-64::libtiff-4.7.0-h8261f1e_6 \n", " libuuid conda-forge/linux-64::libuuid-2.41.1-he9a06e4_0 \n", " libwebp-base conda-forge/linux-64::libwebp-base-1.6.0-hd42ef1d_0 \n", " libxcb conda-forge/linux-64::libxcb-1.17.0-h8a09558_0 \n", " libxcrypt conda-forge/linux-64::libxcrypt-4.4.36-hd590300_1 \n", " libzlib conda-forge/linux-64::libzlib-1.3.1-hb9d3cd8_2 \n", " matplotlib-base conda-forge/linux-64::matplotlib-base-3.10.6-py313h683a580_1 \n", " munkres bioconda/noarch::munkres-1.0.7-py_1 \n", " ncurses conda-forge/linux-64::ncurses-6.5-h2d0b736_3 \n", " numpy conda-forge/linux-64::numpy-2.3.3-py313hf6604e3_0 \n", " openjdk conda-forge/linux-64::openjdk-24.0.2-h5755bd7_0 \n", " openjpeg conda-forge/linux-64::openjpeg-2.5.3-h55fea9a_1 \n", " openssl conda-forge/linux-64::openssl-3.5.3-h26f9b46_0 \n", " packaging conda-forge/noarch::packaging-25.0-pyh29332c3_1 \n", " pandas conda-forge/linux-64::pandas-2.3.2-py313h08cd8bf_0 \n", " pcre2 conda-forge/linux-64::pcre2-10.46-h1321c63_0 \n", " perl conda-forge/linux-64::perl-5.32.1-7_hd590300_perl5 \n", " pillow conda-forge/linux-64::pillow-11.3.0-py313hf46931b_2 \n", " pip conda-forge/noarch::pip-25.2-pyh145f28c_0 \n", " pixman conda-forge/linux-64::pixman-0.46.4-h54a6638_1 \n", " pthread-stubs conda-forge/linux-64::pthread-stubs-0.4-hb9d3cd8_1002 \n", " pyparsing conda-forge/noarch::pyparsing-3.2.4-pyhcf101f3_0 \n", " python conda-forge/linux-64::python-3.13.7-h2b335a9_100_cp313 \n", " python-dateutil conda-forge/noarch::python-dateutil-2.9.0.post0-pyhe01879c_2 \n", " python-tzdata conda-forge/noarch::python-tzdata-2025.2-pyhd8ed1ab_0 \n", " python_abi conda-forge/noarch::python_abi-3.13-8_cp313 \n", " pytz conda-forge/noarch::pytz-2025.2-pyhd8ed1ab_0 \n", " qhull conda-forge/linux-64::qhull-2020.2-h434a139_5 \n", " qtlseq bioconda/noarch::qtlseq-2.2.9-pyhdfd78af_0 \n", " readline conda-forge/linux-64::readline-8.2-h8c095d6_2 \n", " samtools bioconda/linux-64::samtools-1.22.1-h96c455f_0 \n", " scipy conda-forge/linux-64::scipy-1.16.2-py313h11c21cd_0 \n", " seaborn-base conda-forge/noarch::seaborn-base-0.13.2-pyhd8ed1ab_3 \n", " six conda-forge/noarch::six-1.17.0-pyhe01879c_1 \n", " snpeff bioconda/noarch::snpeff-5.2-hdfd78af_1 \n", " tk conda-forge/linux-64::tk-8.6.13-noxft_hd72426e_102 \n", " trimmomatic bioconda/noarch::trimmomatic-0.40-hdfd78af_0 \n", " tzdata conda-forge/noarch::tzdata-2025b-h78e105d_0 \n", " xorg-libice conda-forge/linux-64::xorg-libice-1.1.2-hb9d3cd8_0 \n", " xorg-libsm conda-forge/linux-64::xorg-libsm-1.2.6-he73a12e_0 \n", " xorg-libx11 conda-forge/linux-64::xorg-libx11-1.8.12-h4f16b4b_0 \n", " xorg-libxau conda-forge/linux-64::xorg-libxau-1.0.12-hb9d3cd8_0 \n", " xorg-libxdmcp conda-forge/linux-64::xorg-libxdmcp-1.1.5-hb9d3cd8_0 \n", " xorg-libxext conda-forge/linux-64::xorg-libxext-1.3.6-hb9d3cd8_0 \n", " xorg-libxfixes conda-forge/linux-64::xorg-libxfixes-6.0.1-hb9d3cd8_0 \n", " xorg-libxi conda-forge/linux-64::xorg-libxi-1.8.2-hb9d3cd8_0 \n", " xorg-libxrandr conda-forge/linux-64::xorg-libxrandr-1.5.4-hb9d3cd8_0 \n", " xorg-libxrender conda-forge/linux-64::xorg-libxrender-0.9.12-hb9d3cd8_0 \n", " xorg-libxt conda-forge/linux-64::xorg-libxt-1.3.1-hb9d3cd8_0 \n", " xorg-libxtst conda-forge/linux-64::xorg-libxtst-1.2.5-hb9d3cd8_3 \n", " zlib conda-forge/linux-64::zlib-1.3.1-hb9d3cd8_2 \n", " zstd conda-forge/linux-64::zstd-1.5.7-hb8e6e7a_2 \n", "\n", "\n", "\n", "Downloading and Extracting Packages:\n", "openjdk-24.0.2 | 111.0 MB | : 0% 0/1 [00:00 -p -b1 \n", " -b2 -n1 -n2 -o \n", " [-F ] [-T] [-e ]\n", "\n", "QTL-seq version 2.2.9\n", "\n", "options:\n", " -h, --help show this help message and exit\n", " -r, --ref Reference FASTA file.\n", " -p, --parent FASTQ or BAM file of the parent. If specifying\n", " FASTQ, separate paired-end files with a comma,\n", " e.g., -p fastq1,fastq2. This option can be\n", " used multiple times.\n", " -b1, --bulk1 FASTQ or BAM file of bulk 1. If specifying\n", " FASTQ, separate paired-end files with a comma,\n", " e.g., -b1 fastq1,fastq2. This option can be\n", " used multiple times.\n", " -b2, --bulk2 FASTQ or BAM file of bulk 2. If specifying\n", " FASTQ, separate paired-end files with a comma,\n", " e.g., -b2 fastq1,fastq2. This option can be\n", " used multiple times.\n", " -n1, --N-bulk1 Number of individuals in bulk 1.\n", " -n2, --N-bulk2 Number of individuals in bulk 2.\n", " -o, --out Output directory. The specified directory must not\n", " already exist.\n", " -F, --filial Filial generation. This parameter must be greater\n", " than 1. [2]\n", " -t, --threads Number of threads. If a value less than 1 is specified,\n", " QTL-seq will use the maximum available threads. [2]\n", " -w, --window Window size in kilobases (kb). [2000]\n", " -s, --step Step size in kilobases (kb). [100]\n", " -D, --max-depth Maximum depth of variants to be used. [250]\n", " -d, --min-depth Minimum depth of variants to be used. [8]\n", " -N, --N-rep Number of replicates for simulations to generate\n", " null distribution. [5000]\n", " -T, --trim Trim FASTQ files using Trimmomatic.\n", " -a, --adapter FASTA file containing adapter sequences. This option\n", " is used when \"-T\" is specified for trimming.\n", " --trim-params Parameters for Trimmomatic. Input parameters\n", " must be comma-separated in the following order:\n", " Phred score, ILLUMINACLIP, LEADING, TRAILING,\n", " SLIDINGWINDOW, MINLEN. To remove Illumina adapters,\n", " specify the adapter FASTA file with \"--adapter\".\n", " If not specified, adapter trimming will be skipped.\n", " [33,:2:30:10,20,20,4:15,75]\n", " -e, --snpEff Predict causal variants using SnpEff. Check\n", " available databases in SnpEff.\n", " --line-colors Colors for threshold lines in plots. Specify a\n", " comma-separated list in the order of SNP-index,\n", " p95, and p99. [\"#C3310F,#009E72,#FDB003\"]\n", " --dot-colors Colors for dots in plots. Specify a\n", " comma-separated list in the order of bulk1,\n", " bulk2, and delta. [\"#74D3AE,#FFBE0B,#B3B8DD\"]\n", " --mem Maximum memory per thread when sorting BAM files;\n", " suffixes K/M/G are recognized. [1G]\n", " -q, --min-MQ Minimum mapping quality for mpileup. [40]\n", " -Q, --min-BQ Minimum base quality for mpileup. [18]\n", " -C, --adjust-MQ Adjust the mapping quality for mpileup. The default\n", " setting is optimized for BWA. [50]\n", " -v, --version show program's version number and exit\n", "\n" ] } ], "source": [ "!/usr/local/bin/conda run -n qtlseq qtlseq -h\n", "# Repeat for others" ] }, { "cell_type": "markdown", "metadata": { "id": "fIfrHLvt3fL_" }, "source": [ "Installing java" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "UxCljZq7T4a1", "outputId": "76ccc833-959b-44cb-9df5-491a41c2d84f" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "\u001b[1;33mJupyter detected\u001b[0m\u001b[1;33m...\u001b[0m\n", "\u001b[1;32m2\u001b[0m\u001b[1;32m channel Terms of Service accepted\u001b[0m\n", "Channels:\n", " - conda-forge\n", " - bioconda\n", " - defaults\n", "Platform: linux-64\n", "Collecting package metadata (repodata.json): - \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\bdone\n", "Solving environment: \\ \b\b| \b\bdone\n", "\n", "# All requested packages already installed.\n", "\n", "\n", "CondaError: Run 'conda init' before 'conda activate'\n", "\n", "/bin/bash: line 1: snpEff: command not found\n", "/bin/bash: line 1: trimmomatic: command not found\n", "/bin/bash: line 1: bwa: command not found\n" ] } ], "source": [ "# Install Java for snpEff/trimmomatic\n", "!/usr/local/bin/conda install -n qtlseq -c conda-forge openjdk -y\n", "\n", "# Re-test (using direct activation)\n", "!source /usr/local/etc/profile.d/conda.sh\n", "!conda activate qtlseq\n", "!snpEff --help | head -5\n", "!trimmomatic --help | head -5\n", "!bwa | head -5" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "CrxdmnOQVFc_", "outputId": "2ce302b6-bfa4-4c7d-d406-338b0c69e395" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "\u001b[1;33mJupyter detected\u001b[0m\u001b[1;33m...\u001b[0m\n", "\u001b[1;32m2\u001b[0m\u001b[1;32m channel Terms of Service accepted\u001b[0m\n", "Channels:\n", " - conda-forge\n", " - bioconda\n", " - defaults\n", "Platform: linux-64\n", "Collecting package metadata (repodata.json): - \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\bdone\n", "Solving environment: / \b\b- \b\bdone\n", "\n", "# All requested packages already installed.\n", "\n", "usage: qtlseq -r -p -b1 \n", " -b2 -n1 -n2 -o \n", " [-F ] [-T] [-e ]\n", "\n", "QTL-seq version 2.2.9\n", "\n", "options:\n", " -h, --help show this help message and exit\n", " -r, --ref Reference FASTA file.\n", " -p, --parent FASTQ or BAM file of the parent. If specifying\n", " FASTQ, separate paired-end files with a comma,\n", " e.g., -p fastq1,fastq2. This option can be\n", " used multiple times.\n", " -b1, --bulk1 FASTQ or BAM file of bulk 1. If specifying\n", " FASTQ, separate paired-end files with a comma,\n", " e.g., -b1 fastq1,fastq2. This option can be\n", " used multiple times.\n", " -b2, --bulk2 FASTQ or BAM file of bulk 2. If specifying\n", " FASTQ, separate paired-end files with a comma,\n", " e.g., -b2 fastq1,fastq2. This option can be\n", " used multiple times.\n", " -n1, --N-bulk1 Number of individuals in bulk 1.\n", " -n2, --N-bulk2 Number of individuals in bulk 2.\n", " -o, --out Output directory. The specified directory must not\n", " already exist.\n", " -F, --filial Filial generation. This parameter must be greater\n", " than 1. [2]\n", " -t, --threads Number of threads. If a value less than 1 is specified,\n", " QTL-seq will use the maximum available threads. [2]\n", " -w, --window Window size in kilobases (kb). [2000]\n", " -s, --step Step size in kilobases (kb). [100]\n", " -D, --max-depth Maximum depth of variants to be used. [250]\n", " -d, --min-depth Minimum depth of variants to be used. [8]\n", " -N, --N-rep Number of replicates for simulations to generate\n", " null distribution. [5000]\n", " -T, --trim Trim FASTQ files using Trimmomatic.\n", " -a, --adapter FASTA file containing adapter sequences. This option\n", " is used when \"-T\" is specified for trimming.\n", " --trim-params Parameters for Trimmomatic. Input parameters\n", " must be comma-separated in the following order:\n", " Phred score, ILLUMINACLIP, LEADING, TRAILING,\n", " SLIDINGWINDOW, MINLEN. To remove Illumina adapters,\n", " specify the adapter FASTA file with \"--adapter\".\n", " If not specified, adapter trimming will be skipped.\n", " [33,:2:30:10,20,20,4:15,75]\n", " -e, --snpEff Predict causal variants using SnpEff. Check\n", " available databases in SnpEff.\n", " --line-colors Colors for threshold lines in plots. Specify a\n", " comma-separated list in the order of SNP-index,\n", " p95, and p99. [\"#C3310F,#009E72,#FDB003\"]\n", " --dot-colors Colors for dots in plots. Specify a\n", " comma-separated list in the order of bulk1,\n", " bulk2, and delta. [\"#74D3AE,#FFBE0B,#B3B8DD\"]\n", " --mem Maximum memory per thread when sorting BAM files;\n", " suffixes K/M/G are recognized. [1G]\n", " -q, --min-MQ Minimum mapping quality for mpileup. [40]\n", " -Q, --min-BQ Minimum base quality for mpileup. [18]\n", " -C, --adjust-MQ Adjust the mapping quality for mpileup. The default\n", " setting is optimized for BWA. [50]\n", " -v, --version show program's version number and exit\n", "\n", "Error :\tUnknown option '--help'\n", "Command line :\tSnpEff --help \n", "\n", "snpEff version SnpEff 5.2 (build 2023-09-29 06:17), by Pablo Cingolani\n", "Usage: snpEff [eff] [options] genome_version [input_file]\n", "\n", "\n", "\tvariants_file : Default is STDIN\n", "\n", "\n", "\n", "Options:\n", "\t-chr : Prepend 'string' to chromosome name (e.g. 'chr1' instead of '1'). Only on TXT output.\n", "\t-classic : Use old style annotations instead of Sequence Ontology and Hgvs.\n", "\t-csvStats : Create CSV summary file.\n", "\t-download : Download reference genome if not available. Default: true\n", "\t-i : Input format [ vcf, bed ]. Default: VCF.\n", "\t-fileList : Input actually contains a list of files to process.\n", "\t-o : Ouput format [ vcf, gatk, bed, bedAnn ]. Default: VCF.\n", "\t-s , -stats, -htmlStats : Create HTML summary file. Default is 'snpEff_summary.html'\n", "\t-noStats : Do not create stats (summary) file\n", "\n", "Results filter options:\n", "\t-fi , -filterInterval : Only analyze changes that intersect with the intervals specified in this file (you may use this option many times)\n", "\t-no-downstream : Do not show DOWNSTREAM changes\n", "\t-no-intergenic : Do not show INTERGENIC changes\n", "\t-no-intron : Do not show INTRON changes\n", "\t-no-upstream : Do not show UPSTREAM changes\n", "\t-no-utr : Do not show 5_PRIME_UTR or 3_PRIME_UTR changes\n", "\t-no : Do not show 'EffectType'. This option can be used several times.\n", "\n", "Annotations options:\n", "\t-cancer : Perform 'cancer' comparisons (Somatic vs Germline). Default: false\n", "\t-cancerSamples : Two column TXT file defining 'oringinal \\t derived' samples.\n", "\t-fastaProt : Create an output file containing the resulting protein sequences.\n", "\t-formatEff : Use 'EFF' field compatible with older versions (instead of 'ANN').\n", "\t-geneId : Use gene ID instead of gene name (VCF output). Default: false\n", "\t-hgvs : Use HGVS annotations for amino acid sub-field. Default: true\n", "\t-hgvsOld : Use old HGVS notation. Default: false\n", "\t-hgvs1LetterAa : Use one letter Amino acid codes in HGVS notation. Default: false\n", "\t-hgvsTrId : Use transcript ID in HGVS notation. Default: false\n", "\t-lof : Add loss of function (LOF) and Nonsense mediated decay (NMD) tags.\n", "\t-noHgvs : Do not add HGVS annotations.\n", "\t-noLof : Do not add LOF and NMD annotations.\n", "\t-noShiftHgvs : Do not shift variants according to HGVS notation (most 3prime end).\n", "\t-oicr : Add OICR tag in VCF file. Default: false\n", "\t-sequenceOntology : Use Sequence Ontology terms. Default: true\n", "\n", "Generic options:\n", "\t-c , -config : Specify config file\n", "\t-configOption name=value : Override a config file option\n", "\t-d , -debug : Debug mode (very verbose).\n", "\t-dataDir : Override data_dir parameter from config file.\n", "\t-download : Download a SnpEff database, if not available locally. Default: true\n", "\t-nodownload : Do not download a SnpEff database, if not available locally.\n", "\t-h , -help : Show this help and exit\n", "\t-noLog : Do not report usage statistics to server\n", "\t-q , -quiet : Quiet mode (do not show any messages or errors)\n", "\t-v , -verbose : Verbose mode\n", "\t-version : Show version number and exit\n", "\n", "Database options:\n", "\t-canon : Only use canonical transcripts.\n", "\t-canonList : Only use canonical transcripts, replace some transcripts using the 'gene_id \t transcript_id' entries in .\n", "\t-tag : Only use transcript having a tag 'tagName'. This option can be used multiple times.\n", "\t-notag : Filter out transcript having a tag 'tagName'. This option can be used multiple times.\n", "\t-interaction : Annotate using interactions (requires interaction database). Default: true\n", "\t-interval : Use a custom intervals in TXT/BED/BigBed/VCF/GFF file (you may use this option many times)\n", "\t-maxTSL : Only use transcripts having Transcript Support Level lower than .\n", "\t-motif : Annotate using motifs (requires Motif database). Default: true\n", "\t-nextProt : Annotate using NextProt (requires NextProt database).\n", "\t-noGenome : Do not load any genomic database (e.g. annotate using custom files).\n", "\t-noExpandIUB : Disable IUB code expansion in input variants\n", "\t-noInteraction : Disable inteaction annotations\n", "\t-noMotif : Disable motif annotations.\n", "\t-noNextProt : Disable NextProt annotations.\n", "\t-onlyReg : Only use regulation tracks.\n", "\t-onlyProtein : Only use protein coding transcripts. Default: false\n", "\t-onlyTr : Only use the transcripts in this file. Format: One transcript ID per line.\n", "\t-reg : Regulation track to use (this option can be used add several times).\n", "\t-ss , -spliceSiteSize : Set size for splice sites (donor and acceptor) in bases. Default: 2\n", "\t-spliceRegionExonSize : Set size for splice site region within exons. Default: 3 bases\n", "\t-spliceRegionIntronMin : Set minimum number of bases for splice site region within intron. Default: 3 bases\n", "\t-spliceRegionIntronMax : Set maximum number of bases for splice site region within intron. Default: 8 bases\n", "\t-strict : Only use 'validated' transcripts (i.e. sequence has been checked). Default: false\n", "\t-ud , -upDownStreamLen : Set upstream downstream interval length (in bases)\n", "\n", "ERROR conda.cli.main_run:execute(127): `conda run snpEff --help` failed. (See above for error)\n", "[0.001s][warning][os,container] Cgroup memory controller path at '/sys/fs/cgroup' seems to have moved to '/../../jupyter-children', detected limits won't be accurate\n", "[0.001s][warning][os,container] Cgroup cpu controller path at '/sys/fs/cgroup' seems to have moved to '/../../jupyter-children', detected limits won't be accurate\n", "\n", "Usage: \n", " PE [-version] [-threads ] [-phred33|-phred64] [-trimlog ] [-summary ] [-quiet] [-validatePairs] [-basein | ] [-baseout | ] ...\n", " or: \n", " SE [-version] [-threads ] [-phred33|-phred64] [-trimlog ] [-summary ] [-quiet] ...\n", " or: \n", " -version\n", "\n", "ERROR conda.cli.main_run:execute(127): `conda run trimmomatic --help` failed. (See above for error)\n", "[0.001s][warning][os,container] Cgroup memory controller path at '/sys/fs/cgroup' seems to have moved to '/../../jupyter-children', detected limits won't be accurate\n", "[0.001s][warning][os,container] Cgroup cpu controller path at '/sys/fs/cgroup' seems to have moved to '/../../jupyter-children', detected limits won't be accurate\n", "\n", "\n", "Program: bwa (alignment via Burrows-Wheeler transformation)\n", "Version: 0.7.19-r1273\n", "Contact: Heng Li \n", "\n", "Usage: bwa [options]\n", "\n", "Command: index index sequences in the FASTA format\n", " mem BWA-MEM algorithm\n", " fastmap identify super-maximal exact matches\n", " pemerge merge overlapping paired ends (EXPERIMENTAL)\n", " aln gapped/ungapped alignment\n", " samse generate alignment (single ended)\n", " sampe generate alignment (paired ended)\n", " bwasw BWA-SW for long queries (DEPRECATED)\n", "\n", " shm manage indices in shared memory\n", " fa2pac convert FASTA to PAC format\n", " pac2bwt generate BWT from PAC\n", " pac2bwtgen alternative algorithm for generating BWT\n", " bwtupdate update .bwt to the new format\n", " bwt2sa generate SA from BWT and Occ\n", "\n", "Note: To use BWA, you need to first index the genome with `bwa index'.\n", " There are three alignment algorithms in BWA: `mem', `bwasw', and\n", " `aln/samse/sampe'. If you are not sure which to use, try `bwa mem'\n", " first. Please `man ./bwa.1' for the manual.\n", "\n", "\n", "ERROR conda.cli.main_run:execute(127): `conda run bwa` failed. (See above for error)\n", "samtools 1.22.1\n", "bcftools 1.22\n" ] } ], "source": [ "# Install Java for snpEff and trimmomatic\n", "!/usr/local/bin/conda install -n qtlseq -c conda-forge openjdk -y\n", "\n", "# Source Conda\n", "!source /usr/local/etc/profile.d/conda.sh\n", "\n", "# Unset PYTHONPATH\n", "!unset PYTHONPATH\n", "\n", "# Test all tools with conda run\n", "!/usr/local/bin/conda run -n qtlseq qtlseq -h\n", "!/usr/local/bin/conda run -n qtlseq snpEff --help | head -5\n", "!/usr/local/bin/conda run -n qtlseq trimmomatic --help | head -5\n", "!/usr/local/bin/conda run -n qtlseq bwa | head -5\n", "!/usr/local/bin/conda run -n qtlseq samtools --version | head -1\n", "!/usr/local/bin/conda run -n qtlseq bcftools --version | head -1" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "ZhFpD9U8Vh04", "outputId": "fa65d320-cd0b-421f-ada0-89b58ee76d82" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "# packages in environment at /usr/local/envs/qtlseq:\n", "bcftools 1.22 h3a4d415_1 bioconda\n", "bwa 0.7.19 h577a1d6_1 bioconda\n", "openjdk 24.0.2 h5755bd7_0 conda-forge\n", "qtlseq 2.2.9 pyhdfd78af_0 bioconda\n", "samtools 1.22.1 h96c455f_0 bioconda\n", "snpeff 5.2 hdfd78af_1 bioconda\n", "trimmomatic 0.40 hdfd78af_0 bioconda\n" ] } ], "source": [ "!/usr/local/bin/conda list -n qtlseq | grep -E \"qtlseq|snpeff|trimmomatic|bwa|samtools|bcftools|openjdk\"" ] }, { "cell_type": "markdown", "source": [ "File upload" ], "metadata": { "id": "cA6JXajgjzRn" } }, { "cell_type": "code", "source": [ "from google.colab import files\n", "\n", "# Prompt to upload exactly 4 files\n", "print(\"Please upload 4 files (e.g., reference.fasta, parent.1.fastq.bz2, parent.2.fastq.bz2, bulk_1.1.fastq.bz2)\")\n", "uploaded = files.upload()\n", "\n", "# Verify exactly 4 files were uploaded\n", "if len(uploaded) == 4:\n", " print(\"Successfully uploaded 4 files:\", list(uploaded.keys()))\n", "else:\n", " print(f\"Error: Uploaded {len(uploaded)} files. Please upload exactly 4 files.\")" ], "metadata": { "id": "ojncC_jFjyC0" }, "execution_count": null, "outputs": [] }, { "cell_type": "markdown", "source": [ "Unzipping" ], "metadata": { "id": "WN2qN5BSkIvB" } }, { "cell_type": "code", "source": [ "# Install bzip2 and unzip\n", "!apt-get update && apt-get install -y bzip2 unzip" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "yZr4G4lXjfrh", "outputId": "bb73542d-6b95-4686-badb-fa45f3b6f0a2" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "\r0% [Working]\r \rGet:1 https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/ InRelease [3,632 B]\n", "\r0% [Connecting to archive.ubuntu.com (185.125.190.82)] [Connecting to security.\r0% [Connecting to archive.ubuntu.com (185.125.190.82)] [Connecting to security.\r \rGet:2 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 InRelease [1,581 B]\n", "Hit:3 https://cli.github.com/packages stable InRelease\n", "Get:4 http://security.ubuntu.com/ubuntu jammy-security InRelease [129 kB]\n", "Hit:5 http://archive.ubuntu.com/ubuntu jammy InRelease\n", "Get:6 https://r2u.stat.illinois.edu/ubuntu jammy InRelease [6,555 B]\n", "Get:7 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [128 kB]\n", "Get:8 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 Packages [2,007 kB]\n", "Hit:9 https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu jammy InRelease\n", "Hit:10 https://ppa.launchpadcontent.net/graphics-drivers/ppa/ubuntu jammy InRelease\n", "Hit:11 https://ppa.launchpadcontent.net/ubuntugis/ppa/ubuntu jammy InRelease\n", "Get:12 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [127 kB]\n", "Get:13 https://r2u.stat.illinois.edu/ubuntu jammy/main amd64 Packages [2,798 kB]\n", "Get:14 https://r2u.stat.illinois.edu/ubuntu jammy/main all Packages [9,280 kB]\n", "Get:15 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages [71.0 kB]\n", "Get:16 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [5,449 kB]\n", "Get:17 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [3,641 kB]\n", "Get:18 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1,581 kB]\n", "Get:19 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages [69.1 kB]\n", "Get:20 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [5,691 kB]\n", "Fetched 31.0 MB in 3s (9,627 kB/s)\n", "Reading package lists... Done\n", "W: Skipping acquire of configured file 'main/source/Sources' as repository 'https://r2u.stat.illinois.edu/ubuntu jammy InRelease' does not seem to provide it (sources.list entry misspelt?)\n", "Reading package lists... Done\n", "Building dependency tree... Done\n", "Reading state information... Done\n", "bzip2 is already the newest version (1.0.8-5build1).\n", "bzip2 set to manually installed.\n", "unzip is already the newest version (6.0-26ubuntu3.2).\n", "0 upgraded, 0 newly installed, 0 to remove and 40 not upgraded.\n" ] } ] }, { "cell_type": "markdown", "source": [ "Creating directory for decompreesed files" ], "metadata": { "id": "UVPmjj1WkMer" } }, { "cell_type": "code", "source": [ "import os\n", "import subprocess\n", "import shutil\n", "\n", "# Create directory for decompressed files\n", "decompressed_dir = \"/content/decompressed\"\n", "os.makedirs(decompressed_dir, exist_ok=True)\n", "\n", "# Get list of files in /content\n", "files = [f for f in os.listdir(\"/content\") if os.path.isfile(os.path.join(\"/content\", f))]\n", "\n", "if not files:\n", " print(\"Error: No files found in /content\")\n", "else:\n", " for file in files:\n", " file_path = os.path.join(\"/content\", file)\n", " if file.endswith((\".fastq.bz2\", \".fq.bz2\")):\n", " print(f\"Decompressing {file} to .gz\")\n", " output_file = os.path.join(decompressed_dir, f\"{os.path.splitext(file)[0]}.gz\")\n", " try:\n", " subprocess.run(f\"bunzip2 -c {file_path} | gzip > {output_file}\", shell=True, check=True)\n", " print(f\"Successfully decompressed {file}\")\n", " except subprocess.CalledProcessError:\n", " print(f\"Error: Failed to decompress {file}\")\n", " elif file.endswith((\".fastq.gz\", \".fq.gz\")):\n", " print(f\"Copying {file} (already .gz)\")\n", " output_file = os.path.join(decompressed_dir, file)\n", " try:\n", " shutil.copy(file_path, output_file)\n", " print(f\"Successfully copied {file}\")\n", " except Exception as e:\n", " print(f\"Error: Failed to copy {file}: {e}\")\n", " elif file.endswith((\".fastq.zip\", \".fq.zip\")):\n", " print(f\"Decompressing {file} to .gz\")\n", " output_file = os.path.join(decompressed_dir, f\"{os.path.splitext(file)[0]}.gz\")\n", " try:\n", " subprocess.run(f\"unzip -p {file_path} | gzip > {output_file}\", shell=True, check=True)\n", " print(f\"Successfully decompressed {file}\")\n", " except subprocess.CalledProcessError:\n", " print(f\"Error: Failed to decompress {file}\")\n", " elif file.endswith(\".fasta\"):\n", " print(f\"Copying {file} (uncompressed FASTA)\")\n", " output_file = os.path.join(decompressed_dir, file)\n", " try:\n", " shutil.copy(file_path, output_file)\n", " print(f\"Successfully copied {file}\")\n", " except Exception as e:\n", " print(f\"Error: Failed to copy {file}: {e}\")\n", " else:\n", " print(f\"Skipping {file} (unsupported format)\")\n", "\n", "# Verify decompressed files\n", "print(\"Listing decompressed files:\")\n", "subprocess.run('ls -l /content/decompressed | grep -E \"(fasta|fastq\\.gz|fq\\.gz)\"', shell=True)" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "x5YPCfhEl4Qi", "outputId": "723a1add-af6a-476a-eb0f-e3e3bfc17d8a" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Copying qtlseq_bulk1.1.fastq.gz (already .gz)\n", "Successfully copied qtlseq_bulk1.1.fastq.gz\n", "Copying qtlseq_parent.1.fastq.gz (already .gz)\n", "Successfully copied qtlseq_parent.1.fastq.gz\n", "Copying qtlseq_bulk1.2.fastq.gz (already .gz)\n", "Successfully copied qtlseq_bulk1.2.fastq.gz\n", "Skipping Miniconda3-latest-Linux-x86_64.sh (unsupported format)\n", "Copying qtlseq_ref.fasta (uncompressed FASTA)\n", "Successfully copied qtlseq_ref.fasta\n", "Listing decompressed files:\n" ] }, { "output_type": "stream", "name": "stderr", "text": [ "<>:54: SyntaxWarning: invalid escape sequence '\\.'\n", "<>:54: SyntaxWarning: invalid escape sequence '\\.'\n", "/tmp/ipython-input-3768896321.py:54: SyntaxWarning: invalid escape sequence '\\.'\n", " subprocess.run('ls -l /content/decompressed | grep -E \"(fasta|fastq\\.gz|fq\\.gz)\"', shell=True)\n" ] }, { "output_type": "execute_result", "data": { "text/plain": [ "CompletedProcess(args='ls -l /content/decompressed | grep -E \"(fasta|fastq\\\\.gz|fq\\\\.gz)\"', returncode=0)" ] }, "metadata": {}, "execution_count": 29 } ] }, { "cell_type": "markdown", "source": [ "Decompressing files" ], "metadata": { "id": "lCdX92iHkakw" } }, { "cell_type": "code", "source": [ "%%bash\n", "#!/bin/bash\n", "# Install tools\n", "apt-get update && apt-get install -y bzip2 unzip || { echo \"Error: Failed to install bzip2 or unzip\"; exit 1; }\n", "\n", "# Create directory\n", "mkdir -p /content/decompressed || { echo \"Error: Failed to create /content/decompressed\"; exit 1; }\n", "\n", "# Debug: List all files in /content\n", "echo \"Debug: Files in /content:\"\n", "ls -l /content\n", "\n", "# Check files (simplified pattern to include .fastq.gz and .fasta explicitly)\n", "if ! ls /content/*.fasta /content/*.fastq.gz /content/*.fq.gz 2>/dev/null | grep -q .; then\n", " echo \"Warning: No matching .fasta, .fastq.gz, or .fq.gz files found in /content\"\n", "else\n", " echo \"Found matching files in /content\"\n", "fi\n", "\n", "# Process files\n", "for file in /content/*; do\n", " if [[ -f \"$file\" ]]; then\n", " case \"$file\" in\n", " *.fastq.bz2 | *.fq.bz2)\n", " echo \"Decompressing $file to .gz\"\n", " bunzip2 -c \"$file\" | gzip > \"/content/decompressed/$(basename \"${file%.bz2}\").gz\" && echo \"Successfully decompressed $file\" || echo \"Error: Failed to decompress $file\"\n", " ;;\n", " *.fastq.gz | *.fq.gz)\n", " echo \"Copying $file (already .gz)\"\n", " cp \"$file\" \"/content/decompressed/\" && echo \"Successfully copied $file\" || echo \"Error: Failed to copy $file\"\n", " ;;\n", " *.fastq.zip | *.fq.zip)\n", " echo \"Decompressing $file to .gz\"\n", " unzip -p \"$file\" | gzip > \"/content/decompressed/$(basename \"${file%.zip}\").gz\" && echo \"Successfully decompressed $file\" || echo \"Error: Failed to decompress $file\"\n", " ;;\n", " *.fasta)\n", " echo \"Copying $file (uncompressed FASTA)\"\n", " cp \"$file\" \"/content/decompressed/\" && echo \"Successfully copied $file\" || echo \"Error: Failed to copy $file\"\n", " ;;\n", " *)\n", " echo \"Skipping $file (unsupported format)\"\n", " ;;\n", " esac\n", " fi\n", "done\n", "\n", "# Verify\n", "echo \"Listing decompressed files:\"\n", "ls -l /content/decompressed | grep -E \"(fasta|fastq\\.gz|fq\\.gz)\" || echo \"Warning: No decompressed files found\"" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "EOSZ7LT_mWsg", "outputId": "0b6fc058-0385-45f2-a442-8372ecc59b03" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease\n", "Hit:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease\n", "Hit:3 http://archive.ubuntu.com/ubuntu jammy-backports InRelease\n", "Hit:4 https://cli.github.com/packages stable InRelease\n", "Hit:5 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 InRelease\n", "Hit:6 https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/ InRelease\n", "Hit:7 http://security.ubuntu.com/ubuntu jammy-security InRelease\n", "Hit:8 https://r2u.stat.illinois.edu/ubuntu jammy InRelease\n", "Hit:9 https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu jammy InRelease\n", "Hit:10 https://ppa.launchpadcontent.net/graphics-drivers/ppa/ubuntu jammy InRelease\n", "Hit:11 https://ppa.launchpadcontent.net/ubuntugis/ppa/ubuntu jammy InRelease\n", "Reading package lists...\n", "Reading package lists...\n", "Building dependency tree...\n", "Reading state information...\n", "bzip2 is already the newest version (1.0.8-5build1).\n", "unzip is already the newest version (6.0-26ubuntu3.2).\n", "0 upgraded, 0 newly installed, 0 to remove and 40 not upgraded.\n", "Debug: Files in /content:\n", "total 185252\n", "drwxr-xr-x 2 root root 4096 Sep 18 04:50 decompressed\n", "drwxr-xr-x 2 root root 4096 Sep 18 04:50 decompressed1\n", "drwx------ 5 root root 4096 Sep 18 04:38 drive\n", "-rw-r--r-- 1 root root 162129736 Aug 25 21:03 Miniconda3-latest-Linux-x86_64.sh\n", "-rw-r--r-- 1 root root 8066162 Sep 18 04:50 qtlseq_bulk1.1.fastq.gz\n", "-rw-r--r-- 1 root root 8557281 Sep 18 04:50 qtlseq_bulk1.2.fastq.gz\n", "-rw-r--r-- 1 root root 8883631 Sep 18 04:50 qtlseq_parent.1.fastq.gz\n", "-rw-r--r-- 1 root root 2033345 Sep 18 04:50 qtlseq_ref.fasta\n", "drwxr-xr-x 1 root root 4096 Sep 16 13:40 sample_data\n", "Found matching files in /content\n", "Skipping /content/Miniconda3-latest-Linux-x86_64.sh (unsupported format)\n", "Copying /content/qtlseq_bulk1.1.fastq.gz (already .gz)\n", "Successfully copied /content/qtlseq_bulk1.1.fastq.gz\n", "Copying /content/qtlseq_bulk1.2.fastq.gz (already .gz)\n", "Successfully copied /content/qtlseq_bulk1.2.fastq.gz\n", "Copying /content/qtlseq_parent.1.fastq.gz (already .gz)\n", "Successfully copied /content/qtlseq_parent.1.fastq.gz\n", "Copying /content/qtlseq_ref.fasta (uncompressed FASTA)\n", "Successfully copied /content/qtlseq_ref.fasta\n", "Listing decompressed files:\n", "-rw-r--r-- 1 root root 8066162 Sep 18 04:50 qtlseq_bulk1.1.fastq.gz\n", "-rw-r--r-- 1 root root 8557281 Sep 18 04:50 qtlseq_bulk1.2.fastq.gz\n", "-rw-r--r-- 1 root root 8883631 Sep 18 04:50 qtlseq_parent.1.fastq.gz\n", "-rw-r--r-- 1 root root 2033345 Sep 18 04:50 qtlseq_ref.fasta\n" ] }, { "output_type": "stream", "name": "stderr", "text": [ "W: Skipping acquire of configured file 'main/source/Sources' as repository 'https://r2u.stat.illinois.edu/ubuntu jammy InRelease' does not seem to provide it (sources.list entry misspelt?)\n" ] } ] }, { "cell_type": "markdown", "source": [ "Checking the files" ], "metadata": { "id": "lNg-jXaEkeA_" } }, { "cell_type": "code", "source": [], "metadata": { "id": "IzbjrwBakh6k" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "!ls -l /content | grep -E \"(fasta|fastq.bz2)\"" ], "metadata": { "id": "m6LJmSjpY9_R", "colab": { "base_uri": "https://localhost:8080/" }, "outputId": "64ca082e-8a3c-4935-99fa-bc6d3558a76f" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "-rw-r--r-- 1 root root 2033345 Sep 18 04:50 qtlseq_ref.fasta\n" ] } ] }, { "cell_type": "markdown", "source": [ "Decompressing bz2 ( check the format of the input file)" ], "metadata": { "id": "Xz215PoWkl62" } }, { "cell_type": "code", "source": [ "# Install bzip2\n", "!apt-get update && apt-get install -y bzip2\n", "\n", "# Decompress .bz2 to .gz\n", "!bunzip2 -c /content/parent.1.fastq.bz2 | gzip > /content/parent.1.fastq.gz\n", "!bunzip2 -c /content/parent.2.fastq.bz2 | gzip > /content/parent.2.fastq.gz\n", "!bunzip2 -c /content/bulk_1.1.fastq.bz2 | gzip > /content/bulk_1.1.fastq.gz\n", "\n", "# Verify decompressed files\n", "!ls -l /content | grep -E \"(fasta|fastq.gz)\"" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "tp9gT84LZBsT", "outputId": "0fa04ff5-b907-470c-d07b-7fe98f57c8e1" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "\r0% [Working]\r \rHit:1 https://cli.github.com/packages stable InRelease\n", "\r0% [Connecting to archive.ubuntu.com (185.125.190.39)] [Connecting to security.\r \rHit:2 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 InRelease\n", "\r0% [Connecting to archive.ubuntu.com (185.125.190.39)] [Connecting to security.\r \rHit:3 https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/ InRelease\n", "\r0% [Connecting to archive.ubuntu.com (185.125.190.39)] [Connecting to security.\r0% [Waiting for headers] [Waiting for headers] [Waiting for headers] [Connectin\r \rHit:4 http://archive.ubuntu.com/ubuntu jammy InRelease\n", "\r0% [Waiting for headers] [Waiting for headers] [Waiting for headers] [Connected\r \rHit:5 http://security.ubuntu.com/ubuntu jammy-security InRelease\n", "Hit:6 https://r2u.stat.illinois.edu/ubuntu jammy InRelease\n", "Hit:7 http://archive.ubuntu.com/ubuntu jammy-updates InRelease\n", "Hit:8 http://archive.ubuntu.com/ubuntu jammy-backports InRelease\n", "Hit:9 https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu jammy InRelease\n", "Hit:10 https://ppa.launchpadcontent.net/graphics-drivers/ppa/ubuntu jammy InRelease\n", "Hit:11 https://ppa.launchpadcontent.net/ubuntugis/ppa/ubuntu jammy InRelease\n", "Reading package lists... Done\n", "W: Skipping acquire of configured file 'main/source/Sources' as repository 'https://r2u.stat.illinois.edu/ubuntu jammy InRelease' does not seem to provide it (sources.list entry misspelt?)\n", "Reading package lists... Done\n", "Building dependency tree... Done\n", "Reading state information... Done\n", "bzip2 is already the newest version (1.0.8-5build1).\n", "0 upgraded, 0 newly installed, 0 to remove and 40 not upgraded.\n", "bunzip2: Can't open input file /content/parent.1.fastq.bz2: No such file or directory.\n", "bunzip2: Can't open input file /content/parent.2.fastq.bz2: No such file or directory.\n", "bunzip2: Can't open input file /content/bulk_1.1.fastq.bz2: No such file or directory.\n", "-rw-r--r-- 1 root root 20 Sep 18 04:51 bulk_1.1.fastq.gz\n", "-rw-r--r-- 1 root root 20 Sep 18 04:51 parent.1.fastq.gz\n", "-rw-r--r-- 1 root root 20 Sep 18 04:51 parent.2.fastq.gz\n", "-rw-r--r-- 1 root root 2033345 Sep 18 04:50 qtlseq_ref.fasta\n" ] } ] }, { "cell_type": "code", "source": [ "!/usr/local/bin/conda run -n qtlseq bwa index /content/qtlseq_ref.fasta" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "joAOpWhSZHcE", "outputId": "15421818-4d4f-48e8-8467-c59e94cc84d9" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "[bwa_index] Pack FASTA... 0.02 sec\n", "[bwa_index] Construct BWT for the packed sequence...\n", "[bwa_index] 0.53 seconds elapse.\n", "[bwa_index] Update BWT... 0.01 sec\n", "[bwa_index] Pack forward-only FASTA... 0.01 sec\n", "[bwa_index] Construct SA from BWT and Occ... 0.26 sec\n", "[main] Version: 0.7.19-r1273\n", "[main] CMD: bwa index /content/qtlseq_ref.fasta\n", "[main] Real time: 0.886 sec; CPU: 0.835 sec\n", "\n" ] } ] }, { "cell_type": "code", "source": [ "!/usr/local/bin/conda run -n qtlseq bwa index /content/qtlseq_ref.fasta" ], "metadata": { "id": "KD-ZmfN8aUan", "colab": { "base_uri": "https://localhost:8080/" }, "outputId": "bf310eab-61ba-4e5b-e028-bd972cdc7496" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "[bwa_index] Pack FASTA... 0.02 sec\n", "[bwa_index] Construct BWT for the packed sequence...\n", "[bwa_index] 0.52 seconds elapse.\n", "[bwa_index] Update BWT... 0.01 sec\n", "[bwa_index] Pack forward-only FASTA... 0.01 sec\n", "[bwa_index] Construct SA from BWT and Occ... 0.25 sec\n", "[main] Version: 0.7.19-r1273\n", "[main] CMD: bwa index /content/qtlseq_ref.fasta\n", "[main] Real time: 0.863 sec; CPU: 0.814 sec\n", "\n" ] } ] }, { "cell_type": "code", "source": [], "metadata": { "id": "VlPGlKBMk9j5" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "%%bash\n", "# Download and install Miniconda\n", "wget -q https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh\n", "bash Miniconda3-latest-Linux-x86_64.sh -b -p /usr/local\n", "rm Miniconda3-latest-Linux-x86_64.sh\n", "\n", "# Update Conda\n", "/usr/local/bin/conda update -n base conda -y\n", "\n", "# Add bioconda channels\n", "/usr/local/bin/conda config --add channels defaults\n", "/usr/local/bin/conda config --add channels bioconda\n", "/usr/local/bin/conda config --add channels conda-forge\n", "\n", "# Create qtlseq environment and install qtlseq\n", "/usr/local/bin/conda create -n qtlseq qtlseq -c bioconda -y\n", "\n", "# Verify installation\n", "/usr/local/bin/conda run -n qtlseq qtlseq --version" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "_JmovQRoadPJ", "outputId": "544fb879-2c7c-40f1-e2a2-df292b61896f" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Jupyter detected...\n", "2 channel Terms of Service accepted\n", "Channels:\n", " - conda-forge\n", " - bioconda\n", " - defaults\n", "Platform: linux-64\n", "Collecting package metadata (repodata.json): - \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\bdone\n", "Solving environment: / \b\b- \b\bdone\n", "\n", "## Package Plan ##\n", "\n", " environment location: /usr/local\n", "\n", " added / updated specs:\n", " - conda\n", "\n", "\n", "The following NEW packages will be INSTALLED:\n", "\n", " libgcc conda-forge/linux-64::libgcc-15.1.0-h767d61c_5 \n", "\n", "The following packages will be UPDATED:\n", "\n", " ca-certificates pkgs/main/linux-64::ca-certificates-2~ --> conda-forge/noarch::ca-certificates-2025.8.3-hbd8a1cb_0 \n", " libgcc-ng pkgs/main::libgcc-ng-11.2.0-h1234567_1 --> conda-forge::libgcc-ng-15.1.0-h69a702a_5 \n", " libgomp pkgs/main::libgomp-11.2.0-h1234567_1 --> conda-forge::libgomp-15.1.0-h767d61c_5 \n", " openssl pkgs/main::openssl-3.0.17-h5eee18b_0 --> conda-forge::openssl-3.5.3-h26f9b46_0 \n", "\n", "\n", "\n", "Downloading and Extracting Packages: ...working... done\n", "Preparing transaction: | \b\bdone\n", "Verifying transaction: - \b\b\\ \b\bdone\n", "Executing transaction: / \b\bdone\n", "Jupyter detected...\n", "2 channel Terms of Service accepted\n", "Channels:\n", " - bioconda\n", " - conda-forge\n", " - defaults\n", "Platform: linux-64\n", "Collecting package metadata (repodata.json): - \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\bdone\n", "Solving environment: \\ \b\b| \b\b/ \b\bdone\n", "\n", "## Package Plan ##\n", "\n", " environment location: /usr/local/envs/qtlseq\n", "\n", " added / updated specs:\n", " - qtlseq\n", "\n", "\n", "The following NEW packages will be INSTALLED:\n", "\n", " _libgcc_mutex conda-forge/linux-64::_libgcc_mutex-0.1-conda_forge \n", " _openmp_mutex conda-forge/linux-64::_openmp_mutex-4.5-2_gnu \n", " alsa-lib conda-forge/linux-64::alsa-lib-1.2.14-hb9d3cd8_0 \n", " bcftools bioconda/linux-64::bcftools-1.22-h3a4d415_1 \n", " brotli conda-forge/linux-64::brotli-1.1.0-hb03c661_4 \n", " brotli-bin conda-forge/linux-64::brotli-bin-1.1.0-hb03c661_4 \n", " bwa bioconda/linux-64::bwa-0.7.19-h577a1d6_1 \n", " bzip2 conda-forge/linux-64::bzip2-1.0.8-hda65f42_8 \n", " c-ares conda-forge/linux-64::c-ares-1.34.5-hb9d3cd8_0 \n", " ca-certificates conda-forge/noarch::ca-certificates-2025.8.3-hbd8a1cb_0 \n", " cairo conda-forge/linux-64::cairo-1.18.4-h3394656_0 \n", " contourpy conda-forge/linux-64::contourpy-1.3.3-py313h7037e92_2 \n", " cycler conda-forge/noarch::cycler-0.12.1-pyhd8ed1ab_1 \n", " font-ttf-dejavu-s~ conda-forge/noarch::font-ttf-dejavu-sans-mono-2.37-hab24e00_0 \n", " font-ttf-inconsol~ conda-forge/noarch::font-ttf-inconsolata-3.000-h77eed37_0 \n", " font-ttf-source-c~ conda-forge/noarch::font-ttf-source-code-pro-2.038-h77eed37_0 \n", " font-ttf-ubuntu conda-forge/noarch::font-ttf-ubuntu-0.83-h77eed37_3 \n", " fontconfig conda-forge/linux-64::fontconfig-2.15.0-h7e30c49_1 \n", " fonts-conda-ecosy~ conda-forge/noarch::fonts-conda-ecosystem-1-0 \n", " fonts-conda-forge conda-forge/noarch::fonts-conda-forge-1-0 \n", " fonttools conda-forge/linux-64::fonttools-4.60.0-py313h3dea7bd_0 \n", " freetype conda-forge/linux-64::freetype-2.14.1-ha770c72_0 \n", " giflib conda-forge/linux-64::giflib-5.2.2-hd590300_0 \n", " graphite2 conda-forge/linux-64::graphite2-1.3.14-hecca717_2 \n", " gsl conda-forge/linux-64::gsl-2.7-he838d99_0 \n", " harfbuzz conda-forge/linux-64::harfbuzz-11.5.0-h15599e2_0 \n", " htslib bioconda/linux-64::htslib-1.22.1-h566b1c6_0 \n", " icu conda-forge/linux-64::icu-75.1-he02047a_0 \n", " keyutils conda-forge/linux-64::keyutils-1.6.3-hb9d3cd8_0 \n", " kiwisolver conda-forge/linux-64::kiwisolver-1.4.9-py313hc8edb43_1 \n", " krb5 conda-forge/linux-64::krb5-1.21.3-h659f571_0 \n", " lcms2 conda-forge/linux-64::lcms2-2.17-h717163a_0 \n", " ld_impl_linux-64 conda-forge/linux-64::ld_impl_linux-64-2.44-h1423503_1 \n", " lerc conda-forge/linux-64::lerc-4.0.0-h0aef613_1 \n", " libblas conda-forge/linux-64::libblas-3.9.0-35_h4a7cf45_openblas \n", " libbrotlicommon conda-forge/linux-64::libbrotlicommon-1.1.0-hb03c661_4 \n", " libbrotlidec conda-forge/linux-64::libbrotlidec-1.1.0-hb03c661_4 \n", " libbrotlienc conda-forge/linux-64::libbrotlienc-1.1.0-hb03c661_4 \n", " libcblas conda-forge/linux-64::libcblas-3.9.0-35_h0358290_openblas \n", " libcups conda-forge/linux-64::libcups-2.3.3-hb8b1518_5 \n", " libcurl conda-forge/linux-64::libcurl-8.14.1-h332b0f4_0 \n", " libdeflate conda-forge/linux-64::libdeflate-1.24-h86f0d12_0 \n", " libedit conda-forge/linux-64::libedit-3.1.20250104-pl5321h7949ede_0 \n", " libev conda-forge/linux-64::libev-4.33-hd590300_2 \n", " libexpat conda-forge/linux-64::libexpat-2.7.1-hecca717_0 \n", " libffi conda-forge/linux-64::libffi-3.4.6-h2dba641_1 \n", " libfreetype conda-forge/linux-64::libfreetype-2.14.1-ha770c72_0 \n", " libfreetype6 conda-forge/linux-64::libfreetype6-2.14.1-h73754d4_0 \n", " libgcc conda-forge/linux-64::libgcc-15.1.0-h767d61c_5 \n", " libgcc-ng conda-forge/linux-64::libgcc-ng-15.1.0-h69a702a_5 \n", " libgfortran conda-forge/linux-64::libgfortran-15.1.0-h69a702a_5 \n", " libgfortran5 conda-forge/linux-64::libgfortran5-15.1.0-hcea5267_5 \n", " libglib conda-forge/linux-64::libglib-2.86.0-h1fed272_0 \n", " libgomp conda-forge/linux-64::libgomp-15.1.0-h767d61c_5 \n", " libiconv conda-forge/linux-64::libiconv-1.18-h3b78370_2 \n", " libjpeg-turbo conda-forge/linux-64::libjpeg-turbo-3.1.0-hb9d3cd8_0 \n", " liblapack conda-forge/linux-64::liblapack-3.9.0-35_h47877c9_openblas \n", " liblzma conda-forge/linux-64::liblzma-5.8.1-hb9d3cd8_2 \n", " libmpdec conda-forge/linux-64::libmpdec-4.0.0-hb9d3cd8_0 \n", " libnghttp2 conda-forge/linux-64::libnghttp2-1.67.0-had1ee68_0 \n", " libopenblas conda-forge/linux-64::libopenblas-0.3.30-pthreads_h94d23a6_2 \n", " libpng conda-forge/linux-64::libpng-1.6.50-h421ea60_1 \n", " libsqlite conda-forge/linux-64::libsqlite-3.50.4-h0c1763c_0 \n", " libssh2 conda-forge/linux-64::libssh2-1.11.1-hcf80075_0 \n", " libstdcxx conda-forge/linux-64::libstdcxx-15.1.0-h8f9b012_5 \n", " libstdcxx-ng conda-forge/linux-64::libstdcxx-ng-15.1.0-h4852527_5 \n", " libtiff conda-forge/linux-64::libtiff-4.7.0-h8261f1e_6 \n", " libuuid conda-forge/linux-64::libuuid-2.41.1-he9a06e4_0 \n", " libwebp-base conda-forge/linux-64::libwebp-base-1.6.0-hd42ef1d_0 \n", " libxcb conda-forge/linux-64::libxcb-1.17.0-h8a09558_0 \n", " libxcrypt conda-forge/linux-64::libxcrypt-4.4.36-hd590300_1 \n", " libzlib conda-forge/linux-64::libzlib-1.3.1-hb9d3cd8_2 \n", " matplotlib-base conda-forge/linux-64::matplotlib-base-3.10.6-py313h683a580_1 \n", " munkres bioconda/noarch::munkres-1.0.7-py_1 \n", " ncurses conda-forge/linux-64::ncurses-6.5-h2d0b736_3 \n", " numpy conda-forge/linux-64::numpy-2.3.3-py313hf6604e3_0 \n", " openjdk conda-forge/linux-64::openjdk-24.0.2-h5755bd7_0 \n", " openjpeg conda-forge/linux-64::openjpeg-2.5.3-h55fea9a_1 \n", " openssl conda-forge/linux-64::openssl-3.5.3-h26f9b46_0 \n", " packaging conda-forge/noarch::packaging-25.0-pyh29332c3_1 \n", " pandas conda-forge/linux-64::pandas-2.3.2-py313h08cd8bf_0 \n", " pcre2 conda-forge/linux-64::pcre2-10.46-h1321c63_0 \n", " perl conda-forge/linux-64::perl-5.32.1-7_hd590300_perl5 \n", " pillow conda-forge/linux-64::pillow-11.3.0-py313hf46931b_2 \n", " pip conda-forge/noarch::pip-25.2-pyh145f28c_0 \n", " pixman conda-forge/linux-64::pixman-0.46.4-h54a6638_1 \n", " pthread-stubs conda-forge/linux-64::pthread-stubs-0.4-hb9d3cd8_1002 \n", " pyparsing conda-forge/noarch::pyparsing-3.2.4-pyhcf101f3_0 \n", " python conda-forge/linux-64::python-3.13.7-h2b335a9_100_cp313 \n", " python-dateutil conda-forge/noarch::python-dateutil-2.9.0.post0-pyhe01879c_2 \n", " python-tzdata conda-forge/noarch::python-tzdata-2025.2-pyhd8ed1ab_0 \n", " python_abi conda-forge/noarch::python_abi-3.13-8_cp313 \n", " pytz conda-forge/noarch::pytz-2025.2-pyhd8ed1ab_0 \n", " qhull conda-forge/linux-64::qhull-2020.2-h434a139_5 \n", " qtlseq bioconda/noarch::qtlseq-2.2.9-pyhdfd78af_0 \n", " readline conda-forge/linux-64::readline-8.2-h8c095d6_2 \n", " samtools bioconda/linux-64::samtools-1.22.1-h96c455f_0 \n", " scipy conda-forge/linux-64::scipy-1.16.2-py313h11c21cd_0 \n", " seaborn-base conda-forge/noarch::seaborn-base-0.13.2-pyhd8ed1ab_3 \n", " six conda-forge/noarch::six-1.17.0-pyhe01879c_1 \n", " snpeff bioconda/noarch::snpeff-5.2-hdfd78af_1 \n", " tk conda-forge/linux-64::tk-8.6.13-noxft_hd72426e_102 \n", " trimmomatic bioconda/noarch::trimmomatic-0.40-hdfd78af_0 \n", " tzdata conda-forge/noarch::tzdata-2025b-h78e105d_0 \n", " xorg-libice conda-forge/linux-64::xorg-libice-1.1.2-hb9d3cd8_0 \n", " xorg-libsm conda-forge/linux-64::xorg-libsm-1.2.6-he73a12e_0 \n", " xorg-libx11 conda-forge/linux-64::xorg-libx11-1.8.12-h4f16b4b_0 \n", " xorg-libxau conda-forge/linux-64::xorg-libxau-1.0.12-hb9d3cd8_0 \n", " xorg-libxdmcp conda-forge/linux-64::xorg-libxdmcp-1.1.5-hb9d3cd8_0 \n", " xorg-libxext conda-forge/linux-64::xorg-libxext-1.3.6-hb9d3cd8_0 \n", " xorg-libxfixes conda-forge/linux-64::xorg-libxfixes-6.0.1-hb9d3cd8_0 \n", " xorg-libxi conda-forge/linux-64::xorg-libxi-1.8.2-hb9d3cd8_0 \n", " xorg-libxrandr conda-forge/linux-64::xorg-libxrandr-1.5.4-hb9d3cd8_0 \n", " xorg-libxrender conda-forge/linux-64::xorg-libxrender-0.9.12-hb9d3cd8_0 \n", " xorg-libxt conda-forge/linux-64::xorg-libxt-1.3.1-hb9d3cd8_0 \n", " xorg-libxtst conda-forge/linux-64::xorg-libxtst-1.2.5-hb9d3cd8_3 \n", " zlib conda-forge/linux-64::zlib-1.3.1-hb9d3cd8_2 \n", " zstd conda-forge/linux-64::zstd-1.5.7-hb8e6e7a_2 \n", "\n", "\n", "\n", "Downloading and Extracting Packages: ...working... done\n", "Preparing transaction: \\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\bdone\n", "Verifying transaction: - \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\bdone\n", "Executing transaction: / \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\bdone\n", "#\n", "# To activate this environment, use\n", "#\n", "# $ conda activate qtlseq\n", "#\n", "# To deactivate an active environment, use\n", "#\n", "# $ conda deactivate\n", "\n", "qtlseq 2.2.9\n", "\n" ] }, { "output_type": "stream", "name": "stderr", "text": [ "ERROR: File or directory already exists: '/usr/local'\n", "If you want to update an existing installation, use the -u option.\n", "Warning: 'defaults' already in 'channels' list, moving to the top\n", "Warning: 'bioconda' already in 'channels' list, moving to the top\n", "Warning: 'conda-forge' already in 'channels' list, moving to the top\n" ] } ] }, { "cell_type": "code", "source": [], "metadata": { "id": "L5Njk-9KlOOu" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "%%bash\n", "# Download and install Miniconda\n", "wget -q https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh\n", "bash Miniconda3-latest-Linux-x86_64.sh -b -p /usr/local\n", "rm Miniconda3-latest-Linux-x86_64.sh\n", "\n", "# Update Conda\n", "/usr/local/bin/conda update -n base conda -y\n", "\n", "# Add bioconda channels\n", "/usr/local/bin/conda config --add channels defaults\n", "/usr/local/bin/conda config --add channels bioconda\n", "/usr/local/bin/conda config --add channels conda-forge\n", "\n", "# Create qtlseq environment and install qtlseq\n", "/usr/local/bin/conda create -n qtlseq qtlseq -c bioconda -y\n", "\n", "# Verify installation\n", "/usr/local/bin/conda run -n qtlseq qtlseq --version" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "outputId": "544fb879-2c7c-40f1-e2a2-df292b61896f", "id": "biiYEf2vk3h3" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Jupyter detected...\n", "2 channel Terms of Service accepted\n", "Channels:\n", " - conda-forge\n", " - bioconda\n", " - defaults\n", "Platform: linux-64\n", "Collecting package metadata (repodata.json): - \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\bdone\n", "Solving environment: / \b\b- \b\bdone\n", "\n", "## Package Plan ##\n", "\n", " environment location: /usr/local\n", "\n", " added / updated specs:\n", " - conda\n", "\n", "\n", "The following NEW packages will be INSTALLED:\n", "\n", " libgcc conda-forge/linux-64::libgcc-15.1.0-h767d61c_5 \n", "\n", "The following packages will be UPDATED:\n", "\n", " ca-certificates pkgs/main/linux-64::ca-certificates-2~ --> conda-forge/noarch::ca-certificates-2025.8.3-hbd8a1cb_0 \n", " libgcc-ng pkgs/main::libgcc-ng-11.2.0-h1234567_1 --> conda-forge::libgcc-ng-15.1.0-h69a702a_5 \n", " libgomp pkgs/main::libgomp-11.2.0-h1234567_1 --> conda-forge::libgomp-15.1.0-h767d61c_5 \n", " openssl pkgs/main::openssl-3.0.17-h5eee18b_0 --> conda-forge::openssl-3.5.3-h26f9b46_0 \n", "\n", "\n", "\n", "Downloading and Extracting Packages: ...working... done\n", "Preparing transaction: | \b\bdone\n", "Verifying transaction: - \b\b\\ \b\bdone\n", "Executing transaction: / \b\bdone\n", "Jupyter detected...\n", "2 channel Terms of Service accepted\n", "Channels:\n", " - bioconda\n", " - conda-forge\n", " - defaults\n", "Platform: linux-64\n", "Collecting package metadata (repodata.json): - \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\bdone\n", "Solving environment: \\ \b\b| \b\b/ \b\bdone\n", "\n", "## Package Plan ##\n", "\n", " environment location: /usr/local/envs/qtlseq\n", "\n", " added / updated specs:\n", " - qtlseq\n", "\n", "\n", "The following NEW packages will be INSTALLED:\n", "\n", " _libgcc_mutex conda-forge/linux-64::_libgcc_mutex-0.1-conda_forge \n", " _openmp_mutex conda-forge/linux-64::_openmp_mutex-4.5-2_gnu \n", " alsa-lib conda-forge/linux-64::alsa-lib-1.2.14-hb9d3cd8_0 \n", " bcftools bioconda/linux-64::bcftools-1.22-h3a4d415_1 \n", " brotli conda-forge/linux-64::brotli-1.1.0-hb03c661_4 \n", " brotli-bin conda-forge/linux-64::brotli-bin-1.1.0-hb03c661_4 \n", " bwa bioconda/linux-64::bwa-0.7.19-h577a1d6_1 \n", " bzip2 conda-forge/linux-64::bzip2-1.0.8-hda65f42_8 \n", " c-ares conda-forge/linux-64::c-ares-1.34.5-hb9d3cd8_0 \n", " ca-certificates conda-forge/noarch::ca-certificates-2025.8.3-hbd8a1cb_0 \n", " cairo conda-forge/linux-64::cairo-1.18.4-h3394656_0 \n", " contourpy conda-forge/linux-64::contourpy-1.3.3-py313h7037e92_2 \n", " cycler conda-forge/noarch::cycler-0.12.1-pyhd8ed1ab_1 \n", " font-ttf-dejavu-s~ conda-forge/noarch::font-ttf-dejavu-sans-mono-2.37-hab24e00_0 \n", " font-ttf-inconsol~ conda-forge/noarch::font-ttf-inconsolata-3.000-h77eed37_0 \n", " font-ttf-source-c~ conda-forge/noarch::font-ttf-source-code-pro-2.038-h77eed37_0 \n", " font-ttf-ubuntu conda-forge/noarch::font-ttf-ubuntu-0.83-h77eed37_3 \n", " fontconfig conda-forge/linux-64::fontconfig-2.15.0-h7e30c49_1 \n", " fonts-conda-ecosy~ conda-forge/noarch::fonts-conda-ecosystem-1-0 \n", " fonts-conda-forge conda-forge/noarch::fonts-conda-forge-1-0 \n", " fonttools conda-forge/linux-64::fonttools-4.60.0-py313h3dea7bd_0 \n", " freetype conda-forge/linux-64::freetype-2.14.1-ha770c72_0 \n", " giflib conda-forge/linux-64::giflib-5.2.2-hd590300_0 \n", " graphite2 conda-forge/linux-64::graphite2-1.3.14-hecca717_2 \n", " gsl conda-forge/linux-64::gsl-2.7-he838d99_0 \n", " harfbuzz conda-forge/linux-64::harfbuzz-11.5.0-h15599e2_0 \n", " htslib bioconda/linux-64::htslib-1.22.1-h566b1c6_0 \n", " icu conda-forge/linux-64::icu-75.1-he02047a_0 \n", " keyutils conda-forge/linux-64::keyutils-1.6.3-hb9d3cd8_0 \n", " kiwisolver conda-forge/linux-64::kiwisolver-1.4.9-py313hc8edb43_1 \n", " krb5 conda-forge/linux-64::krb5-1.21.3-h659f571_0 \n", " lcms2 conda-forge/linux-64::lcms2-2.17-h717163a_0 \n", " ld_impl_linux-64 conda-forge/linux-64::ld_impl_linux-64-2.44-h1423503_1 \n", " lerc conda-forge/linux-64::lerc-4.0.0-h0aef613_1 \n", " libblas conda-forge/linux-64::libblas-3.9.0-35_h4a7cf45_openblas \n", " libbrotlicommon conda-forge/linux-64::libbrotlicommon-1.1.0-hb03c661_4 \n", " libbrotlidec conda-forge/linux-64::libbrotlidec-1.1.0-hb03c661_4 \n", " libbrotlienc conda-forge/linux-64::libbrotlienc-1.1.0-hb03c661_4 \n", " libcblas conda-forge/linux-64::libcblas-3.9.0-35_h0358290_openblas \n", " libcups conda-forge/linux-64::libcups-2.3.3-hb8b1518_5 \n", " libcurl conda-forge/linux-64::libcurl-8.14.1-h332b0f4_0 \n", " libdeflate conda-forge/linux-64::libdeflate-1.24-h86f0d12_0 \n", " libedit conda-forge/linux-64::libedit-3.1.20250104-pl5321h7949ede_0 \n", " libev conda-forge/linux-64::libev-4.33-hd590300_2 \n", " libexpat conda-forge/linux-64::libexpat-2.7.1-hecca717_0 \n", " libffi conda-forge/linux-64::libffi-3.4.6-h2dba641_1 \n", " libfreetype conda-forge/linux-64::libfreetype-2.14.1-ha770c72_0 \n", " libfreetype6 conda-forge/linux-64::libfreetype6-2.14.1-h73754d4_0 \n", " libgcc conda-forge/linux-64::libgcc-15.1.0-h767d61c_5 \n", " libgcc-ng conda-forge/linux-64::libgcc-ng-15.1.0-h69a702a_5 \n", " libgfortran conda-forge/linux-64::libgfortran-15.1.0-h69a702a_5 \n", " libgfortran5 conda-forge/linux-64::libgfortran5-15.1.0-hcea5267_5 \n", " libglib conda-forge/linux-64::libglib-2.86.0-h1fed272_0 \n", " libgomp conda-forge/linux-64::libgomp-15.1.0-h767d61c_5 \n", " libiconv conda-forge/linux-64::libiconv-1.18-h3b78370_2 \n", " libjpeg-turbo conda-forge/linux-64::libjpeg-turbo-3.1.0-hb9d3cd8_0 \n", " liblapack conda-forge/linux-64::liblapack-3.9.0-35_h47877c9_openblas \n", " liblzma conda-forge/linux-64::liblzma-5.8.1-hb9d3cd8_2 \n", " libmpdec conda-forge/linux-64::libmpdec-4.0.0-hb9d3cd8_0 \n", " libnghttp2 conda-forge/linux-64::libnghttp2-1.67.0-had1ee68_0 \n", " libopenblas conda-forge/linux-64::libopenblas-0.3.30-pthreads_h94d23a6_2 \n", " libpng conda-forge/linux-64::libpng-1.6.50-h421ea60_1 \n", " libsqlite conda-forge/linux-64::libsqlite-3.50.4-h0c1763c_0 \n", " libssh2 conda-forge/linux-64::libssh2-1.11.1-hcf80075_0 \n", " libstdcxx conda-forge/linux-64::libstdcxx-15.1.0-h8f9b012_5 \n", " libstdcxx-ng conda-forge/linux-64::libstdcxx-ng-15.1.0-h4852527_5 \n", " libtiff conda-forge/linux-64::libtiff-4.7.0-h8261f1e_6 \n", " libuuid conda-forge/linux-64::libuuid-2.41.1-he9a06e4_0 \n", " libwebp-base conda-forge/linux-64::libwebp-base-1.6.0-hd42ef1d_0 \n", " libxcb conda-forge/linux-64::libxcb-1.17.0-h8a09558_0 \n", " libxcrypt conda-forge/linux-64::libxcrypt-4.4.36-hd590300_1 \n", " libzlib conda-forge/linux-64::libzlib-1.3.1-hb9d3cd8_2 \n", " matplotlib-base conda-forge/linux-64::matplotlib-base-3.10.6-py313h683a580_1 \n", " munkres bioconda/noarch::munkres-1.0.7-py_1 \n", " ncurses conda-forge/linux-64::ncurses-6.5-h2d0b736_3 \n", " numpy conda-forge/linux-64::numpy-2.3.3-py313hf6604e3_0 \n", " openjdk conda-forge/linux-64::openjdk-24.0.2-h5755bd7_0 \n", " openjpeg conda-forge/linux-64::openjpeg-2.5.3-h55fea9a_1 \n", " openssl conda-forge/linux-64::openssl-3.5.3-h26f9b46_0 \n", " packaging conda-forge/noarch::packaging-25.0-pyh29332c3_1 \n", " pandas conda-forge/linux-64::pandas-2.3.2-py313h08cd8bf_0 \n", " pcre2 conda-forge/linux-64::pcre2-10.46-h1321c63_0 \n", " perl conda-forge/linux-64::perl-5.32.1-7_hd590300_perl5 \n", " pillow conda-forge/linux-64::pillow-11.3.0-py313hf46931b_2 \n", " pip conda-forge/noarch::pip-25.2-pyh145f28c_0 \n", " pixman conda-forge/linux-64::pixman-0.46.4-h54a6638_1 \n", " pthread-stubs conda-forge/linux-64::pthread-stubs-0.4-hb9d3cd8_1002 \n", " pyparsing conda-forge/noarch::pyparsing-3.2.4-pyhcf101f3_0 \n", " python conda-forge/linux-64::python-3.13.7-h2b335a9_100_cp313 \n", " python-dateutil conda-forge/noarch::python-dateutil-2.9.0.post0-pyhe01879c_2 \n", " python-tzdata conda-forge/noarch::python-tzdata-2025.2-pyhd8ed1ab_0 \n", " python_abi conda-forge/noarch::python_abi-3.13-8_cp313 \n", " pytz conda-forge/noarch::pytz-2025.2-pyhd8ed1ab_0 \n", " qhull conda-forge/linux-64::qhull-2020.2-h434a139_5 \n", " qtlseq bioconda/noarch::qtlseq-2.2.9-pyhdfd78af_0 \n", " readline conda-forge/linux-64::readline-8.2-h8c095d6_2 \n", " samtools bioconda/linux-64::samtools-1.22.1-h96c455f_0 \n", " scipy conda-forge/linux-64::scipy-1.16.2-py313h11c21cd_0 \n", " seaborn-base conda-forge/noarch::seaborn-base-0.13.2-pyhd8ed1ab_3 \n", " six conda-forge/noarch::six-1.17.0-pyhe01879c_1 \n", " snpeff bioconda/noarch::snpeff-5.2-hdfd78af_1 \n", " tk conda-forge/linux-64::tk-8.6.13-noxft_hd72426e_102 \n", " trimmomatic bioconda/noarch::trimmomatic-0.40-hdfd78af_0 \n", " tzdata conda-forge/noarch::tzdata-2025b-h78e105d_0 \n", " xorg-libice conda-forge/linux-64::xorg-libice-1.1.2-hb9d3cd8_0 \n", " xorg-libsm conda-forge/linux-64::xorg-libsm-1.2.6-he73a12e_0 \n", " xorg-libx11 conda-forge/linux-64::xorg-libx11-1.8.12-h4f16b4b_0 \n", " xorg-libxau conda-forge/linux-64::xorg-libxau-1.0.12-hb9d3cd8_0 \n", " xorg-libxdmcp conda-forge/linux-64::xorg-libxdmcp-1.1.5-hb9d3cd8_0 \n", " xorg-libxext conda-forge/linux-64::xorg-libxext-1.3.6-hb9d3cd8_0 \n", " xorg-libxfixes conda-forge/linux-64::xorg-libxfixes-6.0.1-hb9d3cd8_0 \n", " xorg-libxi conda-forge/linux-64::xorg-libxi-1.8.2-hb9d3cd8_0 \n", " xorg-libxrandr conda-forge/linux-64::xorg-libxrandr-1.5.4-hb9d3cd8_0 \n", " xorg-libxrender conda-forge/linux-64::xorg-libxrender-0.9.12-hb9d3cd8_0 \n", " xorg-libxt conda-forge/linux-64::xorg-libxt-1.3.1-hb9d3cd8_0 \n", " xorg-libxtst conda-forge/linux-64::xorg-libxtst-1.2.5-hb9d3cd8_3 \n", " zlib conda-forge/linux-64::zlib-1.3.1-hb9d3cd8_2 \n", " zstd conda-forge/linux-64::zstd-1.5.7-hb8e6e7a_2 \n", "\n", "\n", "\n", "Downloading and Extracting Packages: ...working... done\n", "Preparing transaction: \\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\bdone\n", "Verifying transaction: - \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\bdone\n", "Executing transaction: / \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\b| \b\b/ \b\b- \b\b\\ \b\bdone\n", "#\n", "# To activate this environment, use\n", "#\n", "# $ conda activate qtlseq\n", "#\n", "# To deactivate an active environment, use\n", "#\n", "# $ conda deactivate\n", "\n", "qtlseq 2.2.9\n", "\n" ] }, { "output_type": "stream", "name": "stderr", "text": [ "ERROR: File or directory already exists: '/usr/local'\n", "If you want to update an existing installation, use the -u option.\n", "Warning: 'defaults' already in 'channels' list, moving to the top\n", "Warning: 'bioconda' already in 'channels' list, moving to the top\n", "Warning: 'conda-forge' already in 'channels' list, moving to the top\n" ] } ] }, { "cell_type": "code", "source": [], "metadata": { "id": "OKqyiIm0lRIr" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "%%bash\n", "apt-get update -y\n", "apt-get install -y bwa samtools\n" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "HKweWR2HqGvT", "outputId": "b8320bd7-ae91-40ef-f216-7bed375592f1" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease\n", "Hit:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease\n", "Hit:3 https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/ InRelease\n", "Hit:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease\n", "Hit:5 https://cli.github.com/packages stable InRelease\n", "Hit:6 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 InRelease\n", "Hit:7 http://security.ubuntu.com/ubuntu jammy-security InRelease\n", "Hit:8 https://r2u.stat.illinois.edu/ubuntu jammy InRelease\n", "Hit:9 https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu jammy InRelease\n", "Hit:10 https://ppa.launchpadcontent.net/graphics-drivers/ppa/ubuntu jammy InRelease\n", "Hit:11 https://ppa.launchpadcontent.net/ubuntugis/ppa/ubuntu jammy InRelease\n", "Reading package lists...\n", "Reading package lists...\n", "Building dependency tree...\n", "Reading state information...\n", "The following additional packages will be installed:\n", " libhts3 libhtscodecs2\n", "Suggested packages:\n", " cwltool\n", "The following NEW packages will be installed:\n", " bwa libhts3 libhtscodecs2 samtools\n", "0 upgraded, 4 newly installed, 0 to remove and 40 not upgraded.\n", "Need to get 1,158 kB of archives.\n", "After this operation, 2,736 kB of additional disk space will be used.\n", "Get:1 http://archive.ubuntu.com/ubuntu jammy/universe amd64 bwa amd64 0.7.17-6 [195 kB]\n", "Get:2 http://archive.ubuntu.com/ubuntu jammy/universe amd64 libhtscodecs2 amd64 1.1.1-3 [53.2 kB]\n", "Get:3 http://archive.ubuntu.com/ubuntu jammy/universe amd64 libhts3 amd64 1.13+ds-2build1 [390 kB]\n", "Get:4 http://archive.ubuntu.com/ubuntu jammy/universe amd64 samtools amd64 1.13-4 [520 kB]\n", "Fetched 1,158 kB in 0s (6,256 kB/s)\n", "Selecting previously unselected package bwa.\r\n", "(Reading database ... \r(Reading database ... 5%\r(Reading database ... 10%\r(Reading database ... 15%\r(Reading database ... 20%\r(Reading database ... 25%\r(Reading database ... 30%\r(Reading database ... 35%\r(Reading database ... 40%\r(Reading database ... 45%\r(Reading database ... 50%\r(Reading database ... 55%\r(Reading database ... 60%\r(Reading database ... 65%\r(Reading database ... 70%\r(Reading database ... 75%\r(Reading database ... 80%\r(Reading database ... 85%\r(Reading database ... 90%\r(Reading database ... 95%\r(Reading database ... 100%\r(Reading database ... 126435 files and directories currently installed.)\r\n", "Preparing to unpack .../bwa_0.7.17-6_amd64.deb ...\r\n", "Unpacking bwa (0.7.17-6) ...\r\n", "Selecting previously unselected package libhtscodecs2:amd64.\r\n", "Preparing to unpack .../libhtscodecs2_1.1.1-3_amd64.deb ...\r\n", "Unpacking libhtscodecs2:amd64 (1.1.1-3) ...\r\n", "Selecting previously unselected package libhts3:amd64.\r\n", "Preparing to unpack .../libhts3_1.13+ds-2build1_amd64.deb ...\r\n", "Unpacking libhts3:amd64 (1.13+ds-2build1) ...\r\n", "Selecting previously unselected package samtools.\r\n", "Preparing to unpack .../samtools_1.13-4_amd64.deb ...\r\n", "Unpacking samtools (1.13-4) ...\r\n", "Setting up libhtscodecs2:amd64 (1.1.1-3) ...\r\n", "Setting up libhts3:amd64 (1.13+ds-2build1) ...\r\n", "Setting up bwa (0.7.17-6) ...\r\n", "Setting up samtools (1.13-4) ...\r\n", "Processing triggers for man-db (2.10.2-1) ...\r\n", "Processing triggers for libc-bin (2.35-0ubuntu3.8) ...\r\n", "/sbin/ldconfig.real: /usr/local/lib/libtcm_debug.so.1 is not a symbolic link\r\n", "\r\n", "/sbin/ldconfig.real: /usr/local/lib/libhwloc.so.15 is not a symbolic link\r\n", "\r\n", "/sbin/ldconfig.real: /usr/local/lib/libtbbmalloc.so.2 is not a symbolic link\r\n", "\r\n", "/sbin/ldconfig.real: /usr/local/lib/libumf.so.0 is not a symbolic link\r\n", "\r\n", "/sbin/ldconfig.real: /usr/local/lib/libtbbbind_2_0.so.3 is not a symbolic link\r\n", "\r\n", "/sbin/ldconfig.real: /usr/local/lib/libtbbbind.so.3 is not a symbolic link\r\n", "\r\n", "/sbin/ldconfig.real: /usr/local/lib/libur_adapter_level_zero.so.0 is not a symbolic link\r\n", "\r\n", "/sbin/ldconfig.real: /usr/local/lib/libtbb.so.12 is not a symbolic link\r\n", "\r\n", "/sbin/ldconfig.real: /usr/local/lib/libur_adapter_opencl.so.0 is not a symbolic link\r\n", "\r\n", "/sbin/ldconfig.real: /usr/local/lib/libtbbbind_2_5.so.3 is not a symbolic link\r\n", "\r\n", "/sbin/ldconfig.real: /usr/local/lib/libtcm.so.1 is not a symbolic link\r\n", "\r\n", "/sbin/ldconfig.real: /usr/local/lib/libtbbmalloc_proxy.so.2 is not a symbolic link\r\n", "\r\n", "/sbin/ldconfig.real: /usr/local/lib/libur_adapter_level_zero_v2.so.0 is not a symbolic link\r\n", "\r\n", "/sbin/ldconfig.real: /usr/local/lib/libur_loader.so.0 is not a symbolic link\r\n", "\r\n" ] }, { "output_type": "stream", "name": "stderr", "text": [ "W: Skipping acquire of configured file 'main/source/Sources' as repository 'https://r2u.stat.illinois.edu/ubuntu jammy InRelease' does not seem to provide it (sources.list entry misspelt?)\n" ] } ] }, { "cell_type": "code", "source": [], "metadata": { "id": "phn_xbmglT2B" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "%%bash\n", "# Index reference genome\n", "bwa index /content/decompressed/qtlseq_ref.fasta\n", "\n", "# Parent alignment\n", "bwa mem /content/decompressed/qtlseq_ref.fasta /content/decompressed/qtlseq_parent.1.fastq.gz \\\n", " | samtools view -Sb - > /content/decompressed/parent.bam\n", "\n", "# Bulk1 alignment\n", "bwa mem /content/decompressed/qtlseq_ref.fasta /content/decompressed/qtlseq_bulk1.1.fastq.gz \\\n", " | samtools view -Sb - > /content/decompressed/bulk1.bam\n", "\n", "# Bulk2 alignment\n", "bwa mem /content/decompressed/qtlseq_ref.fasta /content/decompressed/qtlseq_bulk1.2.fastq.gz \\\n", " | samtools view -Sb - > /content/decompressed/bulk2.bam\n" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "NJPuKHSDrnE4", "outputId": "fe7367f1-1b65-4202-92c3-c985a03c5c6c" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stderr", "text": [ "[bwa_index] Pack FASTA... 0.02 sec\n", "[bwa_index] Construct BWT for the packed sequence...\n", "[bwa_index] 0.66 seconds elapse.\n", "[bwa_index] Update BWT... 0.02 sec\n", "[bwa_index] Pack forward-only FASTA... 0.01 sec\n", "[bwa_index] Construct SA from BWT and Occ... 0.36 sec\n", "[main] Version: 0.7.17-r1188\n", "[main] CMD: bwa index /content/decompressed/qtlseq_ref.fasta\n", "[main] Real time: 1.296 sec; CPU: 1.082 sec\n", "[M::bwa_idx_load_from_disk] read 0 ALT contigs\n", "[M::process] read 133338 sequences (10000113 bp)...\n", "[M::process] read 26958 sequences (2021817 bp)...\n", "[M::mem_process_seqs] Processed 133338 reads in 4.488 CPU sec, 4.752 real sec\n", "[M::mem_process_seqs] Processed 26958 reads in 1.257 CPU sec, 1.253 real sec\n", "[main] Version: 0.7.17-r1188\n", "[main] CMD: bwa mem /content/decompressed/qtlseq_ref.fasta /content/decompressed/qtlseq_parent.1.fastq.gz\n", "[main] Real time: 6.449 sec; CPU: 6.059 sec\n", "[M::bwa_idx_load_from_disk] read 0 ALT contigs\n", "[M::process] read 133338 sequences (10000112 bp)...\n", "[M::process] read 10338 sequences (775350 bp)...\n", "[M::mem_process_seqs] Processed 133338 reads in 4.174 CPU sec, 4.157 real sec\n", "[M::mem_process_seqs] Processed 10338 reads in 0.535 CPU sec, 0.608 real sec\n", "[main] Version: 0.7.17-r1188\n", "[main] CMD: bwa mem /content/decompressed/qtlseq_ref.fasta /content/decompressed/qtlseq_bulk1.1.fastq.gz\n", "[main] Real time: 5.613 sec; CPU: 4.976 sec\n", "[M::bwa_idx_load_from_disk] read 0 ALT contigs\n", "[M::process] read 133336 sequences (10000114 bp)...\n", "[M::process] read 10340 sequences (775500 bp)...\n", "[M::mem_process_seqs] Processed 133336 reads in 5.009 CPU sec, 5.116 real sec\n", "[M::mem_process_seqs] Processed 10340 reads in 0.562 CPU sec, 0.547 real sec\n", "[main] Version: 0.7.17-r1188\n", "[main] CMD: bwa mem /content/decompressed/qtlseq_ref.fasta /content/decompressed/qtlseq_bulk1.2.fastq.gz\n", "[main] Real time: 6.351 sec; CPU: 5.927 sec\n" ] } ] }, { "cell_type": "code", "source": [], "metadata": { "id": "-C168tGOlWOm" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "%%bash\n", "# Parent alignment -> BAM -> sorted -> index\n", "bwa mem /content/decompressed/qtlseq_ref.fasta /content/decompressed/qtlseq_parent.1.fastq.gz \\\n", " | samtools view -Sb - \\\n", " | samtools sort -o /content/decompressed/parent.sorted.bam\n", "samtools index /content/decompressed/parent.sorted.bam\n", "\n", "# Bulk1\n", "bwa mem /content/decompressed/qtlseq_ref.fasta /content/decompressed/qtlseq_bulk1.1.fastq.gz \\\n", " | samtools view -Sb - \\\n", " | samtools sort -o /content/decompressed/bulk1.sorted.bam\n", "samtools index /content/decompressed/bulk1.sorted.bam\n", "\n", "# Bulk2\n", "bwa mem /content/decompressed/qtlseq_ref.fasta /content/decompressed/qtlseq_bulk1.2.fastq.gz \\\n", " | samtools view -Sb - \\\n", " | samtools sort -o /content/decompressed/bulk2.sorted.bam\n", "samtools index /content/decompressed/bulk2.sorted.bam\n" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "e_wevPdwr0dC", "outputId": "a7d17c45-3b7d-4d6c-ca7b-425d74712263" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stderr", "text": [ "[M::bwa_idx_load_from_disk] read 0 ALT contigs\n", "[M::process] read 133338 sequences (10000113 bp)...\n", "[M::process] read 26958 sequences (2021817 bp)...\n", "[M::mem_process_seqs] Processed 133338 reads in 5.389 CPU sec, 5.418 real sec\n", "[M::mem_process_seqs] Processed 26958 reads in 1.312 CPU sec, 1.930 real sec\n", "[main] Version: 0.7.17-r1188\n", "[main] CMD: bwa mem /content/decompressed/qtlseq_ref.fasta /content/decompressed/qtlseq_parent.1.fastq.gz\n", "[main] Real time: 7.702 sec; CPU: 6.934 sec\n", "[M::bwa_idx_load_from_disk] read 0 ALT contigs\n", "[M::process] read 133338 sequences (10000112 bp)...\n", "[M::process] read 10338 sequences (775350 bp)...\n", "[M::mem_process_seqs] Processed 133338 reads in 4.142 CPU sec, 4.125 real sec\n", "[M::mem_process_seqs] Processed 10338 reads in 0.582 CPU sec, 0.602 real sec\n", "[main] Version: 0.7.17-r1188\n", "[main] CMD: bwa mem /content/decompressed/qtlseq_ref.fasta /content/decompressed/qtlseq_bulk1.1.fastq.gz\n", "[main] Real time: 5.340 sec; CPU: 4.979 sec\n", "[M::bwa_idx_load_from_disk] read 0 ALT contigs\n", "[M::process] read 133336 sequences (10000114 bp)...\n", "[M::process] read 10340 sequences (775500 bp)...\n", "[M::mem_process_seqs] Processed 133336 reads in 5.165 CPU sec, 5.242 real sec\n", "[M::mem_process_seqs] Processed 10340 reads in 0.594 CPU sec, 1.095 real sec\n", "[main] Version: 0.7.17-r1188\n", "[main] CMD: bwa mem /content/decompressed/qtlseq_ref.fasta /content/decompressed/qtlseq_bulk1.2.fastq.gz\n", "[main] Real time: 6.992 sec; CPU: 6.033 sec\n" ] } ] }, { "cell_type": "code", "source": [], "metadata": { "id": "z0WaPOMWlY0H" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "import time, os\n", "\n", "# create unique output directory name\n", "outdir = f\"/content/qtlseq_results_{int(time.time())}\"\n", "\n", "cmd = f\"\"\"\n", "unset PYTHONPATH\n", "/usr/local/bin/conda run -n qtlseq qtlseq \\\n", " -r /content/decompressed/qtlseq_ref.fasta \\\n", " -p /content/decompressed/parent.sorted.bam \\\n", " -b1 /content/decompressed/bulk1.sorted.bam \\\n", " -b2 /content/decompressed/bulk2.sorted.bam \\\n", " -n1 20 \\\n", " -n2 20 \\\n", " -o {outdir} \\\n", " -t 2\n", "\"\"\"\n", "!bash -c \"$cmd\"\n", "print(\"Results saved in:\", outdir)\n" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "gDETvFYRr8LF", "outputId": "6d6c764f-7f3e-4653-bbda-f61219e084e9" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "[QTL-seq:2025-09-18 04:54:27] Starting QTL-seq analysis.\n", "[QTL-seq:2025-09-18 04:54:27] Indexing the reference FASTA.\n", "[QTL-seq:2025-09-18 04:54:28] Reference FASTA indexing completed successfully.\n", "[QTL-seq:2025-09-18 04:54:28] Sorting BAM files.\n", "[QTL-seq:2025-09-18 04:54:43] BAM file sorting completed successfully.\n", "[QTL-seq:2025-09-18 04:54:43] Calling variants.\n", "[QTL-seq:2025-09-18 04:54:44] Variant calling completed successfully.\n", "[QTL-seq:2025-09-18 04:54:44] Indexing the VCF file.\n", "[QTL-seq:2025-09-18 04:54:44] VCF indexing completed successfully.\n", "Traceback (most recent call last):\n", " File \"/usr/local/envs/qtlseq/bin/qtlplot\", line 6, in \n", " from qtlseq.qtlplot import main\n", " File \"/usr/local/envs/qtlseq/lib/python3.13/site-packages/qtlseq/qtlplot.py\", line 24, in \n", " from qtlseq.plot import Plot\n", " File \"/usr/local/envs/qtlseq/lib/python3.13/site-packages/qtlseq/plot.py\", line 8, in \n", " import matplotlib\n", " File \"/usr/local/envs/qtlseq/lib/python3.13/site-packages/matplotlib/__init__.py\", line 1299, in \n", " rcParams['backend'] = os.environ.get('MPLBACKEND')\n", " ~~~~~~~~^^^^^^^^^^^\n", " File \"/usr/local/envs/qtlseq/lib/python3.13/site-packages/matplotlib/__init__.py\", line 774, in __setitem__\n", " raise ValueError(f\"Key {key}: {ve}\") from None\n", "ValueError: Key backend: 'module://matplotlib_inline.backend_inline' is not a valid value for backend; supported values are ['gtk3agg', 'gtk3cairo', 'gtk4agg', 'gtk4cairo', 'macosx', 'nbagg', 'notebook', 'qtagg', 'qtcairo', 'qt5agg', 'qt5cairo', 'tkagg', 'tkcairo', 'webagg', 'wx', 'wxagg', 'wxcairo', 'agg', 'cairo', 'pdf', 'pgf', 'ps', 'svg', 'template']\n", "[QTL-seq:2025-09-18 04:54:44] QTL-seq analysis completed successfully.\n", "\n", "\n", "Results saved in: /content/qtlseq_results_1758171264\n" ] } ] }, { "cell_type": "code", "source": [], "metadata": { "id": "qxRlZqH7lah_" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "ls -lh /content/qtlseq_results_1758171264\n" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "WYaeLI4ZsXuU", "outputId": "befc7926-e824-492c-8ca4-aeaf7464bc9b" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "total 16K\n", "drwxr-xr-x 2 root root 4.0K Sep 18 04:54 \u001b[0m\u001b[01;34m10_ref\u001b[0m/\n", "drwxr-xr-x 2 root root 4.0K Sep 18 04:54 \u001b[01;34m20_bam\u001b[0m/\n", "drwxr-xr-x 2 root root 4.0K Sep 18 04:54 \u001b[01;34m30_vcf\u001b[0m/\n", "drwxr-xr-x 2 root root 4.0K Sep 18 04:54 \u001b[01;34mlog\u001b[0m/\n" ] } ] }, { "cell_type": "code", "source": [], "metadata": { "id": "YflBbBU-lfy3" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "# Install required tools and libraries\n", "!apt update -qq > /dev/null\n", "!apt install -y bcftools samtools tabix\n", "\n", "!pip install plotly pandas numpy seaborn git+https://github.com/YuSugihara/QTL-seq.git\n", "\n", "import os\n", "import subprocess\n", "import pandas as pd\n", "import numpy as np\n", "import plotly.graph_objects as go\n", "from plotly.subplots import make_subplots\n", "import warnings\n", "warnings.filterwarnings('ignore')" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "5Ya0iLenLZza", "outputId": "af4020f0-925b-4afa-a85b-68ae7904802c" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "\n", "WARNING: apt does not have a stable CLI interface. Use with caution in scripts.\n", "\n", "W: Skipping acquire of configured file 'main/source/Sources' as repository 'https://r2u.stat.illinois.edu/ubuntu jammy InRelease' does not seem to provide it (sources.list entry misspelt?)\n", "Reading package lists... Done\n", "Building dependency tree... Done\n", "Reading state information... Done\n", "bcftools is already the newest version (1.13-1).\n", "samtools is already the newest version (1.13-4).\n", "tabix is already the newest version (1.13+ds-2build1).\n", "0 upgraded, 0 newly installed, 0 to remove and 40 not upgraded.\n", "Collecting git+https://github.com/YuSugihara/QTL-seq.git\n", " Cloning https://github.com/YuSugihara/QTL-seq.git to /tmp/pip-req-build-zroabaem\n", " Running command git clone --filter=blob:none --quiet https://github.com/YuSugihara/QTL-seq.git /tmp/pip-req-build-zroabaem\n", " Resolved https://github.com/YuSugihara/QTL-seq.git to commit c96b2b5b878ca643db2fde05a3f55a7967b5135e\n", " Preparing metadata (setup.py) ... \u001b[?25l\u001b[?25hdone\n", "Requirement already satisfied: plotly in /usr/local/lib/python3.13/site-packages (6.3.0)\n", "Requirement already satisfied: pandas in /usr/local/lib/python3.13/site-packages (2.3.2)\n", "Requirement already satisfied: numpy in /usr/local/lib/python3.13/site-packages (2.3.3)\n", "Requirement already satisfied: seaborn in /usr/local/lib/python3.13/site-packages (0.13.2)\n", "Requirement already satisfied: narwhals>=1.15.1 in /usr/local/lib/python3.13/site-packages (from plotly) (2.5.0)\n", "Requirement already satisfied: packaging in /usr/local/lib/python3.13/site-packages (from plotly) (25.0)\n", "Requirement already satisfied: python-dateutil>=2.8.2 in /usr/local/lib/python3.13/site-packages (from pandas) (2.9.0.post0)\n", "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.13/site-packages (from pandas) (2025.2)\n", "Requirement already satisfied: tzdata>=2022.7 in /usr/local/lib/python3.13/site-packages (from pandas) (2025.2)\n", "Requirement already satisfied: matplotlib!=3.6.1,>=3.4 in /usr/local/lib/python3.13/site-packages (from seaborn) (3.10.6)\n", "Requirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.13/site-packages (from matplotlib!=3.6.1,>=3.4->seaborn) (1.3.3)\n", "Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.13/site-packages (from matplotlib!=3.6.1,>=3.4->seaborn) (0.12.1)\n", "Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.13/site-packages (from matplotlib!=3.6.1,>=3.4->seaborn) (4.60.0)\n", "Requirement already satisfied: kiwisolver>=1.3.1 in /usr/local/lib/python3.13/site-packages (from matplotlib!=3.6.1,>=3.4->seaborn) (1.4.9)\n", "Requirement already satisfied: pillow>=8 in /usr/local/lib/python3.13/site-packages (from matplotlib!=3.6.1,>=3.4->seaborn) (11.3.0)\n", "Requirement already satisfied: pyparsing>=2.3.1 in /usr/local/lib/python3.13/site-packages (from matplotlib!=3.6.1,>=3.4->seaborn) (3.2.4)\n", "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.13/site-packages (from python-dateutil>=2.8.2->pandas) (1.17.0)\n" ] } ] }, { "cell_type": "code", "source": [], "metadata": { "id": "-c20hZMGlhx6" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "# File paths (adjust if needed)\n", "REF = \"/content/decompressed/qtlseq_ref.fasta\"\n", "PARENT_BAM = \"/content/decompressed/parent.sorted.bam\"\n", "BULK1_BAM = \"/content/decompressed/bulk1.sorted.bam\"\n", "BULK2_BAM = \"/content/decompressed/bulk2.sorted.bam\"\n", "\n", "# Create bam_list.txt\n", "bam_list_path = \"/content/decompressed/bam_list.txt\"\n", "with open(bam_list_path, 'w') as f:\n", " f.write(f\"{PARENT_BAM}\\n\")\n", " f.write(f\"{BULK1_BAM}\\n\")\n", " f.write(f\"{BULK2_BAM}\\n\")\n", "\n", "OUTDIR = \"/content/qtlseq_results\"\n", "os.makedirs(OUTDIR, exist_ok=True)\n", "\n", "# Parameters\n", "N1 = 20\n", "N2 = 20\n", "WINDOW_SIZE_KB = 500 # 500 kb\n", "STEP_SIZE_KB = 50 # Adjust for density\n", "\n", "print(f\"BAM list created: {bam_list_path}\")\n", "print(f\"Output directory: {OUTDIR}\")" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "Por_5MJ6L2fi", "outputId": "6e4e60b9-050e-4926-cfc4-4ddb4904bb09" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "BAM list created: /content/decompressed/bam_list.txt\n", "Output directory: /content/qtlseq_results\n" ] } ] }, { "cell_type": "markdown", "source": [ "Variant calling" ], "metadata": { "id": "uf1RQH2al1pC" } }, { "cell_type": "code", "source": [ "%%bash\n", "# Variant calling with required annotations\n", "bcftools mpileup -Ou -f /content/decompressed/qtlseq_ref.fasta \\\n", " /content/decompressed/parent.sorted.bam \\\n", " /content/decompressed/bulk1.sorted.bam \\\n", " /content/decompressed/bulk2.sorted.bam \\\n", " --annotate FORMAT/AD,FORMAT/ADF,FORMAT/ADR | \\\n", "bcftools call -mv -Ob -o /content/decompressed/variants.bcf\n", "\n", "# Index the BCF\n", "bcftools index /content/decompressed/variants.bcf\n" ], "metadata": { "id": "SkI8wA1NlvhJ" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "%%bash\n", "unset PYTHONPATH\n", "export MPLBACKEND=Agg\n", "\n", "/usr/local/bin/conda run -n qtlseq qtlplot \\\n", " -v /content/decompressed/variants.bcf \\\n", " -n1 20 \\\n", " -n2 20 \\\n", " -o /content/qtlseq_results_run3 \\\n", " -t 2\n" ], "metadata": { "id": "GUUMdas1wSGa" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "# Set matplotlib backend to Agg to avoid backend error\n", "os.environ['MPLBACKEND'] = 'Agg'\n", "\n", "qtlplot_cmd = [\n", " 'qtlplot',\n", " '-v', f\"{vcf_path}.gz\",\n", " '-n1', str(N1),\n", " '-n2', str(N2),\n", " '-o', OUTDIR,\n", " '-w', str(WINDOW_SIZE_KB),\n", " '-s', str(STEP_SIZE_KB)\n", "]\n", "\n", "result = subprocess.run(qtlplot_cmd, capture_output=True, text=True)\n", "if result.returncode == 0:\n", " print(\"qtlplot completed successfully.\")\n", " print(result.stdout)\n", "else:\n", " print(\"Error in qtlplot:\")\n", " print(result.stderr)\n", " raise RuntimeError(\"qtlplot failed\")\n", "\n", "# Output paths\n", "snp_tsv = f\"{OUTDIR}/40_qtlseq/snp_index.tsv\"\n", "window_tsv = f\"{OUTDIR}/40_qtlseq/sliding_window.tsv\"\n", "p95_tsv = f\"{OUTDIR}/40_qtlseq/sliding_window.p95.tsv\"\n", "\n", "print(f\"Data files generated in {OUTDIR}/40_qtlseq/\")" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "2hLw6iJrMABR", "outputId": "289d3dab-8427-4ce8-aead-dee20dfce258" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "qtlplot completed successfully.\n", "[QTL-seq:2025-09-18 04:59:18] Starting QTL-plot.\n", "[QTL-seq:2025-09-18 04:59:18] Output directory already exists.\n", "[QTL-seq:2025-09-18 04:59:18] Calculating SNP-index.\n", "[QTL-seq:2025-09-18 04:59:27] SNP-index calculation completed successfully.\n", "[QTL-seq:2025-09-18 04:59:27] Smoothing SNP-index.\n", "[QTL-seq:2025-09-18 04:59:27] SNP-index smoothing completed successfully.\n", "[QTL-seq:2025-09-18 04:59:27] Generating plot...\n", "[QTL-seq:2025-09-18 04:59:27] QTL-plot completed successfully.\n", "\n", "Data files generated in /content/qtlseq_results/40_qtlseq/\n" ] } ] }, { "cell_type": "code", "source": [], "metadata": { "id": "U7bbSNgwl70E" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "!ls -lh /content/qtlseq_results_run1\n", "\n" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "-tMHmhQ2siUA", "outputId": "7ca6eab4-10e5-457a-d8cd-db3361ef61d2" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "total 12K\n", "drwxr-xr-x 2 root root 4.0K Sep 17 07:51 10_ref\n", "drwxr-xr-x 2 root root 4.0K Sep 17 07:51 20_bam\n", "drwxr-xr-x 2 root root 4.0K Sep 17 07:51 log\n" ] } ] }, { "cell_type": "code", "source": [], "metadata": { "id": "UA9CnUMgl-qA" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "ls /content/decompressed/\n" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "EjjCYomfwIMe", "outputId": "ee50a80d-1f8d-41c5-d2a3-74e2704d7ed4" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "bulk1.bam parent.sorted.bam qtlseq_ref.fasta.ann\n", "bulk1.sorted.bam parent.sorted.bam.bai qtlseq_ref.fasta.bwt\n", "bulk1.sorted.bam.bai qtlseq_bulk1.1.fastq.gz qtlseq_ref.fasta.fai\n", "bulk2.bam qtlseq_bulk1.2.fastq.gz qtlseq_ref.fasta.pac\n", "bulk2.sorted.bam qtlseq_parent.1.fastq.gz qtlseq_ref.fasta.sa\n", "bulk2.sorted.bam.bai qtlseq_ref.fasta\n", "parent.bam qtlseq_ref.fasta.amb\n" ] } ] }, { "cell_type": "code", "source": [], "metadata": { "id": "MAIqgMYimBG0" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "# Generate bam_list.txt with all sorted BAM files\n", "import os\n", "\n", "bam_dir = \"/content/decompressed\"\n", "bam_files = [f\"{bam_dir}/{f}\" for f in os.listdir(bam_dir) if f.endswith(\".sorted.bam\")]\n", "\n", "with open(f\"{bam_dir}/bam_list.txt\", \"w\") as f:\n", " for bam in bam_files:\n", " f.write(f\"{bam}\\n\")\n", "\n", "print(\"bam_list.txt created with the following files:\")\n", "print(bam_files)\n" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "puL84vcqwQ0e", "outputId": "f25270cf-8eca-4a4b-8525-ad96dec45ccc" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "bam_list.txt created with the following files:\n", "['/content/decompressed/bulk1.sorted.bam', '/content/decompressed/parent.sorted.bam', '/content/decompressed/bulk2.sorted.bam']\n" ] } ] }, { "cell_type": "code", "source": [], "metadata": { "id": "dWwgKZmgmDaj" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "%%bash\n", "unset PYTHONPATH\n", "export MPLBACKEND=Agg\n", "\n", "source /usr/local/bin/activate qtlseq\n", "\n", "REF=\"/content/decompressed/qtlseq_ref.fasta\"\n", "BAM_LIST=\"/content/decompressed/bam_list.txt\"\n", "OUTDIR=\"/content/qtlseq_results_run3\"\n", "\n", "mkdir -p $OUTDIR\n", "\n", "echo \"[QTL-seq] Calling variants with bcftools...\"\n", "bcftools mpileup -f $REF -b $BAM_LIST -a AD,ADF,ADR -Ou \\\n", " | bcftools call -mv -Ov -o $OUTDIR/variants.vcf\n", "\n", "echo \"[QTL-seq] Running QTL-seq plotting...\"\n", "qtlplot -v $OUTDIR/variants.vcf -n1 20 -n2 20 -o $OUTDIR -t 2\n", "\n", "echo \"[QTL-seq] Pipeline completed successfully. Results in $OUTDIR\"\n" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "7_WwetqbwYY3", "outputId": "7fb48552-b25e-461c-ff61-f951bf16db7a" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "[QTL-seq] Calling variants with bcftools...\n", "[QTL-seq] Running QTL-seq plotting...\n", "[QTL-seq:2025-09-17 08:20:09] Starting QTL-plot.\n", "[QTL-seq:2025-09-17 08:20:09] Output directory already exists.\n", "[QTL-seq:2025-09-17 08:20:09] Calculating SNP-index.\n", "[QTL-seq:2025-09-17 08:20:15] SNP-index calculation completed successfully.\n", "[QTL-seq:2025-09-17 08:20:15] Smoothing SNP-index.\n", "[QTL-seq:2025-09-17 08:20:15] SNP-index smoothing completed successfully.\n", "[QTL-seq:2025-09-17 08:20:15] Generating plot...\n", "[QTL-seq:2025-09-17 08:20:18] QTL-plot completed successfully.\n", "[QTL-seq] Pipeline completed successfully. Results in /content/qtlseq_results_run3\n" ] }, { "output_type": "stream", "name": "stderr", "text": [ "Note: none of --samples-file, --ploidy or --ploidy-file given, assuming all sites are diploid\n", "[mpileup] 3 samples in 3 input files\n", "[mpileup] maximum number of reads per input file set to -d 250\n" ] } ] }, { "cell_type": "code", "source": [], "metadata": { "id": "6jqESD2omFhL" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "import os\n", "\n", "output_dir = \"/content/qtlseq_results_run3\"\n", "print(os.listdir(output_dir))\n", "\n" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "SbGuyI-Jwx9Y", "outputId": "b7175d47-e8e0-4587-a9d7-703e7cd041e1" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "['sliding_window.p95.tsv', 'variants.bcf', 'variants.vcf', 'bulk1_SNPindex.png', 'sliding_window.p99.tsv', 'sliding_window.tsv', 'bulk2_SNPindex.png', 'variants.bcf.csi', 'snp_index.p99.tsv', 'snp_index.p95.tsv', 'delta_SNPindex.png', 'snp_index.tsv']\n" ] } ] }, { "cell_type": "code", "source": [], "metadata": { "id": "aj2GEeg6mK5b" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "# Install dependencies and set up conda environment\n", "!apt update -qq > /dev/null\n", "!apt install -y bcftools samtools tabix wget -y > /dev/null\n", "\n", "# Install Miniconda\n", "!wget -q https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh\n", "!chmod +x Miniconda3-latest-Linux-x86_64.sh\n", "!bash ./Miniconda3-latest-Linux-x86_64.sh -b -f -p /usr/local > /dev/null\n", "import sys\n", "sys.path.append('/usr/local/lib/python3.10/site-packages/')\n", "\n", "# Install qtlseq via conda\n", "!conda create -n qtlseq -c bioconda qtlseq -y > /dev/null 2>&1\n", "!conda install -n qtlseq python=3.10 -y > /dev/null 2>&1 # Ensure compatible Python version\n", "\n", "# Install Python libraries\n", "!pip install plotly pandas numpy seaborn -q\n", "\n", "import os\n", "import subprocess\n", "import pandas as pd\n", "import numpy as np\n", "import plotly.graph_objects as go\n", "from plotly.subplots import make_subplots\n", "import warnings\n", "import shutil\n", "import time\n", "warnings.filterwarnings('ignore')\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n" ], "metadata": { "id": "SOBzjSupOuo5" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [], "metadata": { "id": "LD5uWjDdmOa7" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "# Install dependencies and set up conda environment\n", "!apt update -qq > /dev/null\n", "!apt install -y bcftools samtools tabix wget -y > /dev/null\n", "\n", "# Install Miniconda\n", "!wget -q https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh\n", "!chmod +x Miniconda3-latest-Linux-x86_64.sh\n", "!bash ./Miniconda3-latest-Linux-x86_64.sh -b -f -p /usr/local > /dev/null\n", "import sys\n", "sys.path.append('/usr/local/lib/python3.10/site-packages/')\n", "\n", "# Install qtlseq via conda\n", "!conda create -n qtlseq -c bioconda qtlseq -y > /dev/null 2>&1\n", "!conda install -n qtlseq python=3.10 -y > /dev/null 2>&1\n", "\n", "# Install Python libraries\n", "!pip install plotly pandas numpy seaborn -q\n" ], "metadata": { "id": "VQJHqc2yYFrh" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [], "metadata": { "id": "JS-jODXImYL6" }, "execution_count": null, "outputs": [] }, { "cell_type": "markdown", "source": [ "QTL seq" ], "metadata": { "id": "9nnY_TcfmdP6" } }, { "cell_type": "code", "source": [ "import os\n", "import subprocess\n", "import shutil\n", "import time\n", "import random\n", "import datetime\n", "import numpy as np\n", "import pandas as pd\n", "import zipfile\n", "from google.colab import files as colab_files\n", "import plotly.graph_objects as go\n", "from plotly.subplots import make_subplots\n", "\n", "# Define paths and parameters\n", "REF = \"/content/decompressed/qtlseq_ref.fasta\"\n", "PARENT_BAM = \"/content/decompressed/parent.sorted.bam\"\n", "BULK1_BAM = \"/content/decompressed/bulk1.sorted.bam\"\n", "BULK2_BAM = \"/content/decompressed/bulk2.sorted.bam\"\n", "\n", "# Verify input files exist and BAMs are valid\n", "input_files = [REF, PARENT_BAM, BULK1_BAM, BULK2_BAM]\n", "print(\"Checking input files:\")\n", "for f in input_files:\n", " if os.path.exists(f):\n", " print(f\"✓ Found: {f}\")\n", " else:\n", " raise FileNotFoundError(f\"Input file missing: {f}\")\n", "\n", "# Validate and index BAM files\n", "for bam in [PARENT_BAM, BULK1_BAM, BULK2_BAM]:\n", " print(f\"Validating BAM: {bam}\")\n", " result = subprocess.run(['samtools', 'quickcheck', bam], capture_output=True, text=True)\n", " if result.returncode != 0:\n", " raise RuntimeError(f\"BAM file invalid: {bam}\")\n", "\n", " if not os.path.exists(f\"{bam}.bai\"):\n", " print(f\"Indexing {bam}...\")\n", " subprocess.run(['samtools', 'index', bam], check=True)\n", "\n", "# Check reference sequence length\n", "print(\"Checking reference sequence length...\")\n", "try:\n", " subprocess.run(['samtools', 'faidx', REF], check=True)\n", " with open(f\"{REF}.fai\", 'r') as fai:\n", " ref_length = sum(int(line.split('\\t')[1]) for line in fai)\n", " print(f\"Reference sequence total length: {ref_length} bases\")\n", "except Exception as e:\n", " print(f\"Warning: Could not determine reference length: {e}\")\n", " ref_length = 1000\n", " print(f\"Assuming reference length: {ref_length} bases\")\n", "\n", "# Adjust window size for short reference\n", "WINDOW_SIZE = max(20, ref_length // 50) # Smaller window for ~200-300 base reference\n", "STEP_SIZE = max(2, WINDOW_SIZE // 10) # Smaller step size\n", "print(f\"Adjusted parameters: window_size={WINDOW_SIZE}, step_size={STEP_SIZE}\")\n", "\n", "# Parameters\n", "N1 = 20\n", "N2 = 20\n", "REF_ALLELE_FREQ = 0.1\n", "MIN_TOTAL_DEPTH = 50\n", "\n", "print(f\"Parameters: N1={N1}, N2={N2}, REF_ALLELE_FREQ={REF_ALLELE_FREQ}, MIN_TOTAL_DEPTH={MIN_TOTAL_DEPTH}\")\n", "\n", "# Completely clean environment\n", "print(\"Cleaning environment...\")\n", "!pkill -f qtlseq 2>/dev/null || true\n", "!rm -rf /content/qtlseq* /content/*qtlseq* /tmp/qtlseq* /tmp/*qtlseq* 2>/dev/null || true\n", "time.sleep(2)\n", "\n", "# Set environment variables\n", "os.environ['MPLBACKEND'] = 'Agg'\n", "os.environ['TMPDIR'] = '/tmp'\n", "\n", "# Create working directory\n", "timestamp = datetime.datetime.now().strftime(\"%Y%m%d_%H%M%S\")\n", "random_id = random.randint(10000, 99999)\n", "work_dir = f\"/tmp/qtl_analysis_{timestamp}_{random_id}\"\n", "\n", "print(f\"Creating working directory: {work_dir}\")\n", "os.makedirs(work_dir, exist_ok=True)\n", "\n", "# Strategy 1: Try qtlseq\n", "success = False\n", "\n", "print(\"\\n=== Strategy 1: QTL-seq with different parameters ===\")\n", "\n", "qtlseq_variations = [\n", " ['/usr/local/bin/conda', 'run', '-n', 'qtlseq', 'qtlseq',\n", " '-r', REF, '-p', PARENT_BAM, '-b1', BULK1_BAM, '-b2', BULK2_BAM,\n", " '-n1', str(N1), '-n2', str(N2), '-o', work_dir, '-t', '2', '--force'],\n", "\n", " ['/usr/local/bin/conda', 'run', '-n', 'qtlseq', 'qtlseq',\n", " '-r', REF, '-p', PARENT_BAM, '-b1', BULK1_BAM, '-b2', BULK2_BAM,\n", " '-n1', str(N1), '-n2', str(N2), '-o', work_dir, '-t', '2', '--overwrite'],\n", "\n", " ['/usr/local/bin/conda', 'run', '-n', 'qtlseq', 'qtlseq',\n", " '-r', REF, '-p', PARENT_BAM, '-b1', BULK1_BAM, '-b2', BULK2_BAM,\n", " '-n1', str(N1), '-n2', str(N2), '-t', '2']\n", "]\n", "\n", "for i, cmd in enumerate(qtlseq_variations):\n", " print(f\"\\nTrying variation {i+1}: {' '.join(cmd)}\")\n", "\n", " if os.path.exists(work_dir):\n", " shutil.rmtree(work_dir)\n", " time.sleep(1)\n", " os.makedirs(work_dir, exist_ok=True)\n", "\n", " original_cwd = os.getcwd()\n", " if i == 2:\n", " os.chdir(work_dir)\n", "\n", " try:\n", " result = subprocess.run(cmd, capture_output=True, text=True, timeout=1800)\n", "\n", " if result.returncode == 0:\n", " print(\"✓ QTL-seq completed successfully!\")\n", " success = True\n", " if i == 2:\n", " os.chdir(original_cwd)\n", " break\n", " else:\n", " print(f\"✗ Failed: {result.stderr[:200]}...\")\n", " except subprocess.TimeoutExpired:\n", " print(\"✗ QTL-seq timed out after 30 minutes\")\n", " except Exception as e:\n", " print(f\"✗ Error: {e}\")\n", " finally:\n", " if i == 2:\n", " os.chdir(original_cwd)\n", "\n", "# Strategy 2: Manual BSA-seq analysis\n", "if not success:\n", " print(\"\\n=== Strategy 2: Manual BSA-seq analysis ===\")\n", " print(\"Running manual Bulk Segregant Analysis...\")\n", "\n", " try:\n", " manual_dir = f\"/tmp/manual_bsa_{timestamp}_{random_id}\"\n", " os.makedirs(manual_dir, exist_ok=True)\n", "\n", " print(\"Step 1: Generating mpileup...\")\n", " mpileup_file = f\"{manual_dir}/all_samples.mpileup\"\n", "\n", " mpileup_cmd = [\n", " 'samtools', 'mpileup', '-f', REF, '-q', '20', '-Q', '20',\n", " PARENT_BAM, BULK1_BAM, BULK2_BAM\n", " ]\n", "\n", " with open(mpileup_file, 'w') as f:\n", " result = subprocess.run(mpileup_cmd, stdout=f, stderr=subprocess.PIPE, text=True)\n", "\n", " if result.returncode != 0:\n", " raise RuntimeError(f\"Mpileup failed: {result.stderr}\")\n", "\n", " print(f\"✓ Mpileup completed: {mpileup_file}\")\n", "\n", " print(\"Step 2: Parsing mpileup and calculating SNP indices...\")\n", "\n", " def parse_mpileup_line(line):\n", " fields = line.strip().split('\\t')\n", " if len(fields) < 12:\n", " return None\n", "\n", " chrom, pos, ref_base = fields[0], int(fields[1]), fields[2].upper()\n", "\n", " samples = []\n", " for i in range(3):\n", " start_idx = 3 + i * 3\n", " if start_idx + 2 >= len(fields):\n", " return None\n", "\n", " depth = int(fields[start_idx])\n", " reads = fields[start_idx + 1]\n", "\n", " if depth < 10:\n", " return None\n", "\n", " ref_count = reads.count('.') + reads.count(',')\n", " alt_count = depth - ref_count\n", "\n", " if depth > 0:\n", " ref_freq = ref_count / depth\n", " alt_freq = alt_count / depth\n", " else:\n", " ref_freq = alt_freq = 0\n", "\n", " samples.append({\n", " 'depth': depth,\n", " 'ref_count': ref_count,\n", " 'alt_count': alt_count,\n", " 'ref_freq': ref_freq,\n", " 'alt_freq': alt_freq\n", " })\n", "\n", " return {\n", " 'chrom': chrom,\n", " 'pos': pos,\n", " 'ref_base': ref_base,\n", " 'parent': samples[0],\n", " 'bulk1': samples[1],\n", " 'bulk2': samples[2]\n", " }\n", "\n", " snp_data = []\n", "\n", " with open(mpileup_file, 'r') as f:\n", " for line_num, line in enumerate(f):\n", " if line_num % 10000 == 0:\n", " print(f\"Processed {line_num} lines...\")\n", "\n", " parsed = parse_mpileup_line(line)\n", " if parsed:\n", " bulk1_snp_index = parsed['bulk1']['alt_freq']\n", " bulk2_snp_index = parsed['bulk2']['alt_freq']\n", " delta_snp_index = bulk1_snp_index - bulk2_snp_index\n", "\n", " total_depth = parsed['bulk1']['depth'] + parsed['bulk2']['depth']\n", " parent_ref_freq = parsed['parent']['ref_freq']\n", "\n", " if total_depth >= MIN_TOTAL_DEPTH and parent_ref_freq >= REF_ALLELE_FREQ:\n", " snp_data.append({\n", " 'CHROM': parsed['chrom'],\n", " 'POS': parsed['pos'],\n", " 'REF': parsed['ref_base'],\n", " 'PARENT_DEPTH': parsed['parent']['depth'],\n", " 'PARENT_REF_FREQ': parent_ref_freq,\n", " 'BULK1_DEPTH': parsed['bulk1']['depth'],\n", " 'BULK1_SNP_INDEX': bulk1_snp_index,\n", " 'BULK2_DEPTH': parsed['bulk2']['depth'],\n", " 'BULK2_SNP_INDEX': bulk2_snp_index,\n", " 'deltaSNP': delta_snp_index,\n", " 'TOTAL_DEPTH': total_depth\n", " })\n", "\n", " print(f\"✓ Parsed {len(snp_data)} high-quality SNPs\")\n", "\n", " if len(snp_data) == 0:\n", " raise RuntimeError(\"No SNPs passed quality filters\")\n", "\n", " snp_df = pd.DataFrame(snp_data)\n", "\n", " print(\"Step 3: Performing sliding window analysis...\")\n", "\n", " def sliding_window_analysis(df, window_size=WINDOW_SIZE, step_size=STEP_SIZE):\n", " windows = []\n", "\n", " for chrom in df['CHROM'].unique():\n", " chrom_data = df[df['CHROM'] == chrom].copy()\n", " if len(chrom_data) == 0:\n", " continue\n", "\n", " chrom_data = chrom_data.sort_values('POS')\n", " max_pos = chrom_data['POS'].max()\n", " min_pos = chrom_data['POS'].min()\n", "\n", " start = min_pos\n", "\n", " while start <= max_pos:\n", " end = start + window_size\n", "\n", " window_snps = chrom_data[(chrom_data['POS'] >= start) &\n", " (chrom_data['POS'] < end)]\n", "\n", " if len(window_snps) >= 1:\n", " mean_delta = window_snps['deltaSNP'].mean()\n", " std_delta = window_snps['deltaSNP'].std() if len(window_snps) > 1 else 0\n", " n_snps = len(window_snps)\n", "\n", " se = std_delta / np.sqrt(n_snps) if n_snps > 1 else 0\n", " ci_95 = 1.96 * se\n", " ci_99 = 2.58 * se\n", "\n", " windows.append({\n", " 'CHROM': chrom,\n", " 'START': start,\n", " 'END': end,\n", " 'WINDOW_CENTER': start + window_size // 2,\n", " 'N_SNPS': n_snps,\n", " 'deltaSNP': mean_delta,\n", " 'tricubeDeltaSNP': mean_delta,\n", " 'CI_95': ci_95,\n", " 'CI_99': ci_99,\n", " 'STD': std_delta\n", " })\n", "\n", " start += step_size\n", "\n", " if not windows:\n", " windows.append({\n", " 'CHROM': chrom,\n", " 'START': min_pos,\n", " 'END': min_pos + window_size,\n", " 'WINDOW_CENTER': min_pos + window_size // 2,\n", " 'N_SNPS': 0,\n", " 'deltaSNP': 0,\n", " 'tricubeDeltaSNP': 0,\n", " 'CI_95': 0,\n", " 'CI_99': 0,\n", " 'STD': 0\n", " })\n", " print(f\"Warning: No windows generated for {chrom}, created dummy window\")\n", "\n", " return pd.DataFrame(windows)\n", "\n", " window_df = sliding_window_analysis(snp_df)\n", " print(f\"✓ Created {len(window_df)} sliding windows\")\n", "\n", " snp_df.to_csv(f\"{manual_dir}/snp_data.csv\", index=False)\n", " window_df.to_csv(f\"{manual_dir}/window_data.csv\", index=False)\n", "\n", " success = True\n", " work_dir = manual_dir\n", "\n", " print(\"✓ Manual BSA analysis completed successfully!\")\n", "\n", " except Exception as e:\n", " print(f\"✗ Manual analysis failed: {e}\")\n", " raise RuntimeError(\"All analysis strategies failed\")\n", "\n", "if not success:\n", " raise RuntimeError(\"All analysis methods failed\")\n", "\n", "print(f\"\\n=== Results Processing ===\")\n", "print(f\"Working directory: {work_dir}\")\n", "\n", "output_files = []\n", "for root, dirs, files_list in os.walk(work_dir):\n", " for file in files_list:\n", " if file.endswith(('.tsv', '.csv', '.txt')) and any(x in file.lower() for x in ['snp', 'window', 'sliding']):\n", " output_files.append(os.path.join(root, file))\n", "\n", "print(f\"Found output files: {[os.path.basename(f) for f in output_files]}\")\n", "\n", "snp_df = None\n", "window_df = None\n", "\n", "for file in output_files:\n", " filename = os.path.basename(file).lower()\n", " try:\n", " if 'snp' in filename and snp_df is None:\n", " snp_df = pd.read_csv(file, sep='\\t' if file.endswith('.tsv') else ',')\n", " print(f\"✓ Loaded SNP data from {filename}: {snp_df.shape}\")\n", " elif ('window' in filename or 'sliding' in filename) and window_df is None:\n", " window_df = pd.read_csv(file, sep='\\t' if file.endswith('.tsv') else ',')\n", " print(f\"✓ Loaded window data from {filename}: {window_df.shape}\")\n", " except Exception as e:\n", " print(f\"Could not load {filename}: {e}\")\n", "\n", "if snp_df is None or window_df is None:\n", " manual_snp_file = f\"{manual_dir}/snp_data.csv\"\n", " manual_window_file = f\"{manual_dir}/window_data.csv\"\n", "\n", " if os.path.exists(manual_snp_file) and snp_df is None:\n", " snp_df = pd.read_csv(manual_snp_file)\n", " print(f\"✓ Loaded manual SNP data: {snp_df.shape}\")\n", "\n", " if os.path.exists(manual_window_file) and window_df is None:\n", " window_df = pd.read_csv(manual_window_file)\n", " print(f\"✓ Loaded manual window data: {window_df.shape}\")\n", "\n", "if snp_df is None or window_df is None:\n", " raise RuntimeError(\"Could not load analysis results\")\n", "\n", "# Enhanced duplicate POS column removal\n", "for df_name, df in [('snp', snp_df), ('window', window_df)]:\n", " pos_candidates = [col for col in df.columns if any(x in col.lower() for x in ['pos', 'position', 'start', 'window_center'])]\n", " if len(pos_candidates) > 1:\n", " print(f\"Warning: Multiple position-related columns found in {df_name}: {pos_candidates}\")\n", " preferred_col = next((col for col in ['WINDOW_CENTER', 'START', 'POS'] if col in pos_candidates), pos_candidates[0])\n", " if preferred_col != 'POS':\n", " df['POS'] = df[preferred_col]\n", " df.drop(preferred_col, axis=1, inplace=True)\n", " for col in pos_candidates:\n", " if col != preferred_col and col in df.columns:\n", " df.drop(col, axis=1, inplace=True)\n", " print(f\"Kept {preferred_col} as POS, dropped: {[col for col in pos_candidates if col != preferred_col]}\")\n", " elif len(pos_candidates) == 1:\n", " if pos_candidates[0] != 'POS':\n", " df['POS'] = df[pos_candidates[0]]\n", " df.drop(pos_candidates[0], axis=1, inplace=True)\n", " print(f\"Renamed {pos_candidates[0]} to POS in {df_name}\")\n", " else:\n", " print(f\"Warning: No position column found in {df_name}, creating dummy POS\")\n", " df['POS'] = range(1, len(df) + 1)\n", "\n", "# Standardize column names\n", "print(\"Standardizing column names...\")\n", "column_mapping = {\n", " 'POSI': 'POS', 'position': 'POS', 'START': 'POS', 'WINDOW_CENTER': 'POS',\n", " 'DELTA SNP-index': 'deltaSNP', 'delta_snp': 'deltaSNP', 'DELTA_SNP_INDEX': 'deltaSNP',\n", " 'MEAN DELTA SNP-index': 'tricubeDeltaSNP', 'mean_delta_snp': 'tricubeDeltaSNP',\n", " 'MEAN p95': 'CI_95', 'mean_p95': 'CI_95', 'p95': 'CI_95',\n", " 'MEAN p99': 'CI_99', 'mean_p99': 'CI_99', 'p99': 'CI_99'\n", "}\n", "\n", "for df in [snp_df, window_df]:\n", " for old_name, new_name in column_mapping.items():\n", " if old_name in df.columns:\n", " df.rename(columns={old_name: new_name}, inplace=True)\n", "\n", "required_cols = {'snp': ['CHROM', 'POS'], 'window': ['CHROM', 'POS']}\n", "for df_name, df in [('snp', snp_df), ('window', window_df)]:\n", " print(f\"{df_name.upper()} columns after standardization: {list(df.columns)}\")\n", " for col in required_cols[df_name]:\n", " if col not in df.columns:\n", " candidates = [c for c in df.columns if col.lower() in c.lower()]\n", " if candidates:\n", " df[col] = df[candidates[0]]\n", " print(f\"Mapped {candidates[0]} -> {col} for {df_name}\")\n", "\n", "# Convert positions to Mb\n", "print(\"\\n=== Processing Positions ===\")\n", "for df_name, df in [('SNP', snp_df), ('Window', window_df)]:\n", " print(f\"{df_name} DataFrame columns before processing: {list(df.columns)}\")\n", " try:\n", " if 'POS' in df.columns:\n", " if isinstance(df['POS'], pd.Series):\n", " df['POS'] = pd.to_numeric(df['POS'], errors='coerce')\n", " else:\n", " print(f\"Warning: POS column in {df_name} is not a Series, selecting first column\")\n", " df['POS'] = df['POS'].iloc[:, 0]\n", " df['POS'] = pd.to_numeric(df['POS'], errors='coerce')\n", " else:\n", " print(f\"Warning: No POS column in {df_name} data\")\n", " pos_candidates = [col for col in df.columns if any(x in col.lower() for x in ['pos', 'position', 'start', 'window_center'])]\n", " if pos_candidates:\n", " df['POS'] = pd.to_numeric(df[pos_candidates[0]], errors='coerce')\n", " print(f\"Using {pos_candidates[0]} as POS column for {df_name}\")\n", " else:\n", " df['POS'] = range(1, len(df) + 1)\n", " print(f\"Warning: Created dummy positions for {df_name}\")\n", "\n", " if df['POS'].isna().all() or (df['POS'] <= 0).all() or df['POS'].nunique() == 1:\n", " print(f\"Error: Invalid POS values (all NaN, zero, or identical) in {df_name}\")\n", " df['POS'] = range(1, len(df) + 1)\n", " print(f\"Warning: Created dummy positions for {df_name}\")\n", "\n", " df['POS_Mb'] = df['POS'] / 1e6\n", " print(f\"✓ Created POS_Mb column for {df_name} data\")\n", "\n", " except Exception as e:\n", " print(f\"Error processing POS column for {df_name}: {e}\")\n", " df['POS'] = pd.Series(range(1, len(df) + 1), index=df.index)\n", " df['POS_Mb'] = df['POS'] / 1000\n", " print(f\"Warning: Created dummy positions for {df_name} due to error\")\n", "\n", "# Create visualization\n", "print(\"\\n=== Creating Visualization ===\")\n", "chroms = sorted(window_df['CHROM'].unique())\n", "n_chroms = len(chroms)\n", "ncols = min(4, n_chroms)\n", "nrows = (n_chroms + ncols - 1) // ncols\n", "\n", "print(f\"Found {n_chroms} chromosomes: {chroms}\")\n", "\n", "fig = make_subplots(\n", " rows=nrows, cols=ncols,\n", " subplot_titles=[f\"Chromosome {chrom}\" for chrom in chroms],\n", " horizontal_spacing=0.08,\n", " vertical_spacing=0.10\n", ")\n", "\n", "colors = {'raw': '#87CEEB', 'smooth': '#DC143C', 'ci95': '#FF8C00', 'ci99': '#32CD32'}\n", "\n", "for i, chrom in enumerate(chroms):\n", " row = i // ncols + 1\n", " col = i % ncols + 1\n", "\n", " snp_chrom = snp_df[snp_df['CHROM'] == chrom] if 'deltaSNP' in snp_df.columns else pd.DataFrame()\n", " win_chrom = window_df[window_df['CHROM'] == chrom]\n", "\n", " print(f\"Chromosome {chrom}: {len(snp_chrom)} SNPs, {len(win_chrom)} windows\")\n", "\n", " if len(snp_chrom) > 0 and 'deltaSNP' in snp_chrom.columns:\n", " fig.add_trace(\n", " go.Scatter(\n", " x=snp_chrom['POS_Mb'], y=snp_chrom['deltaSNP'],\n", " mode='markers', name='Raw Δ(SNP-index)',\n", " marker=dict(size=1.5, color=colors['raw'], opacity=0.5),\n", " showlegend=(i == 0), legendgroup='raw'\n", " ), row=row, col=col\n", " )\n", "\n", " smooth_col = next((c for c in ['tricubeDeltaSNP', 'deltaSNP'] if c in win_chrom.columns), None)\n", " if len(win_chrom) > 0 and smooth_col:\n", " fig.add_trace(\n", " go.Scatter(\n", " x=win_chrom['POS_Mb'], y=win_chrom[smooth_col],\n", " mode='lines', name='Smoothed Δ(SNP-index)',\n", " line=dict(color=colors['smooth'], width=2.5),\n", " showlegend=(i == 0), legendgroup='smooth'\n", " ), row=row, col=col\n", " )\n", "\n", " for ci_col, color, name in [('CI_95', colors['ci95'], '95% CI'), ('CI_99', colors['ci99'], '99% CI')]:\n", " if len(win_chrom) > 0 and ci_col in win_chrom.columns:\n", " for sign, show_legend in [(1, i == 0), (-1, False)]:\n", " fig.add_trace(\n", " go.Scatter(\n", " x=win_chrom['POS_Mb'], y=sign * win_chrom[ci_col],\n", " mode='lines', name=name,\n", " line=dict(color=color, width=1.5, dash='dash'),\n", " showlegend=show_legend, legendgroup=f'ci_{ci_col}'\n", " ), row=row, col=col\n", " )\n", "\n", " for y_val, style in [(0, dict(color=\"black\", width=2)),\n", " (0.5, dict(color=\"gray\", width=1, dash=\"dot\")),\n", " (-0.5, dict(color=\"gray\", width=1, dash=\"dot\"))]:\n", " fig.add_hline(y=y_val, line=style, row=row, col=col)\n", "\n", "fig.update_layout(\n", " height=max(300 * nrows, 600), width=1200,\n", " title_text=\"QTL-seq Analysis: Δ(SNP-index) Manhattan Plot\",\n", " showlegend=True,\n", " legend=dict(orientation=\"v\", yanchor=\"top\", y=0.98, xanchor=\"left\", x=1.02),\n", " template=\"plotly_white\"\n", ")\n", "\n", "fig.update_xaxes(title_text=\"Position (Mb)\", tickformat=\".3f\")\n", "fig.update_yaxes(title_text=\"Δ(SNP-index)\", range=[-1.1, 1.1])\n", "\n", "fig.show()\n", "\n", "print(\"\\n=== Preparing Downloads ===\")\n", "print(f\"colab_files type: {type(colab_files)}\")\n", "\n", "# Save individual files\n", "plot_filename = f\"qtlseq_manhattan_plot_{timestamp}.html\"\n", "fig.write_html(plot_filename)\n", "print(f\"✓ Saved: {plot_filename}\")\n", "\n", "snp_filename = f\"qtlseq_snp_data_{timestamp}.csv\"\n", "snp_df.to_csv(snp_filename, index=False)\n", "print(f\"✓ Saved: {snp_filename}\")\n", "\n", "window_filename = f\"qtlseq_window_data_{timestamp}.csv\"\n", "window_df.to_csv(window_filename, index=False)\n", "print(f\"✓ Saved: {window_filename}\")\n", "\n", "summary_filename = f\"qtlseq_analysis_summary_{timestamp}.txt\"\n", "with open(summary_filename, 'w') as f:\n", " f.write(\"QTL-seq Analysis Summary\\n\")\n", " f.write(\"=\" * 50 + \"\\n\\n\")\n", " f.write(f\"Analysis completed: {datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')}\\n\")\n", " f.write(f\"Total SNPs analyzed: {len(snp_df)}\\n\")\n", " f.write(f\"Total windows: {len(window_df)}\\n\")\n", " f.write(f\"Chromosomes: {', '.join(map(str, chroms))}\\n\")\n", " f.write(f\"Reference length: {ref_length} bases\\n\\n\")\n", "\n", " f.write(\"Parameters Used:\\n\")\n", " f.write(f\" Sample sizes: N1={N1}, N2={N2}\\n\")\n", " f.write(f\" Window size: {WINDOW_SIZE}\\n\")\n", " f.write(f\" Step size: {STEP_SIZE}\\n\")\n", " f.write(f\" Minimum depth filter: {MIN_TOTAL_DEPTH}\\n\")\n", " f.write(f\" Reference allele frequency filter: {REF_ALLELE_FREQ}\\n\\n\")\n", "\n", " f.write(\"Chromosome Statistics:\\n\")\n", " for chrom in chroms:\n", " chrom_windows = window_df[window_df['CHROM'] == chrom]\n", " if len(chrom_windows) > 0:\n", " if smooth_col and smooth_col in chrom_windows.columns:\n", " max_delta = chrom_windows[smooth_col].max()\n", " min_delta = chrom_windows[smooth_col].min()\n", " abs_max = max(abs(max_delta), abs(min_delta))\n", " f.write(f\" Chromosome {chrom}:\\n\")\n", " f.write(f\" Δ(SNP-index) range: [{min_delta:.3f}, {max_delta:.3f}]\\n\")\n", " f.write(f\" Maximum absolute value: {abs_max:.3f}\\n\")\n", " f.write(f\" Number of windows: {len(chrom_windows)}\\n\")\n", "\n", " f.write(f\"\\nInterpretation Guide:\\n\")\n", " f.write(f\"• Positive Δ(SNP-index) values indicate QTL regions favoring bulk 1 phenotype\\n\")\n", " f.write(f\"• Negative Δ(SNP-index) values indicate QTL regions favoring bulk 2 phenotype\\n\")\n", " f.write(f\"• Look for regions where smoothed values exceed confidence intervals\\n\")\n", " f.write(f\"• Higher absolute values indicate stronger QTL effects\\n\")\n", " f.write(f\"• Focus on regions with |Δ(SNP-index)| > 0.3 for potential QTL\\n\")\n", "print(f\"✓ Saved: {summary_filename}\")\n", "\n", "combined_filename = f\"qtlseq_combined_results_{timestamp}.csv\"\n", "combined_results = window_df.copy()\n", "combined_results['Analysis_Type'] = 'Sliding_Window'\n", "\n", "if 'deltaSNP' in snp_df.columns:\n", " snp_df_sorted = snp_df.copy()\n", " snp_df_sorted['abs_delta'] = abs(snp_df_sorted['deltaSNP'])\n", " top_snps = snp_df_sorted.nlargest(min(1000, len(snp_df_sorted)), 'abs_delta')\n", " top_snps['Analysis_Type'] = 'Individual_SNP'\n", " top_snps = top_snps.drop('abs_delta', axis=1)\n", "\n", " common_cols = ['CHROM', 'POS', 'POS_Mb', 'Analysis_Type']\n", " snp_cols_to_add = [col for col in top_snps.columns if col not in common_cols]\n", " window_cols_to_add = [col for col in combined_results.columns if col not in common_cols]\n", "\n", " for col in window_cols_to_add:\n", " if col not in top_snps.columns:\n", " top_snps[col] = np.nan\n", "\n", " for col in snp_cols_to_add:\n", " if col not in combined_results.columns:\n", " combined_results[col] = np.nan\n", "\n", " combined_results = pd.concat([combined_results, top_snps], ignore_index=True, sort=False)\n", "\n", "combined_results.to_csv(combined_filename, index=False)\n", "print(f\"✓ Saved: {combined_filename}\")\n", "\n", "# Zip all files\n", "zip_filename = f\"qtlseq_results_{timestamp}.zip\"\n", "output_files = [plot_filename, snp_filename, window_filename, summary_filename, combined_filename]\n", "print(f\"\\nCreating zip archive: {zip_filename}\")\n", "with zipfile.ZipFile(zip_filename, 'w', zipfile.ZIP_DEFLATED) as zipf:\n", " for file in output_files:\n", " if os.path.exists(file):\n", " zipf.write(file, os.path.basename(file))\n", " print(f\"✓ Added to zip: {file}\")\n", " else:\n", " print(f\"Warning: File not found for zipping: {file}\")\n", "\n", "# Download zip file\n", "def download_file(filename):\n", " try:\n", " colab_files.download(filename)\n", " print(f\"✓ Downloaded: {filename}\")\n", " except Exception as e:\n", " print(f\"✗ Failed to download {filename}: {e}\")\n", " print(f\"File saved locally at {filename}. Please download manually from Colab file browser.\")\n", "\n", "download_file(zip_filename)\n", "\n", "print(\"\\n\" + \"=\" * 60)\n", "print(\"🎉 QTL-seq Analysis COMPLETED Successfully! 🎉\")\n", "print(\"=\" * 60)\n", "print(\"\\nFiles included in zip archive:\")\n", "print(f\"📊 {plot_filename} - Interactive Manhattan plot (HTML)\")\n", "print(f\"📈 {snp_filename} - Individual SNP results (CSV)\")\n", "print(f\"📈 {window_filename} - Sliding window analysis (CSV)\")\n", "print(f\"📋 {summary_filename} - Statistical overview (TXT)\")\n", "print(f\"📊 {combined_filename} - All data in one file (CSV)\")\n", "print(\"\\n🔍 INTERPRETATION GUIDE:\")\n", "print(\"• RED LINE: Smoothed Δ(SNP-index) values\")\n", "print(\"• DASHED LINES: Confidence intervals (95% and 99%)\")\n", "print(\"• POSITIVE PEAKS: QTL regions favoring bulk 1 phenotype\")\n", "print(\"• NEGATIVE PEAKS: QTL regions favoring bulk 2 phenotype\")\n", "print(\"• SIGNIFICANT REGIONS: Where red line exceeds confidence intervals\")\n", "print(\"• FOCUS ON: |Δ(SNP-index)| > 0.3 for potential QTL candidates\")\n", "print(\"\\n✅ Analysis completed - All files saved in zip archive and downloaded!\")" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 1000 }, "id": "mM41RdmdgGbJ", "outputId": "94adda9e-3491-4918-b2c1-50b5299b61c8" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Checking input files:\n", "✓ Found: /content/decompressed/qtlseq_ref.fasta\n", "✓ Found: /content/decompressed/parent.sorted.bam\n", "✓ Found: /content/decompressed/bulk1.sorted.bam\n", "✓ Found: /content/decompressed/bulk2.sorted.bam\n", "Validating BAM: /content/decompressed/parent.sorted.bam\n", "Validating BAM: /content/decompressed/bulk1.sorted.bam\n", "Validating BAM: /content/decompressed/bulk2.sorted.bam\n", "Checking reference sequence length...\n", "Reference sequence total length: 2000001 bases\n", "Adjusted parameters: window_size=40000, step_size=4000\n", "Parameters: N1=20, N2=20, REF_ALLELE_FREQ=0.1, MIN_TOTAL_DEPTH=50\n", "Cleaning environment...\n", "^C\n", "Creating working directory: /tmp/qtl_analysis_20250918_062707_14101\n", "\n", "=== Strategy 1: QTL-seq with different parameters ===\n", "\n", "Trying variation 1: /usr/local/bin/conda run -n qtlseq qtlseq -r /content/decompressed/qtlseq_ref.fasta -p /content/decompressed/parent.sorted.bam -b1 /content/decompressed/bulk1.sorted.bam -b2 /content/decompressed/bulk2.sorted.bam -n1 20 -n2 20 -o /tmp/qtl_analysis_20250918_062707_14101 -t 2 --force\n", "✗ Failed: usage: qtlseq -r -p -b1 \n", " -b2 -n1 -n2 -o \n", " [-F ] [-T] [-e ]\n", "qtlseq: error: unrecognized argumen...\n", "\n", "Trying variation 2: /usr/local/bin/conda run -n qtlseq qtlseq -r /content/decompressed/qtlseq_ref.fasta -p /content/decompressed/parent.sorted.bam -b1 /content/decompressed/bulk1.sorted.bam -b2 /content/decompressed/bulk2.sorted.bam -n1 20 -n2 20 -o /tmp/qtl_analysis_20250918_062707_14101 -t 2 --overwrite\n", "✗ Failed: usage: qtlseq -r -p -b1 \n", " -b2 -n1 -n2 -o \n", " [-F ] [-T] [-e ]\n", "qtlseq: error: unrecognized argumen...\n", "\n", "Trying variation 3: /usr/local/bin/conda run -n qtlseq qtlseq -r /content/decompressed/qtlseq_ref.fasta -p /content/decompressed/parent.sorted.bam -b1 /content/decompressed/bulk1.sorted.bam -b2 /content/decompressed/bulk2.sorted.bam -n1 20 -n2 20 -t 2\n", "✗ Failed: usage: qtlseq -r -p -b1 \n", " -b2 -n1 -n2 -o \n", " [-F ] [-T] [-e ]\n", "qtlseq: error: the following argume...\n", "\n", "=== Strategy 2: Manual BSA-seq analysis ===\n", "Running manual Bulk Segregant Analysis...\n", "Step 1: Generating mpileup...\n", "✓ Mpileup completed: /tmp/manual_bsa_20250918_062707_14101/all_samples.mpileup\n", "Step 2: Parsing mpileup and calculating SNP indices...\n", "Processed 0 lines...\n", "Processed 10000 lines...\n", "Processed 20000 lines...\n", "Processed 30000 lines...\n", "Processed 40000 lines...\n", "Processed 50000 lines...\n", "Processed 60000 lines...\n", "Processed 70000 lines...\n", "Processed 80000 lines...\n", "Processed 90000 lines...\n", "Processed 100000 lines...\n", "Processed 110000 lines...\n", "Processed 120000 lines...\n", "Processed 130000 lines...\n", "Processed 140000 lines...\n", "Processed 150000 lines...\n", "Processed 160000 lines...\n", "Processed 170000 lines...\n", "Processed 180000 lines...\n", "Processed 190000 lines...\n", "Processed 200000 lines...\n", "Processed 210000 lines...\n", "Processed 220000 lines...\n", "Processed 230000 lines...\n", "Processed 240000 lines...\n", "Processed 250000 lines...\n", "Processed 260000 lines...\n", "Processed 270000 lines...\n", "Processed 280000 lines...\n", "Processed 290000 lines...\n", "Processed 300000 lines...\n", "Processed 310000 lines...\n", "Processed 320000 lines...\n", "Processed 330000 lines...\n", "Processed 340000 lines...\n", "Processed 350000 lines...\n", "Processed 360000 lines...\n", "Processed 370000 lines...\n", "Processed 380000 lines...\n", "Processed 390000 lines...\n", "Processed 400000 lines...\n", "Processed 410000 lines...\n", "Processed 420000 lines...\n", "Processed 430000 lines...\n", "Processed 440000 lines...\n", "Processed 450000 lines...\n", "Processed 460000 lines...\n", "Processed 470000 lines...\n", "Processed 480000 lines...\n", "Processed 490000 lines...\n", "Processed 500000 lines...\n", "Processed 510000 lines...\n", "Processed 520000 lines...\n", "Processed 530000 lines...\n", "Processed 540000 lines...\n", "Processed 550000 lines...\n", "Processed 560000 lines...\n", "Processed 570000 lines...\n", "Processed 580000 lines...\n", "Processed 590000 lines...\n", "Processed 600000 lines...\n", "Processed 610000 lines...\n", "Processed 620000 lines...\n", "Processed 630000 lines...\n", "Processed 640000 lines...\n", "Processed 650000 lines...\n", "Processed 660000 lines...\n", "Processed 670000 lines...\n", "Processed 680000 lines...\n", "Processed 690000 lines...\n", "Processed 700000 lines...\n", "Processed 710000 lines...\n", "Processed 720000 lines...\n", "Processed 730000 lines...\n", "Processed 740000 lines...\n", "Processed 750000 lines...\n", "Processed 760000 lines...\n", "Processed 770000 lines...\n", "Processed 780000 lines...\n", "Processed 790000 lines...\n", "Processed 800000 lines...\n", "Processed 810000 lines...\n", "Processed 820000 lines...\n", "Processed 830000 lines...\n", "Processed 840000 lines...\n", "Processed 850000 lines...\n", "Processed 860000 lines...\n", "Processed 870000 lines...\n", "Processed 880000 lines...\n", "Processed 890000 lines...\n", "Processed 900000 lines...\n", "Processed 910000 lines...\n", "Processed 920000 lines...\n", "Processed 930000 lines...\n", "Processed 940000 lines...\n", "Processed 950000 lines...\n", "Processed 960000 lines...\n", "Processed 970000 lines...\n", "Processed 980000 lines...\n", "Processed 990000 lines...\n", "Processed 1000000 lines...\n", "Processed 1010000 lines...\n", "Processed 1020000 lines...\n", "Processed 1030000 lines...\n", "Processed 1040000 lines...\n", "Processed 1050000 lines...\n", "Processed 1060000 lines...\n", "Processed 1070000 lines...\n", "Processed 1080000 lines...\n", "Processed 1090000 lines...\n", "Processed 1100000 lines...\n", "Processed 1110000 lines...\n", "Processed 1120000 lines...\n", "Processed 1130000 lines...\n", "Processed 1140000 lines...\n", "Processed 1150000 lines...\n", "Processed 1160000 lines...\n", "Processed 1170000 lines...\n", "Processed 1180000 lines...\n", "Processed 1190000 lines...\n", "Processed 1200000 lines...\n", "Processed 1210000 lines...\n", "Processed 1220000 lines...\n", "Processed 1230000 lines...\n", "Processed 1240000 lines...\n", "Processed 1250000 lines...\n", "Processed 1260000 lines...\n", "Processed 1270000 lines...\n", "Processed 1280000 lines...\n", "Processed 1290000 lines...\n", "Processed 1300000 lines...\n", "Processed 1310000 lines...\n", "Processed 1320000 lines...\n", "Processed 1330000 lines...\n", "Processed 1340000 lines...\n", "Processed 1350000 lines...\n", "Processed 1360000 lines...\n", "Processed 1370000 lines...\n", "Processed 1380000 lines...\n", "Processed 1390000 lines...\n", "Processed 1400000 lines...\n", "Processed 1410000 lines...\n", "Processed 1420000 lines...\n", "Processed 1430000 lines...\n", "Processed 1440000 lines...\n", "Processed 1450000 lines...\n", "Processed 1460000 lines...\n", "Processed 1470000 lines...\n", "Processed 1480000 lines...\n", "Processed 1490000 lines...\n", "Processed 1500000 lines...\n", "Processed 1510000 lines...\n", "Processed 1520000 lines...\n", "Processed 1530000 lines...\n", "Processed 1540000 lines...\n", "Processed 1550000 lines...\n", "Processed 1560000 lines...\n", "Processed 1570000 lines...\n", "Processed 1580000 lines...\n", "Processed 1590000 lines...\n", "Processed 1600000 lines...\n", "Processed 1610000 lines...\n", "Processed 1620000 lines...\n", "Processed 1630000 lines...\n", "Processed 1640000 lines...\n", "Processed 1650000 lines...\n", "Processed 1660000 lines...\n", "Processed 1670000 lines...\n", "Processed 1680000 lines...\n", "Processed 1690000 lines...\n", "Processed 1700000 lines...\n", "Processed 1710000 lines...\n", "Processed 1720000 lines...\n", "Processed 1730000 lines...\n", "Processed 1740000 lines...\n", "Processed 1750000 lines...\n", "Processed 1760000 lines...\n", "Processed 1770000 lines...\n", "Processed 1780000 lines...\n", "Processed 1790000 lines...\n", "Processed 1800000 lines...\n", "Processed 1810000 lines...\n", "Processed 1820000 lines...\n", "Processed 1830000 lines...\n", "Processed 1840000 lines...\n", "Processed 1850000 lines...\n", "Processed 1860000 lines...\n", "Processed 1870000 lines...\n", "✓ Parsed 1059 high-quality SNPs\n", "Step 3: Performing sliding window analysis...\n", "✓ Created 1 sliding windows\n", "✓ Manual BSA analysis completed successfully!\n", "\n", "=== Results Processing ===\n", "Working directory: /tmp/manual_bsa_20250918_062707_14101\n", "Found output files: ['window_data.csv', 'snp_data.csv']\n", "✓ Loaded window data from window_data.csv: (1, 10)\n", "✓ Loaded SNP data from snp_data.csv: (1059, 11)\n", "Warning: Multiple position-related columns found in window: ['START', 'WINDOW_CENTER']\n", "Kept WINDOW_CENTER as POS, dropped: ['START']\n", "Standardizing column names...\n", "SNP columns after standardization: ['CHROM', 'POS', 'REF', 'PARENT_DEPTH', 'PARENT_REF_FREQ', 'BULK1_DEPTH', 'BULK1_SNP_INDEX', 'BULK2_DEPTH', 'BULK2_SNP_INDEX', 'deltaSNP', 'TOTAL_DEPTH']\n", "WINDOW columns after standardization: ['CHROM', 'END', 'N_SNPS', 'deltaSNP', 'tricubeDeltaSNP', 'CI_95', 'CI_99', 'STD', 'POS']\n", "\n", "=== Processing Positions ===\n", "SNP DataFrame columns before processing: ['CHROM', 'POS', 'REF', 'PARENT_DEPTH', 'PARENT_REF_FREQ', 'BULK1_DEPTH', 'BULK1_SNP_INDEX', 'BULK2_DEPTH', 'BULK2_SNP_INDEX', 'deltaSNP', 'TOTAL_DEPTH']\n", "✓ Created POS_Mb column for SNP data\n", "Window DataFrame columns before processing: ['CHROM', 'END', 'N_SNPS', 'deltaSNP', 'tricubeDeltaSNP', 'CI_95', 'CI_99', 'STD', 'POS']\n", "Error: Invalid POS values (all NaN, zero, or identical) in Window\n", "Warning: Created dummy positions for Window\n", "✓ Created POS_Mb column for Window data\n", "\n", "=== Creating Visualization ===\n", "Found 1 chromosomes: ['test_chr']\n", "Chromosome test_chr: 1059 SNPs, 1 windows\n" ] }, { "output_type": "display_data", "data": { "text/html": [ "\n", "\n", "\n", "
\n", "
\n", "\n", "" ] }, "metadata": {} }, { "output_type": "stream", "name": "stdout", "text": [ "\n", "=== Preparing Downloads ===\n", "colab_files type: \n", "✓ Saved: qtlseq_manhattan_plot_20250918_062707.html\n", "✓ Saved: qtlseq_snp_data_20250918_062707.csv\n", "✓ Saved: qtlseq_window_data_20250918_062707.csv\n", "✓ Saved: qtlseq_analysis_summary_20250918_062707.txt\n", "✓ Saved: qtlseq_combined_results_20250918_062707.csv\n", "\n", "Creating zip archive: qtlseq_results_20250918_062707.zip\n", "✓ Added to zip: qtlseq_manhattan_plot_20250918_062707.html\n", "✓ Added to zip: qtlseq_snp_data_20250918_062707.csv\n", "✓ Added to zip: qtlseq_window_data_20250918_062707.csv\n", "✓ Added to zip: qtlseq_analysis_summary_20250918_062707.txt\n", "✓ Added to zip: qtlseq_combined_results_20250918_062707.csv\n" ] }, { "output_type": "display_data", "data": { "text/plain": [ "" ], "application/javascript": [ "\n", " async function download(id, filename, size) {\n", " if (!google.colab.kernel.accessAllowed) {\n", " return;\n", " }\n", " const div = document.createElement('div');\n", " const label = document.createElement('label');\n", " label.textContent = `Downloading \"${filename}\": `;\n", " div.appendChild(label);\n", " const progress = document.createElement('progress');\n", " progress.max = size;\n", " div.appendChild(progress);\n", " document.body.appendChild(div);\n", "\n", " const buffers = [];\n", " let downloaded = 0;\n", "\n", " const channel = await google.colab.kernel.comms.open(id);\n", " // Send a message to notify the kernel that we're ready.\n", " channel.send({})\n", "\n", " for await (const message of channel.messages) {\n", " // Send a message to notify the kernel that we're ready.\n", " channel.send({})\n", " if (message.buffers) {\n", " for (const buffer of message.buffers) {\n", " buffers.push(buffer);\n", " downloaded += buffer.byteLength;\n", " progress.value = downloaded;\n", " }\n", " }\n", " }\n", " const blob = new Blob(buffers, {type: 'application/binary'});\n", " const a = document.createElement('a');\n", " a.href = window.URL.createObjectURL(blob);\n", " a.download = filename;\n", " div.appendChild(a);\n", " a.click();\n", " div.remove();\n", " }\n", " " ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "" ], "application/javascript": [ "download(\"download_93d819f2-1ece-4483-a467-0846be20d7c9\", \"qtlseq_results_20250918_062707.zip\", 1372173)" ] }, "metadata": {} }, { "output_type": "stream", "name": "stdout", "text": [ "✓ Downloaded: qtlseq_results_20250918_062707.zip\n", "\n", "============================================================\n", "🎉 QTL-seq Analysis COMPLETED Successfully! 🎉\n", "============================================================\n", "\n", "Files included in zip archive:\n", "📊 qtlseq_manhattan_plot_20250918_062707.html - Interactive Manhattan plot (HTML)\n", "📈 qtlseq_snp_data_20250918_062707.csv - Individual SNP results (CSV)\n", "📈 qtlseq_window_data_20250918_062707.csv - Sliding window analysis (CSV)\n", "📋 qtlseq_analysis_summary_20250918_062707.txt - Statistical overview (TXT)\n", "📊 qtlseq_combined_results_20250918_062707.csv - All data in one file (CSV)\n", "\n", "🔍 INTERPRETATION GUIDE:\n", "• RED LINE: Smoothed Δ(SNP-index) values\n", "• DASHED LINES: Confidence intervals (95% and 99%)\n", "• POSITIVE PEAKS: QTL regions favoring bulk 1 phenotype\n", "• NEGATIVE PEAKS: QTL regions favoring bulk 2 phenotype\n", "• SIGNIFICANT REGIONS: Where red line exceeds confidence intervals\n", "• FOCUS ON: |Δ(SNP-index)| > 0.3 for potential QTL candidates\n", "\n", "✅ Analysis completed - All files saved in zip archive and downloaded!\n" ] } ] } ], "metadata": { "colab": { "provenance": [] }, "kernelspec": { "display_name": "Python 3", "name": "python3" }, "language_info": { "name": "python" } }, "nbformat": 4, "nbformat_minor": 0 }