## RNA seq analysis: PAX8 knocked-out
In 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

RNA seq analysis: PAX8 knocked-out

In 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.

In [1]:
 
pwd
/mnt/storage/r0479539/jupyternotebooks
In [2]:
 
cd ~/data/work
In [3]:
 
pwd
/home/luna.kuleuven.be/r0479539/data/work
 
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).

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).

In [4]:
 
fastq-dump --split-files SRR3289897
Read 21467787 spots for SRR3289897
Written 21467787 spots for SRR3289897
In [5]:
 
fastq-dump --split-files SRR3289898
Read 21652426 spots for SRR3289898
Written 21652426 spots for SRR3289898
In [79]:
 
fastq-dump --split-files SRR3289899
Read 17190531 spots for SRR3289899
Written 17190531 spots for SRR3289899
In [82]:
 
fastq-dump --split-files SRR3289900
Read 16905879 spots for SRR3289900
Written 16905879 spots for SRR3289900
 
Now we rename the files.

Now we rename the files.

In [ ]:
 
mv SRR3289897_1.fastq WT_1.fastq
In [10]:
 
mv SRR3289897_2.fastq WT_2.fastq
In [11]:
 
mv SRR3289898_1.fastq KO_1.fastq
In [12]:
 
mv SRR3289898_2.fastq KO_2.fastq
In [80]:
 
mv SRR3289899_1.fastq WT2_1.fastq
In [81]:
 
mv SRR3289899_2.fastq WT2_2.fastq
In [83]:
 
mv SRR3289900_1.fastq KO2_1.fastq
In [84]:
 
mv SRR3289900_2.fastq KO2_2.fastq
 
## Quality control
Now we perform quality control on each sample using FASTQ tool. The program is located in /usr/local/bin/FastQC/

Quality control

Now we perform quality control on each sample using FASTQ tool. The program is located in /usr/local/bin/FastQC/

In [14]:
 
/usr/local/bin/FastQC/fastqc -o . WT_1.fastq
Started analysis of WT_1.fastq
Approx 5% complete for WT_1.fastq
Approx 10% complete for WT_1.fastq
Approx 15% complete for WT_1.fastq
Approx 20% complete for WT_1.fastq
Approx 25% complete for WT_1.fastq
Approx 30% complete for WT_1.fastq
Approx 35% complete for WT_1.fastq
Approx 40% complete for WT_1.fastq
Approx 45% complete for WT_1.fastq
Approx 50% complete for WT_1.fastq
Approx 55% complete for WT_1.fastq
Approx 60% complete for WT_1.fastq
Approx 65% complete for WT_1.fastq
Approx 70% complete for WT_1.fastq
Approx 75% complete for WT_1.fastq
Approx 80% complete for WT_1.fastq
Approx 85% complete for WT_1.fastq
Approx 90% complete for WT_1.fastq
Approx 95% complete for WT_1.fastq
Analysis complete for WT_1.fastq
In [15]:
 
/usr/local/bin/FastQC/fastqc -o . WT_2.fastq
Started analysis of WT_2.fastq
Approx 5% complete for WT_2.fastq
Approx 10% complete for WT_2.fastq
Approx 15% complete for WT_2.fastq
Approx 20% complete for WT_2.fastq
Approx 25% complete for WT_2.fastq
Approx 30% complete for WT_2.fastq
Approx 35% complete for WT_2.fastq
Approx 40% complete for WT_2.fastq
Approx 45% complete for WT_2.fastq
Approx 50% complete for WT_2.fastq
Approx 55% complete for WT_2.fastq
Approx 60% complete for WT_2.fastq
Approx 65% complete for WT_2.fastq
Approx 70% complete for WT_2.fastq
Approx 75% complete for WT_2.fastq
Approx 80% complete for WT_2.fastq
Approx 85% complete for WT_2.fastq
Approx 90% complete for WT_2.fastq
Approx 95% complete for WT_2.fastq
Analysis complete for WT_2.fastq
In [16]:
 
