{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "source bioinf_intro_config.sh\n", "rm -rf $IGV_DIR $STAR_OUT\n", "mkdir -p $TRIMMED $STAR_OUT $IGV_DIR" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Run with shorter intron limit" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "IGV needs indices for the BAM files. The index allows it to quickly load reads from different parts of the genome." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "for FASTQ in $RAW_FASTQS/27_MA_P_S38_L00[1]_R1_001.fastq.gz\n", " do\n", " FASTQ_BASE=\"$(basename ${FASTQ} '_001.fastq.gz')\"\n", " echo \"---------------- TRIMMING: $FASTQ_BASE ----------------\"\n", " fastq-mcf \\\n", " $MYINFO/neb_e7600_adapters.fasta \\\n", " $RAW_FASTQS/${FASTQ_BASE}_001.fastq.gz \\\n", " -q 20 -x 0.5 \\\n", " -o $TRIMMED/${FASTQ_BASE}_001.trim.fastq.gz\n", " \n", " echo \"---------------- MAPPING: $FASTQ_BASE ----------------\"\n", " STAR \\\n", " --runMode alignReads \\\n", " --twopassMode None \\\n", " --genomeDir $GENOME_DIR \\\n", " --readFilesIn $TRIMMED/${FASTQ_BASE}_001.trim.fastq.gz \\\n", " --readFilesCommand gunzip -c \\\n", " --outFileNamePrefix ${STAR_OUT}/${FASTQ_BASE}_short_introns_ \\\n", " --quantMode GeneCounts \\\n", " --outSAMtype BAM SortedByCoordinate \\\n", " --alignIntronMax 5000 \\\n", " --outSJfilterIntronMaxVsReadN 500 1000 2000 \\\n", " \n", " echo \"---------------- INDEXING BAM: $FASTQ_BASE ----------------\"\n", " samtools index ${STAR_OUT}/${FASTQ_BASE}_short_introns_Aligned.sortedByCoord.out.bam\n", " done" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ls -ltr ${STAR_OUT}" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Link Directory" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ln -s ${STAR_OUT}/*.bam* $GTF $FASTA $IGV_DIR" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Tarring" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "tar --dereference \\\n", " --create \\\n", " --gzip \\\n", " --verbose \\\n", " --file $CUROUT/stuff_for_igv.tgz \\\n", " --directory $CUROUT \\\n", " $(basename $IGV_DIR)" ] } ], "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 }