## RNA seq analysis: PAX8 knocked-outIn this notebook, we performed the analysis of RNA seq data on two different cell lines of ovarian cancer SKOV-3: wild-type and PAX8 knocked-out.The dataset were retrieved from https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE79572In this notebook, we performed the analysis of RNA seq data on two different cell lines of ovarian cancer SKOV-3: wild-type and PAX8 knocked-out. The dataset were retrieved from https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE79572
We first created a work directory.We first created a work directory.
pwdcd ~/data/workpwdIn the next step, we download and convert the files into .fastq. Since we have paired-end data, the command --split-files created two files, one for each read.We download WT sample 1 (SRR3289897) and sample 2 (SRR3289899), and KO sample 1 (SRR3289898) and sample 2 (SRR3289900).In the next step, we download and convert the files into .fastq. Since we have paired-end data, the command --split-files created two files, one for each read. We download WT sample 1 (SRR3289897) and sample 2 (SRR3289899), and KO sample 1 (SRR3289898) and sample 2 (SRR3289900).
fastq-dump --split-files SRR3289897fastq-dump --split-files SRR3289898fastq-dump --split-files SRR3289899fastq-dump --split-files SRR3289900Now we rename the files.Now we rename the files.
mv SRR3289897_1.fastq WT_1.fastqmv SRR3289897_2.fastq WT_2.fastqmv SRR3289898_1.fastq KO_1.fastqmv SRR3289898_2.fastq KO_2.fastqmv SRR3289899_1.fastq WT2_1.fastqmv SRR3289899_2.fastq WT2_2.fastqmv SRR3289900_1.fastq KO2_1.fastqmv SRR3289900_2.fastq KO2_2.fastq## Quality controlNow we perform quality control on each sample using FASTQ tool. The program is located in /usr/local/bin/FastQC/Now we perform quality control on each sample using FASTQ tool. The program is located in /usr/local/bin/FastQC/
/usr/local/bin/FastQC/fastqc -o . WT_1.fastq/usr/local/bin/FastQC/fastqc -o . WT_2.fastq/usr/local/bin/FastQC/fastqc -o . KO_1.fastq/usr/local/bin/FastQC/fastqc -o . KO_2.fastq/usr/local/bin/FastQC/fastqc -o . WT2_1.fastq/usr/local/bin/FastQC/fastqc -o . WT2_2.fastq/usr/local/bin/FastQC/fastqc -o . KO2_1.fastq/usr/local/bin/FastQC/fastqc -o . KO2_2.fastqNow that we have obtained the fastQC reports, we proceeded with the analysis.The "per base sequence quality" section reveals an overall good quality for all the samples. The lower quartile of all the boxplots remains above 25, and above 30 for most of the bases). In WT_2, KO_2, WT2_2 and KO2_2, the quality decreases towards the end. However, we decided not to trim the sequences since it is only the lower whisker that notably decreases but the lower quartile remains above 30, and trimming can alter the subsequent gene expression estimation.The graphs represent the per base sequence quality. On the left, we observe the graph corresponding to WT_1. On the right, the one corresponding to WT_2; we can clearly observe how the mean quality remains good, even with the decrease in quality around read 55.In the section “Sequence duplication levels” (graphs not shown), we can observe that for all the samples, between 70% and 80% of the sequences are non-duplicated, which is an acceptable value.The percentage of sequences that are repeated (2 or more times) remains under 20% for all the samples.Now that we have obtained the fastQC reports, we proceeded with the analysis.
The "per base sequence quality" section reveals an overall good quality for all the samples. The lower quartile of all the boxplots remains above 25, and above 30 for most of the bases). In WT_2, KO_2, WT2_2 and KO2_2, the quality decreases towards the end. However, we decided not to trim the sequences since it is only the lower whisker that notably decreases but the lower quartile remains above 30, and trimming can alter the subsequent gene expression estimation.
The graphs represent the per base sequence quality. On the left, we observe the graph corresponding to WT_1. On the right, the one corresponding to WT_2; we can clearly observe how the mean quality remains good, even with the decrease in quality around read 55.
In the section “Sequence duplication levels” (graphs not shown), we can observe that for all the samples, between 70% and 80% of the sequences are non-duplicated, which is an acceptable value. The percentage of sequences that are repeated (2 or more times) remains under 20% for all the samples.
<img width="100%" src="https://jupyter.gbiomed.kuleuven.be/user/r0479539/files/Qualities.png">
## Mapping to the genomeNow we are going to map the fastq to the human genome by using STAR. We use a database with the human genome and gene notation. We find this at the given directory: /mnt/nfs/mfiers/STAR/hg19_star_db.In this step, we merge both reads, for each file, in one single .bam file.Now we are going to map the fastq to the human genome by using STAR. We use a database with the human genome and gene notation. We find this at the given directory: /mnt/nfs/mfiers/STAR/hg19_star_db. In this step, we merge both reads, for each file, in one single .bam file.
For WT_1.fastq and WT_2.fastqFor WT_1.fastq and WT_2.fastq
STAR --genomeDir /mnt/nfs/mfiers/STAR/hg19_star_db \ --genomeLoad LoadAndKeep \ --runThreadN 2 \ --readFilesIn WT_1.fastq WT_2.fastq \ --outFileNamePrefix WT.Now we want to obtain the corresponding SAM file, containing the assignment of all reads.Now we want to obtain the corresponding SAM file, containing the assignment of all reads.
samtools sort -o WT.bam WT.Aligned.out.samsamtools index WT.bamsamtools idxstats WT.bamBy running samtools flagstat, we can obseve that there are no overrepresented sequences found. This indicates towards the absence of contaminants present in the samples.**This is the case for all samples analysedBy running samtools flagstat, we can obseve that there are no overrepresented sequences found. This indicates towards the absence of contaminants present in the samples.*
*This is the case for all samples analysed
samtools flagstat WT.bamFor KO_1.fastq and KO_2.fastqFor KO_1.fastq and KO_2.fastq
STAR --genomeDir /mnt/nfs/mfiers/STAR/hg19_star_db \ --genomeLoad LoadAndKeep \ --runThreadN 2 \ --readFilesIn KO_1.fastq KO_2.fastq \ --outFileNamePrefix KO.samtools sort -o KO.bam KO.Aligned.out.samsamtools index KO.bamsamtools idxstats KO.bamsamtools flagstat KO.bamFor WT2_1.fastq and WT2_2.fastqFor WT2_1.fastq and WT2_2.fastq
STAR --genomeDir /mnt/nfs/mfiers/STAR/hg19_star_db \ --genomeLoad LoadAndKeep \ --runThreadN 2 \ --readFilesIn WT2_1.fastq WT2_2.fastq \ --outFileNamePrefix WT2.samtools sort -o WT2.bam WT2.Aligned.out.samsamtools index WT2.bamsamtools idxstats WT2.bamsamtools flagstat WT2.bamFor KO2_1 and KO2_2For KO2_1 and KO2_2
STAR --genomeDir /mnt/nfs/mfiers/STAR/hg19_star_db \ --genomeLoad LoadAndKeep \ --runThreadN 2 \ --readFilesIn KO2_1.fastq KO2_2.fastq \ --outFileNamePrefix KO2.samtools sort -o KO2.bam KO2.Aligned.out.samsamtools index KO2.bamsamtools idxstats KO2.bamsamtools flagstat KO2.bam## Reads to gene countsThe next step is to count the number of reads that mapped to each gene. We first create a symbolic link to the human annotation (/mnt/nfs/data/RNA-seq/gencode.v19.nopseudo.plus.sort.gtf), and then using FeatureCounts we perform the count.The next step is to count the number of reads that mapped to each gene. We first create a symbolic link to the human annotation (/mnt/nfs/data/RNA-seq/gencode.v19.nopseudo.plus.sort.gtf), and then using FeatureCounts we perform the count.
ln -sf /mnt/nfs/data/RNA-seq/gencode.v19.nopseudo.plus.sort.gtf ~/data/work/ls -l *gtffeatureCounts \ -Q 10 \ -g gene_name \ -a /mnt/nfs/data/RNA-seq/gencode.v19.nopseudo.plus.sort.gtf \ -o gene.counts \ WT.bam WT2.bam KO.bam KO2.bamhead -20 gene.counts.summary | column -txxxxxxxxxxNow we separate the columns on gene structure and the columns with the actual counts.Now we separete the columns on gene structure and the columns with the actual counts.
cut -f-6 gene.counts > all.genedata.tsvcut -f1,7- gene.counts | grep -v '^#' > all.gene.countsWe obtained a .count file, all.gene.counts, that after changing the extension to .tsv, we open in excel. We decided to change the order of the columns to KO KO2 WT WT2 so we would obtain the downregulated genes in KO. Next, we analyse the data using the DESeq package --> continue in "Addendum" notebookWe obtained a .count file, all.gene.counts, that after changing the extension to .tsv, we open in excel. We decided to change the order of the columns to KO KO2 WT WT2 so we would obtain the downregulated genes in KO. Next, we analyse the data using the DESeq package --> continue in "Addendum" notebook