/usr/local/bin/FastQC/fastqc -o . KO_1.fastq
Started analysis of KO_1.fastq
Approx 5% complete for KO_1.fastq
Approx 10% complete for KO_1.fastq
Approx 15% complete for KO_1.fastq
Approx 20% complete for KO_1.fastq
Approx 25% complete for KO_1.fastq
Approx 30% complete for KO_1.fastq
Approx 35% complete for KO_1.fastq
Approx 40% complete for KO_1.fastq
Approx 45% complete for KO_1.fastq
Approx 50% complete for KO_1.fastq
Approx 55% complete for KO_1.fastq
Approx 60% complete for KO_1.fastq
Approx 65% complete for KO_1.fastq
Approx 70% complete for KO_1.fastq
Approx 75% complete for KO_1.fastq
Approx 80% complete for KO_1.fastq
Approx 85% complete for KO_1.fastq
Approx 90% complete for KO_1.fastq
Approx 95% complete for KO_1.fastq
Analysis complete for KO_1.fastq
In [17]:
 
/usr/local/bin/FastQC/fastqc -o . KO_2.fastq
Started analysis of KO_2.fastq
Approx 5% complete for KO_2.fastq
Approx 10% complete for KO_2.fastq
Approx 15% complete for KO_2.fastq
Approx 20% complete for KO_2.fastq
Approx 25% complete for KO_2.fastq
Approx 30% complete for KO_2.fastq
Approx 35% complete for KO_2.fastq
Approx 40% complete for KO_2.fastq
Approx 45% complete for KO_2.fastq
Approx 50% complete for KO_2.fastq
Approx 55% complete for KO_2.fastq
Approx 60% complete for KO_2.fastq
Approx 65% complete for KO_2.fastq
Approx 70% complete for KO_2.fastq
Approx 75% complete for KO_2.fastq
Approx 80% complete for KO_2.fastq
Approx 85% complete for KO_2.fastq
Approx 90% complete for KO_2.fastq
Approx 95% complete for KO_2.fastq
Analysis complete for KO_2.fastq
In [104]:
 
/usr/local/bin/FastQC/fastqc -o . WT2_1.fastq
Started analysis of WT2_1.fastq
Approx 5% complete for WT2_1.fastq
Approx 10% complete for WT2_1.fastq
Approx 15% complete for WT2_1.fastq
Approx 20% complete for WT2_1.fastq
Approx 25% complete for WT2_1.fastq
Approx 30% complete for WT2_1.fastq
Approx 35% complete for WT2_1.fastq
Approx 40% complete for WT2_1.fastq
Approx 45% complete for WT2_1.fastq
Approx 50% complete for WT2_1.fastq
Approx 55% complete for WT2_1.fastq
Approx 60% complete for WT2_1.fastq
Approx 65% complete for WT2_1.fastq
Approx 70% complete for WT2_1.fastq
Approx 75% complete for WT2_1.fastq
Approx 80% complete for WT2_1.fastq
Approx 85% complete for WT2_1.fastq
Approx 90% complete for WT2_1.fastq
Approx 95% complete for WT2_1.fastq
Analysis complete for WT2_1.fastq
In [105]:
 
/usr/local/bin/FastQC/fastqc -o . WT2_2.fastq
Started analysis of WT2_2.fastq
Approx 5% complete for WT2_2.fastq
Approx 10% complete for WT2_2.fastq
Approx 15% complete for WT2_2.fastq
Approx 20% complete for WT2_2.fastq
Approx 25% complete for WT2_2.fastq
Approx 30% complete for WT2_2.fastq
Approx 35% complete for WT2_2.fastq
Approx 40% complete for WT2_2.fastq
Approx 45% complete for WT2_2.fastq
Approx 50% complete for WT2_2.fastq
Approx 55% complete for WT2_2.fastq
Approx 60% complete for WT2_2.fastq
Approx 65% complete for WT2_2.fastq
Approx 70% complete for WT2_2.fastq
Approx 75% complete for WT2_2.fastq
Approx 80% complete for WT2_2.fastq
Approx 85% complete for WT2_2.fastq
Approx 90% complete for WT2_2.fastq
Approx 95% complete for WT2_2.fastq
Analysis complete for WT2_2.fastq
In [106]:
 
