{ "cells": [ { "cell_type": "code", "execution_count": 1, "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": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "---------------- TRIMMING: 21_2019_P_M1_S21_L001_R1 ----------------\n", "Command Line: /home/jovyan/work/scratch/bioinf_intro/myinfo/neb_e7600_adapters.fasta /data/hts_2019_data/hts2019_pilot_rawdata/21_2019_P_M1_S21_L001_R1_001.fastq.gz -q 20 -x 0.5 -o /home/jovyan/work/scratch/bioinf_intro/trimmed_fastqs/21_2019_P_M1_S21_L001_R1_001.trim.fastq.gz\n", "Scale used: 2.2\n", "Phred: 33\n", "Threshold used: 751 out of 300000\n", "Adapter Adapter (AGATCGGAAGAGCACACGTCTGAACTCCAGTCA): counted 2504 at the 'end' of '/data/hts_2019_data/hts2019_pilot_rawdata/21_2019_P_M1_S21_L001_R1_001.fastq.gz', clip set to 6\n", "Files: 1\n", "Total reads: 2479050\n", "Too short after clip: 1519\n", "Clipped 'end' reads: Count: 46013, Mean: 15.47, Sd: 8.24\n", "Trimmed 299018 reads by an average of 1.71 bases on quality < 20\n", "---------------- MAPPING: 21_2019_P_M1_S21_L001_R1 ----------------\n", "Jun 26 16:41:58 ..... started STAR run\n", "Jun 26 16:41:58 ..... loading genome\n", "Jun 26 16:42:02 ..... started mapping\n", "Jun 26 16:42:35 ..... started sorting BAM\n", "Jun 26 16:42:40 ..... finished successfully\n", "---------------- INDEXING BAM: 21_2019_P_M1_S21_L001_R1 ----------------\n", "---------------- TRIMMING: 21_2019_P_M1_S21_L002_R1 ----------------\n", "Command Line: /home/jovyan/work/scratch/bioinf_intro/myinfo/neb_e7600_adapters.fasta /data/hts_2019_data/hts2019_pilot_rawdata/21_2019_P_M1_S21_L002_R1_001.fastq.gz -q 20 -x 0.5 -o /home/jovyan/work/scratch/bioinf_intro/trimmed_fastqs/21_2019_P_M1_S21_L002_R1_001.trim.fastq.gz\n", "Scale used: 2.2\n", "Phred: 33\n", "Threshold used: 751 out of 300000\n", "Adapter Adapter (AGATCGGAAGAGCACACGTCTGAACTCCAGTCA): counted 2515 at the 'end' of '/data/hts_2019_data/hts2019_pilot_rawdata/21_2019_P_M1_S21_L002_R1_001.fastq.gz', clip set to 6\n", "Files: 1\n", "Total reads: 2437108\n", "Too short after clip: 1347\n", "Clipped 'end' reads: Count: 44977, Mean: 15.55, Sd: 8.27\n", "Trimmed 288960 reads by an average of 1.70 bases on quality < 20\n", "---------------- MAPPING: 21_2019_P_M1_S21_L002_R1 ----------------\n", "Jun 26 16:42:58 ..... started STAR run\n", "Jun 26 16:42:58 ..... loading genome\n", "Jun 26 16:42:58 ..... started mapping\n", "Jun 26 16:43:30 ..... started sorting BAM\n", "Jun 26 16:43:35 ..... finished successfully\n", "---------------- INDEXING BAM: 21_2019_P_M1_S21_L002_R1 ----------------\n" ] } ], "source": [ "for FASTQ in $RAW_FASTQS/21_2019_P_M1_S21_L00[1-2]_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", " --runThreadN 2\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": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "total 204980\n", "-rw-r--r-- 1 jovyan users 166944 Jun 26 16:42 21_2019_P_M1_S21_L001_R1_short_introns_ReadsPerGene.out.tab\n", "-rw-r--r-- 1 jovyan users 104774284 Jun 26 16:42 21_2019_P_M1_S21_L001_R1_short_introns_Aligned.sortedByCoord.out.bam\n", "-rw-r--r-- 1 jovyan users 918773 Jun 26 16:42 21_2019_P_M1_S21_L001_R1_short_introns_SJ.out.tab\n", "-rw-r--r-- 1 jovyan users 246 Jun 26 16:42 21_2019_P_M1_S21_L001_R1_short_introns_Log.progress.out\n", "-rw-r--r-- 1 jovyan users 18641 Jun 26 16:42 21_2019_P_M1_S21_L001_R1_short_introns_Log.out\n", "-rw-r--r-- 1 jovyan users 1849 Jun 26 16:42 21_2019_P_M1_S21_L001_R1_short_introns_Log.final.out\n", "-rw-r--r-- 1 jovyan users 32536 Jun 26 16:42 21_2019_P_M1_S21_L001_R1_short_introns_Aligned.sortedByCoord.out.bam.bai\n", "-rw-r--r-- 1 jovyan users 166808 Jun 26 16:43 21_2019_P_M1_S21_L002_R1_short_introns_ReadsPerGene.out.tab\n", "-rw-r--r-- 1 jovyan users 102828697 Jun 26 16:43 21_2019_P_M1_S21_L002_R1_short_introns_Aligned.sortedByCoord.out.bam\n", "-rw-r--r-- 1 jovyan users 913218 Jun 26 16:43 21_2019_P_M1_S21_L002_R1_short_introns_SJ.out.tab\n", "-rw-r--r-- 1 jovyan users 246 Jun 26 16:43 21_2019_P_M1_S21_L002_R1_short_introns_Log.progress.out\n", "-rw-r--r-- 1 jovyan users 18643 Jun 26 16:43 21_2019_P_M1_S21_L002_R1_short_introns_Log.out\n", "-rw-r--r-- 1 jovyan users 1849 Jun 26 16:43 21_2019_P_M1_S21_L002_R1_short_introns_Log.final.out\n", "-rw-r--r-- 1 jovyan users 32248 Jun 26 16:43 21_2019_P_M1_S21_L002_R1_short_introns_Aligned.sortedByCoord.out.bam.bai\n" ] } ], "source": [ "ls -ltr ${STAR_OUT}" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Link Directory" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "ln -s ${STAR_OUT}/*.bam* $GENOME_DIR/$GTF $GENOME_DIR/$FA $IGV_DIR" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Tarring" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "igv/\n", "igv/Cryptococcus_neoformans_var_grubii_h99.CNA3.39.gtf\n", "igv/21_2019_P_M1_S21_L002_R1_short_introns_Aligned.sortedByCoord.out.bam\n", "igv/21_2019_P_M1_S21_L001_R1_short_introns_Aligned.sortedByCoord.out.bam.bai\n", "igv/Cryptococcus_neoformans_var_grubii_h99.CNA3.dna.toplevel.fa\n", "igv/21_2019_P_M1_S21_L002_R1_short_introns_Aligned.sortedByCoord.out.bam.bai\n", "igv/21_2019_P_M1_S21_L001_R1_short_introns_Aligned.sortedByCoord.out.bam\n" ] } ], "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 }