- For this lecture, I'm going to talk
about the preprocessing.
What I mean by preprocessing is before the alignment,
so I need to introduce the FASTQ file,
which we get from the sequencer.
And I would talk about quality.
And when we have some bad quality read, what to do,
there are two major ways: trimming and masking,
so I'm going to discuss those options with hands-on.
So what you get from a sequencer
is a FASTQ file.
Here is the Illumina sequencer.
And what you get is millions of sequence fragments
and corresponding base call accuracy.
For example here, you have
the DNA, and we read
part of this DNA from one end.
So here in this example,
I'm showing you the 30 base paired read
of a sequence.
And in addition to the sequence,
we also get the quality score.
The quality score basically says the error rate
for each base call.
And from the sequencer, we basically get
a sequence fragment and the quality score,
not just for one, but millions of these.
And one of the first questions when you get started
to analyze the data is are you sure you have
good quality read?
Here I would like to do a hands-on together to get you
introduced to the NGS data processing,
especially the quality control.
So
you don't want to check the quality
of 10,000 read manually.
There are so many.
Actually when you run the sequencers,
you often get 150 million read or 200 million read.
But for this exercise, I'm going to use
a very small data set, which is only 10,000 read.
But still 10,000 reads are a lot to check
those quality manually.
So we wany to use the software called FASTQC
in a public web server,
which is available through usegalaxy.org.
So let's first go to the web server, usegalaxy.org.
Please open the
web browser
and go to usegalaxy.org.
And the first thing that you might wanna do
if this is your first time, you're gonna Register first.
And let me try to Register me.
Once you register, you will come to
the interface.
Now you can upload your data and get started
on the analysis.
To upload the data, please click the Get Data link here
and click the Upload file from your computer.
Then
I have a link.
So to use the link to upload the data,
please click Paste and Fetch data.
And please type this location:
http, colon, slash, slash, one, dot,
usa, dot, gov, slash,
one, W, A,
both in capital letter, f small letter,
O capital letter again,
number eight, and U capital letter.
And this C. elegans data.
And this is a very small data set.
If you wanna use
big data for human, beware of the time for the upload.
So for the type, you wanna
select the fastqsanger.
That is the file format.
I'm going to go over detail,
what this fastqsanger means.
And then the reference Genome for this is
C. elegans version six genome, so ce6.
This file is located in NCBI's
FTP server.
And once you fill out those three FASTQ Sanger format
and ce6 reference Genome
and the location of the link,
then click Start to upload.
And then Close this.
Now we are back to the Galaxy window.
You might wanna
press refresh to refresh the history.
So this gray means
you are in queue.
And once it gets started,
it will turn yellow like this.
And then it will take some time.
Once it's completed, it will be
the green color like that.
To check whether this FASTQ file is uploaded correctly,
you may wanna click this eye icon.
When you bring your mouse to this eye icon,
it says View data.
So when you click that, it correctly uploaded
those FASTQ files.
And I'm going to go detail how you interpret it,
how you understand these FASTQ file
in the next few slides.
So let's go back to my PowerPoint slide.
If your upload is done, now it's time to use the software
called FastQC to check the quality
of those 10,000 read.
And first I shortened this name.
And please click the edit attribute icon
right next to the eye icon.
So here you can change the name.
So
10000
_reads.
So that will save to the 10000 reads like this.
So
to get started on the quality control, using FASTQC,
which is located NGS column QC and manipulation.
So click this NGS QC and manipulation.
And there is
FASTQC read quality report.
So you wanna click this FASTQC, which is the name
of the software that we're gonna use.
And here make sure
that you have a correct input,
and we're gonna use a default parameter.
And then click execute
to check the quality.
So let me summarize what we have done so far.
We uploaded the data set by clicking here, Get Data.
And then to check the quality, we used this FASTQC,
which is located in NGS QC manipulation.
And we used the default parameter to run it.
This is
what we will get after we run this FASTQC.
Here is the graph that shows the quality.
And let me explain what you are looking at.
The X-axis shows the position in read.
So since we have 76 base paired read,
the read start from one
and all the way to 76.
And the Y-axis basically shows the quality.
So the green color means good quality,
meaning that sequences are believable.
And here in the Y-axis,
the numbers start from zero to 40,
and this is a PHRED score.
If you have a probability of error for each base,
take a log10 and multiply by -10.
That is the PHRED score.
So
look at this 30,
which often we call Q30,
and Q30
correspond to the .1% of error rate.
And here there is a 20
that distinguishes red to the yellow.
And this 20
correspond to the 1% or better.
So we're gonna check
here the job is done.
Please click the number two FASTQC on data set one
and the webpage HTML
to read this data
and click the view data icon.
And you see this
paired base sequence quality.
And this is the mean value.
So for example, let's interpret this one.
The first base in my reads are
in average, the PHRED quality score is 36.
And
this red line denote the median, the 50 percentile.
And here is 25 percentile.
And this is 10 percentile.
This one correspond to the 75 percentile
and 90 percentile.
So in general
if mean values usually stay
in the green region, that's good quality.
But if not, you need to do either trimming or masking.
So let's consider this special case,
what to do if my read has bad quality base calls
like this.
In this graph, the read quality is generally okay
for the first 70 base pairs.
But the last six base pairs has very bad quality.
So those
CNAAAA
has really bad quality,
which can not be trusted.
And that's apparent from these error quality score.
So one way
to deal with this kind of bad quality is
to remove those sequences.
So basically delete those sequences.
And when you delete
the base information,
you also wanna delete corresponding
the quality score back ASCII characters.
So that is trimming,
you basically delete sequence and
you the quality corresponding to it like this.
Trimming generally work fine, but there are some cases
that the trimming can not work.
In this extreme example,
if you trim it, you basically can not get any read.
But
even for this case, there is an alternative way
called masking.
So let me introduce what masking is.
Masking is basically substituting a base
with low quality as N,
so look at this.
The last six bases have low quality.
But it has base calls AAAANC.
But those AAAA or C are not really trustable.
Instead of putting it like AAAC,
why don't we put NNNNNNN.
So N here stands for any bases,
any of ACGT.
So which one is better, masking or trimming?
And I would like to introduce here one paper
recently published by me.
We did the DNA-seq.
and checked the false-positive rate
and the false-
negative rate.
And we confirmed that masking help
reducing the false-positive rate better than the trimming.
But for the first negative rate, both method
didn't have such a big impact.
So basically I recommend you to use masking
if you can do.
And to do the masking,
let me go back to this Galaxy.
Here are the FASTQ Masker by quality score.
And you can
type in the quality score.
This quality score is PHRED score, so 20 correspond
to 1% error rate.
30 correspond to
the .1% error rate.
If you wanna trim it and mask it with
.1%, please use the 30 and execute.
That's how you can do the masking.
If you wanna do the trimming, here are the options
you can do.
Click the trim sequences.
And we have 76% base paired read.
If you wanna keep
from the 10 bases
to all the way 50 bases,
here now you end up having
41 bases long.
So that is how you can do the trimming in Galaxy.
So now let's switch the gear to how to interpret
the quality score in FASTQ file.
And in FASTQ file, it has a sequence
as the quality score.
So how to understand this one.
The quality score is nothing more than the percent
of error rate,
but it is written very weird way.
It's not like 1%, 2%, 3%.
It's just some ASCII character.
Why?
Because you wanna save the precious disk space.
And so the goal here is
if you have some ACGTA sequence
with corresponding error rate,
how can you simplify this?
So each percent of error correspond
to one single letter.
The trick is using ASCII code table.
In ASCII code table,
there are the characters
that correspond to some number.
So if you have some number, you can translate that
into the character or vice versa.
So
the first step
to convert the probability of error
to ASCII character is
first get the PHRED score.
So for example,
1% of error, which is .01,
the PHRED score is 20 because when you plug
into this formula, -10 times log10 of P,
you get the 20 for that.
And the second step is adding 33 offset
to the PHRED score.
The reason why we are doing that is when you go back
to this ASCII table,
the letters actually started from number 33 and on.
The ASCII code that correspond from zero to all the way
32 are not usable characters.
We wanna add 33 offset to the PHRED score
to avoid those non-usable ASCII code.
Then the final step
is get the ASCII character
that correspond to the above number.
So in this example, when you add up 33 offset
and you get 53, the ASCII codes that correspond
to the number 53 is number five.
So instead of writing .01,
we just write one letter
like number five to denote that.
This is called the FASTQ Sanger format PHRED score plus 33.
So in summary, the FASTQ file is like you get
from the sequencer.
It contains unaligned sequences
with corresponding quality.
To check the quality, we use the FASTQC software.
And if the quality is not good, I strongly suggest
they use masking, but trimming is widely acceptable too.
And
the FASTQ Sanger format is basically
a PHRED score
with 33 offset added.
And this PowerPoint slide
and FASTQ files are also available at
yottabiomed.com and go to Resources.
And thank you.