/usr/local/bin/FastQC/fastqc -o . KO2_1.fastq
Started analysis of KO2_1.fastq
Approx 5% complete for KO2_1.fastq
Approx 10% complete for KO2_1.fastq
Approx 15% complete for KO2_1.fastq
Approx 20% complete for KO2_1.fastq
Approx 25% complete for KO2_1.fastq
Approx 30% complete for KO2_1.fastq
Approx 35% complete for KO2_1.fastq
Approx 40% complete for KO2_1.fastq
Approx 45% complete for KO2_1.fastq
Approx 50% complete for KO2_1.fastq
Approx 55% complete for KO2_1.fastq
Approx 60% complete for KO2_1.fastq
Approx 65% complete for KO2_1.fastq
Approx 70% complete for KO2_1.fastq
Approx 75% complete for KO2_1.fastq
Approx 80% complete for KO2_1.fastq
Approx 85% complete for KO2_1.fastq
Approx 90% complete for KO2_1.fastq
Approx 95% complete for KO2_1.fastq
Analysis complete for KO2_1.fastq
In [107]:
 
/usr/local/bin/FastQC/fastqc -o . KO2_2.fastq
Started analysis of KO2_2.fastq
Approx 5% complete for KO2_2.fastq
Approx 10% complete for KO2_2.fastq
Approx 15% complete for KO2_2.fastq
Approx 20% complete for KO2_2.fastq
Approx 25% complete for KO2_2.fastq
Approx 30% complete for KO2_2.fastq
Approx 35% complete for KO2_2.fastq
Approx 40% complete for KO2_2.fastq
Approx 45% complete for KO2_2.fastq
Approx 50% complete for KO2_2.fastq
Approx 55% complete for KO2_2.fastq
Approx 60% complete for KO2_2.fastq
Approx 65% complete for KO2_2.fastq
Approx 70% complete for KO2_2.fastq
Approx 75% complete for KO2_2.fastq
Approx 80% complete for KO2_2.fastq
Approx 85% complete for KO2_2.fastq
Approx 90% complete for KO2_2.fastq
Approx 95% complete for KO2_2.fastq
Analysis complete for KO2_2.fastq
 
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.
​

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 genome
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.

Mapping to the genome

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.fastq

For WT_1.fastq and WT_2.fastq

In [64]:
 
STAR --genomeDir /mnt/nfs/mfiers/STAR/hg19_star_db \
     --genomeLoad LoadAndKeep \
     --runThreadN 2 \
     --readFilesIn WT_1.fastq WT_2.fastq \
     --outFileNamePrefix WT.
Jan 23 22:53:59 ..... started STAR run
Jan 23 22:53:59 ..... loading genome
Jan 23 22:54:00 ..... started mapping
Jan 23 23:15:02 ..... finished successfully
 
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.

In [66]:
 
samtools sort -o WT.bam WT.Aligned.out.sam
[bam_sort_core] merging from 18 files...
In [67]:
 
samtools index WT.bam
In [68]:
 
samtools idxstats WT.bam
chrM	16571	91902	0
chr1	249250621	4188162	0
chr2	243199373	3050846	0
chr3	198022430	2287800	0
chr4	191154276	1311468	0
chr5	180915260	1981622	0
chr6	171115067	3344588	0
chr7	159138663	1155330	0
chr8	146364022	1380746	0
chr9	141213431	1957054	0
chr10	135534747	1707136	0
chr11	135006516	2620586	0
chr12	133851895	2902460	0
chr13	115169878	678050	0
chr14	107349540	2548164	0
chr15	102531392	1287498	0
chr16	90354753	1601168	0
chr17	81195210	2833798	0
chr18	78077248	663360	0
chr19	59128983	1962308	0
chr20	63025520	1031006	0
chr21	48129895	377542	0
chr22	51304566	751676	0
chrX	155270560	1311908	0
chrY	59373566	54622	0
*	0	0	0
 
By 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

By 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

In [69]:
 
