1-DAV-202 Data Management 2023/24
Previously 2-INF-185 Data Source Integration

Materials · Introduction · Rules · Contact
· Grades from marked homeworks are on the server in file /grades/userid.txt


Difference between revisions of "HWbioinf2"

From MAD
Jump to navigation Jump to search
Line 44: Line 44:
 
===Task B: Aligning RNA-seq reads===
 
===Task B: Aligning RNA-seq reads===
  
* Align RNA-seq reads to the genome
+
* Align RNA-seq reads to the genome.
* We will use a specialized tool <tt>hisat2</tt>, which can recognize introns
+
* We will use a specialized tool <tt>STAR</tt>, which can recognize introns.
* Then we will sort and index the BAM file, similarly as in the [[HWbioinf1|previous lecture]]
+
* First, run the following commands:
  
<!--
 
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
bowtie2-build ref.fasta ref.fasta
+
STAR --runMode genomeGenerate --genomeDir ref-index --genomeFastaFiles ref.fasta --genomeSAindexNbases 6
tophat2 -i 10 -I 10000 --max-multihits 1 --output-dir rnaseq ref.fasta rnaseq.fastq
+
STAR --genomeDir ref-index --alignIntronMax 10000 --readFilesIn rnaseq.fastq --outFileNamePrefix rnaseq e
samtools sort rnaseq/accepted_hits.bam rnaseq
 
samtools index rnaseq.bam
 
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
+
* Then sort the resulting SAM file using samtools, store it as a BAM file and create its index, similarly as in the [[HWbioinf1|previous homework]].
In addition to the BAM file, TopHat produced several other files in the <tt>rnaseq</tt> folder. Examine them to find out answers to the following questions (you can do it manually by looking at the the files, e.g. by <tt>less</tt> command):
+
* In addition to the BAM file, we produced a file containing the position of detected introns. Examine the files to find out answers to the following questions (you can do it manually by looking at the the files, e.g. by <tt>less</tt> command):
-->
 
 
 
<syntaxhighlight lang="bash">
 
hisat2-build ref.fasta ref.fasta
 
hisat2 -x ref.fasta -U rnaseq.fastq -S rnaseq.sam -k 1 --min-intronlen 20 --max-intronlen 10000 --novel-splicesite-outfile introns.txt
 
</syntaxhighlight>
 
 
 
<!-- samtools sort -O BAM -o rnaseq.bam rnaseq.sam
 
samtools index rnaseq.bam -->
 
 
 
After the hisat2 command, sort the resulting SAM file using samtools and store it as a BAM file. Create the index for the BAM file as well.
 
In addition to the BAM file, we produced a file containing the position of detected introns. Examine the files to find out answers to the following questions (you can do it manually by looking at the the files, e.g. by <tt>less</tt> command):
 
  
 
(a) How many reads were in the FASTQ file? How many of them were successfully mapped?
 
(a) How many reads were in the FASTQ file? How many of them were successfully mapped?

Revision as of 21:55, 3 April 2024

See also the lecture

Submit the protocol and the required files to /submit/bioinf2

Input files

Copy files from /tasks/bioinf2/

mkdir bioinf2
cd bioinf2
cp -iv /tasks/bioinf2/* .

Files:

  • ref.fasta is a 38kb piece of the genome of the fungus Aspergillus nidulans
  • rnaseq.fastq are RNA-seq reads from Illumina sequencer extracted from the Short read archive
  • annot.gff is the reference gene annotation from the database (we will consider this as correct gene positions)

Task A: Gene finding

Run the Augustus gene finder with two versions of parameters:

  • one trained specifically for A. nidulans genes
  • one trained for the human genome, where genes have different statistical properties (for example, they are longer and have more introns)
augustus --species=anidulans ref.fasta > augustus-anidulans.gtf
augustus --species=human ref.fasta > augustus-human.gtf

The results of gene finding are in the GTF format. Rows starting with # are comments, each of the remaining rows describes some interval of the sequence. If the second column is CDS, it is a coding part of an exon. The reference annotation annot.gff is in a similar format called GFF3.

Examine the files and try to find the answers to the following questions using command-line tools

(a) How many exons are in each of the two GTF files? (Beware: simply using grep with pattern CDS may yield lines containing this string in a different column. You can use e.g. techniques from the lecture and exercises on command-line tools).

(b) How many genes are in each of the two GTF files? (The files contain rows with word gene in the second column, one for each gene)

(c) How many exons and genes are in the annot.gff file?

Write the anwsers and commands to the protocol. Submit files augustus-anidulans.gtf and augustus-human.gtf.

Task B: Aligning RNA-seq reads

  • Align RNA-seq reads to the genome.
  • We will use a specialized tool STAR, which can recognize introns.
  • First, run the following commands:
STAR --runMode genomeGenerate --genomeDir ref-index --genomeFastaFiles ref.fasta  --genomeSAindexNbases 6
STAR --genomeDir ref-index --alignIntronMax 10000 --readFilesIn rnaseq.fastq  --outFileNamePrefix rnaseq e
  • Then sort the resulting SAM file using samtools, store it as a BAM file and create its index, similarly as in the previous homework.
  • In addition to the BAM file, we produced a file containing the position of detected introns. Examine the files to find out answers to the following questions (you can do it manually by looking at the the files, e.g. by less command):

(a) How many reads were in the FASTQ file? How many of them were successfully mapped?

(b) How many introns ("junctions") were predicted?

(c) During the mapping, we used a few custom options. Inspect the manual pages of hisat2 and samtools and describe shortly what those options mean.


Write answers to the protocol. Submit the file rnaseq.bam.

Task C: Visualizing in IGV

As before, run IGV as follows:

igv -g ref.fasta &

Open additional files using menu File -> Load from File: annot.gff, augustus-anidulans.gtf, augustus-human.gtf, rnaseq.bam

  • Exons are shown as thicker boxes, introns are thinner.
  • For each of the following questions, select a part of the sequence illustrating the answer and export a figure using File->Save image
  • You can check these images using command eog

Questions:

(a) Create an image illustrating differences between Augustus with human parameters and the reference annotation, save as a.png. Briefly describe the differences in words.

(b) Find some differences between Augustus with A. nidulans parameters and the reference annotation. Store an illustrative figure as b.png. Which parameters have yielded a more accurate prediction?

(c) Zoom in to one of the genes with a high expression level and try to find spliced read alignments supporting the annotated intron boundaries. Store the image as c.png.

Submit files a.png, b.png, c.png. Write answers to your protocol.