{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Working with Loops\n", "Let's kick it up another notch we have lots of FASTQs, let's run our analysis on more than one!\n", "\n", "## Shell Variables\n", "Assign the variables in this notebook." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "source bioinf_intro_config.sh\n", "mkdir -p $TRIMMED $STAR_OUT" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "for FASTQ in 27_MA_P_S38_L002_R1 27_MA_P_S38_L001_R1\n", " do\n", " echo \"RUNNING FASTQ: ${FASTQ}\"\n", " done" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Now let's run both samples throught the pipeline:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "for FASTQ in 27_MA_P_S38_L002_R1 27_MA_P_S38_L001_R1\n", " do\n", " echo \"---------------- TRIMMING: $FASTQ ----------------\"\n", " fastq-mcf \\\n", " $MYINFO/neb_e7600_adapters.fasta \\\n", " $RAW_FASTQS/${FASTQ}_001.fastq.gz \\\n", " -q 20 -x 0.5 \\\n", " -o $TRIMMED/${FASTQ}_001.trim.fastq.gz\n", " \n", " echo \"---------------- MAPPING: $FASTQ ----------------\"\n", " STAR \\\n", " --runMode alignReads \\\n", " --twopassMode None \\\n", " --genomeDir $GENOME_DIR \\\n", " --readFilesIn $TRIMMED/${FASTQ}_001.trim.fastq.gz \\\n", " --readFilesCommand gunzip -c \\\n", " --outFileNamePrefix ${STAR_OUT}/${FASTQ}_ \\\n", " --quantMode GeneCounts \\\n", " --outSAMtype None\n", " done" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### And let's check the result" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ls ${STAR_OUT}" ] } ], "metadata": { "kernelspec": { "display_name": "Bash", "language": "bash", "name": "bash" }, "language_info": { "codemirror_mode": "shell", "file_extension": ".sh", "mimetype": "text/x-sh", "name": "bash" } }, "nbformat": 4, "nbformat_minor": 1 }