samtools flagstat WT.bam
43080800 + 0 in total (QC-passed reads + QC-failed reads)
1897112 + 0 secondary
0 + 0 supplementary
0 + 0 duplicates
43080800 + 0 mapped (100.00% : N/A)
41183688 + 0 paired in sequencing
20591844 + 0 read1
20591844 + 0 read2
41183688 + 0 properly paired (100.00% : N/A)
41183688 + 0 with itself and mate mapped
0 + 0 singletons (0.00% : N/A)
0 + 0 with mate mapped to a different chr
0 + 0 with mate mapped to a different chr (mapQ>=5)
 
For KO_1.fastq and KO_2.fastq

For KO_1.fastq and KO_2.fastq

In [70]:
 
STAR --genomeDir /mnt/nfs/mfiers/STAR/hg19_star_db \
     --genomeLoad LoadAndKeep \
     --runThreadN 2 \
     --readFilesIn KO_1.fastq KO_2.fastq  \
     --outFileNamePrefix KO.
Jan 23 23:36:34 ..... started STAR run
Jan 23 23:36:34 ..... loading genome
Jan 23 23:36:34 ..... started mapping
Jan 23 23:54:07 ..... finished successfully
In [71]:
 
samtools sort -o KO.bam KO.Aligned.out.sam
[bam_sort_core] merging from 18 files...
In [72]:
 
samtools index KO.bam
In [73]:
 
samtools idxstats KO.bam
chrM	16571	88204	0
chr1	249250621	4306144	0
chr2	243199373	3097732	0
chr3	198022430	2358608	0
chr4	191154276	1356408	0
chr5	180915260	2032494	0
chr6	171115067	3300178	0
chr7	159138663	1180846	0
chr8	146364022	1406674	0
chr9	141213431	1977604	0
chr10	135534747	1702624	0
chr11	135006516	2606550	0
chr12	133851895	2957904	0
chr13	115169878	692926	0
chr14	107349540	2447768	0
chr15	102531392	1209104	0
chr16	90354753	1627480	0
chr17	81195210	2834016	0
chr18	78077248	680788	0
chr19	59128983	1992794	0
chr20	63025520	1057236	0
chr21	48129895	413934	0
chr22	51304566	769168	0
chrX	155270560	1336308	0
chrY	59373566	58080	0
*	0	0	0
In [74]:
 
samtools flagstat KO.bam
43491572 + 0 in total (QC-passed reads + QC-failed reads)
1874906 + 0 secondary
0 + 0 supplementary
0 + 0 duplicates
43491572 + 0 mapped (100.00% : N/A)
41616666 + 0 paired in sequencing
20808333 + 0 read1
20808333 + 0 read2
41616666 + 0 properly paired (100.00% : N/A)
41616666 + 0 with itself and mate mapped
0 + 0 singletons (0.00% : N/A)
0 + 0 with mate mapped to a different chr
0 + 0 with mate mapped to a different chr (mapQ>=5)
 
For WT2_1.fastq and WT2_2.fastq

For WT2_1.fastq and WT2_2.fastq

In [86]:
 
STAR --genomeDir /mnt/nfs/mfiers/STAR/hg19_star_db \
     --genomeLoad LoadAndKeep \
     --runThreadN 2 \
     --readFilesIn WT2_1.fastq WT2_2.fastq  \
     --outFileNamePrefix WT2.
Jan 24 15:17:46 ..... started STAR run
Jan 24 15:17:46 ..... loading genome
Jan 24 15:17:46 ..... started mapping
Jan 24 15:31:19 ..... finished successfully
In [87]:
 
samtools sort -o WT2.bam WT2.Aligned.out.sam
[bam_sort_core] merging from 15 files...
In [88]:
 
samtools index WT2.bam
In [89]:
 
samtools idxstats WT2.bam
chrM	16571	33156	0
chr1	249250621	3216138	0
chr2	243199373	2373952	0
chr3	198022430	1880330	0
chr4	191154276	1027984	0
chr5	180915260	1539602	0
chr6	171115067	2555846	0
chr7	159138663	892366	0
chr8	146364022	1083186	0
chr9	141213431	1693926	0
chr10	135534747	1317230	0
chr11	135006516	2088418	0
chr12	133851895	2240684	0
chr13	115169878	536484	0
chr14	107349540	3793976	0
chr15	102531392	1002292	0
chr16	90354753	1225134	0
chr17	81195210	2154664	0
chr18	78077248	525426	0
chr19	59128983	1468690	0
chr20	63025520	782056	0
chr21	48129895	298286	0
chr22	51304566	564404	0
chrX	155270560	1007088	0
chrY	59373566	33088	0
*	0	0	0
In [90]:
 
samtools flagstat WT2.bam
35334406 + 0 in total (QC-passed reads + QC-failed reads)
2171704 + 0 secondary
0 + 0 supplementary
0 + 0 duplicates
35334406 + 0 mapped (100.00% : N/A)
33162702 + 0 paired in sequencing
16581351 + 0 read1
16581351 + 0 read2
33162702 + 0 properly paired (100.00% : N/A)
33162702 + 0 with itself and mate mapped
0 + 0 singletons (0.00% : N/A)
0 + 0 with mate mapped to a different chr
0 + 0 with mate mapped to a different chr (mapQ>=5)
 
For KO2_1 and KO2_2

For KO2_1 and KO2_2

In [91]:
 
STAR --genomeDir /mnt/nfs/mfiers/STAR/hg19_star_db \
     --genomeLoad LoadAndKeep \
     --runThreadN 2 \
     --readFilesIn KO2_1.fastq KO2_2.fastq  \
     --outFileNamePrefix KO2.
Jan 24 15:50:10 ..... started STAR run
Jan 24 15:50:10 ..... loading genome
Jan 24 15:50:10 ..... started mapping
Jan 24 16:04:20 ..... finished successfully
In [92]:
 
samtools sort -o KO2.bam KO2.Aligned.out.sam
[bam_sort_core] merging from 15 files...
In [93]:
 
samtools index KO2.bam
In [94]:
 
samtools idxstats KO2.bam
chrM	16571	44730	0
chr1	249250621	3235438	0
chr2	243199373	2296846	0
chr3	198022430	1872262	0
chr4	191154276	975228	0
chr5	180915260	1494340	0
chr6	171115067	2544808	0
chr7	159138663	869390	0
chr8	146364022	1028966	0
chr9	141213431	1675702	0
chr10	135534747	1279498	0
chr11	135006516	1975858	0
chr12	133851895	2307206	0
chr13	115169878	496756	0
chr14	107349540	4053964	0
chr15	102531392	909664	0
chr16	90354753	1180594	0
chr17	81195210	2161610	0
chr18	78077248	504612	0
chr19	59128983	1501300	0
chr20	63025520	781704	0
chr21	48129895	283056	0
chr22	51304566	564274	0
chrX	155270560	977236	0
chrY	59373566	28220	0
*	0	0	0
In [95]:
 
samtools flagstat KO2.bam
35043262 + 0 in total (QC-passed reads + QC-failed reads)
2252018 + 0 secondary
0 + 0 supplementary
0 + 0 duplicates
35043262 + 0 mapped (100.00% : N/A)
32791244 + 0 paired in sequencing
16395622 + 0 read1
16395622 + 0 read2
32791244 + 0 properly paired (100.00% : N/A)
32791244 + 0 with itself and mate mapped
0 + 0 singletons (0.00% : N/A)
0 + 0 with mate mapped to a different chr
0 + 0 with mate mapped to a different chr (mapQ>=5)
 
## Reads to gene counts
​
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.

Reads to gene counts

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.

In [42]:
 
ln -sf /mnt/nfs/data/RNA-seq/gencode.v19.nopseudo.plus.sort.gtf  ~/data/work/
ls -l *gtf
lrwxrwxrwx 1 r0479539 domain users 56 jan 23 18:46 gencode.v19.nopseudo.plus.sort.gtf -> /mnt/nfs/data/RNA-seq/gencode.v19.nopseudo.plus.sort.gtf
In [100]:
 
featureCounts \
    -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.bam
        ==========     _____ _    _ ____  _____  ______          _____  
        =====         / ____| |  | |  _ \|  __ \|  ____|   /\   |  __ \ 
          =====      | (___ | |  | | |_) | |__) | |__     /  \  | |  | |
            ====      \___ \| |  | |  _ <|  _  /|  __|   / /\ \ | |  | |
              ====    ____) | |__| | |_) | | \ \| |____ / ____ \| |__| |
        ==========   |_____/ \____/|____/|_|  \_\______/_/    \_\_____/
	v1.5.0-p1

//========================== featureCounts setting ===========================\\
||                                                                            ||
||             Input files : 4 BAM files                                      ||
||                           P WT.bam                                         ||
||                           P WT2.bam                                        ||
||                           P KO.bam                                         ||
||                           P KO2.bam                                        ||
||                                                                            ||
||             Output file : gene.counts                                      ||
||             Annotations : /mnt/nfs/data/RNA-seq/gencode.v19.nopseudo.p ... ||
||                                                                            ||
||                 Threads : 1                                                ||
||                   Level : meta-feature level                               ||
||              Paired-end : no                                               ||
||         Strand specific : no                                               ||
||      Multimapping reads : not counted                                      ||
|| Multi-overlapping reads : not counted                                      ||
||       Read orientations : fr                                               ||
||                                                                            ||
\\===================== http://subread.sourceforge.net/ ======================//

//================================= Running ==================================\\
||                                                                            ||
|| Load annotation file /mnt/nfs/data/RNA-seq/gencode.v19.nopseudo.plus.s ... ||
||    Features : 1156385                                                      ||
||    Meta-features : 41863                                                   ||
||    Chromosomes/contigs : 25                                                ||
||                                                                            ||
|| Process BAM file WT.bam...                                                 ||
||    Paired-end reads are included.                                          ||
||    Assign reads to features...                                             ||
||    Total reads : 43080800                                                  ||
||    Successfully assigned reads : 32847440 (76.2%)                          ||
||    Running time : 0.93 minutes                                             ||
||                                                                            ||
|| Process BAM file WT2.bam...                                                ||
||    Paired-end reads are included.                                          ||
||    Assign reads to features...                                             ||
||    Total reads : 35334406                                                  ||
||    Successfully assigned reads : 25557825 (72.3%)                          ||
||    Running time : 0.75 minutes                                             ||
||                                                                            ||
|| Process BAM file KO.bam...                                                 ||
||    Paired-end reads are included.                                          ||
||    Assign reads to features...                                             ||
||    Total reads : 43491572                                                  ||
||    Successfully assigned reads : 32938103 (75.7%)                          ||
||    Running time : 0.90 minutes                                             ||
||                                                                            ||
|| Process BAM file KO2.bam...                                                ||
||    Paired-end reads are included.                                          ||
||    Assign reads to features...                                             ||
||    Total reads : 35043262                                                  ||
||    Successfully assigned reads : 26079902 (74.4%)                          ||
||    Running time : 0.69 minutes                                             ||
||                                                                            ||
||                         Read assignment finished.                          ||
||                                                                            ||
\\===================== http://subread.sourceforge.net/ ======================//

In [101]:
 
head -20 gene.counts.summary | column -t
Status                     WT.bam    WT2.bam   KO.bam    KO2.bam
Assigned                   32847440  25557825  32938103  26079902
Unassigned_Ambiguity       2152974   1608694   2158579   1654976
Unassigned_MultiMapping    0         0         0         0
Unassigned_NoFeatures      4779858   4328809   5138828   3319084
Unassigned_Unmapped        0         0         0         0
Unassigned_MappingQuality  3300528   3839078   3256062   3989300
Unassigned_FragmentLength  0         0         0         0
Unassigned_Chimera         0         0         0         0
Unassigned_Secondary       0         0         0         0
Unassigned_Nonjunction     0         0         0         0
Unassigned_Duplicate       0         0         0         0
xxxxxxxxxx
 
Now 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.

In [102]:
 
cut -f-6 gene.counts > all.genedata.tsv
In [103]:
cut -f1,7- gene.counts | grep -v '^#' > all.gene.counts
We 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

We 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