STEP 1 - Quality Checks with FastQC
To assess the quality of sequencing data in FASTQ files, we can use a tool called FastQC. FastQC provides a simple way to perform quality control checks on raw sequence data coming from high-throughput sequencing pipelines. It generates a comprehensive report that highlights potential issues with the data.
This includes checks for:
- Per base sequence quality
- Per sequence quality scores
- Per base sequence content
- Per sequence GC content
- Sequence length distribution
- Overrepresented sequences and duplicate sequences
- Adapter content
Loading FastQC
On the CCB, the FastQC tool is pre-installed on the module system and can be accessed via the command line.
module load fastqcRunning FastQC
To run FastQC on a FASTQ file, you can use the following command in your terminal:
fastqc -o fastqc_reports *.fastq.gz Here, -o fastqc_reports specifies the output directory where the FastQC reports will be saved, and *.fastq.gz indicates that FastQC should process all FASTQ files in the current directory.
Example Workflow
Considering the file conventions mentioned in the previous section, you may have a file strucutre containing raw sequencing data that looks like this:
├── 00_raw_fastqs/
├── 01_ChIP_seq_runs/
├── 20240116_Rad21_ChIPseq_mESCs/
├── mESC_Rad21_ChIPseq_WT_rep1.R1.fastq.gz
├── mESC_Rad21_ChIPseq_WT_rep1.R2.fastq.gz
You can then prepare an analysis folder for the results. For example:
cd /path/to/01_ChIP_seq/
mkdir 01_16JAN2024_mESCs_Rad21_ChIPseq_Rad21KO
cd 01_16JAN2024_mESCs_Rad21_ChIPseq_Rad21KO
mkdir mESC_Rad21_ChIPseq_WT_rep1
mkdir mESC_Rad21_ChIPseq_WT_rep2Which creates a folder structure like this:
├── /path/to/01_ChIP_seq/
├── 01_16JAN2024_mESCs_Rad21_ChIPseq_Rad21KO/
├── mESC_Rad21_ChIPseq_WT_rep1/
You can then create links to the raw FASTQ files in the analysis folders:
ln -s /path/to/00_raw_fastqs/01_ChIP_seq_runs/20240116_Rad21_ChIPseq_mESCs/mESC_Rad21_ChIPseq_WT_rep1* /path/to/01_ChIP_seq/01_16JAN2024_mESCs_Rad21_ChIPseq_Rad21KO/mESC_Rad21_ChIPseq_WT_rep1/Creating a folder structure like this:
├── /path/to/01_ChIP_seq/
├── 01_16JAN2024_mESCs_Rad21_ChIPseq_Rad21KO/
├── mESC_Rad21_ChIPseq_WT_rep1/
├── mESC_Rad21_ChIPseq_WT_rep1.R1.fastq.gz -> /path/to/00_raw_fastqs/01_ChIP_seq_runs/20240116_Rad21_ChIPseq_mESCs/mESC_Rad21_ChIPseq_WT_rep1.R1.fastq.gz
├── mESC_Rad21_ChIPseq_WT_rep1.R2.fastq.gz -> /path/to/00_raw_fastqs/01_ChIP_seq_runs/20240116_Rad21_ChIPseq_mESCs/mESC_Rad21_ChIPseq_WT_rep1.R2.fastq.gz
You may want to create directories to store the FastQC output reports for each replicate:
mkdir mESC_Rad21_ChIPseq_WT_rep1/fastqc_reportsThe simple way to run FastQC is to specify the input FASTQ file and the output directory for the reports:
cd mESC_Rad21_ChIPseq_WT_rep1/ # Navigate to the replicate folder
fastqc -o fastqc_reports *.fastq.gz # Run FastQC on all FASTQ files in the folder and output to 'fastqc_reports' directoryAlternate Workflow: Using a Loop for Multiple Samples
However if you had multple samples, you may also want to use a loop to combine these steps to rapidly run FastQC on multiple samples.
Once you make folders for each sample and populate with symlinks (ln -s), from the main analysis folder:
for rep in mESC_Rad21_ChIPseq_WT_rep1 mESC_Rad21_ChIPseq_WT_rep2 ; do
cd $rep || continue # Navigate to the sample folder
if [ ! -d fastqc_reports ] ; then # Check if output directory already exists
mkdir fastqc_reports # Create output directory for FastQC reports
fi # End 'if' statement when directory already exists
fastqc -o fastqc_reports *.fastq.gz # Run FastQC on all FASTQ files in the folder and output to 'fastqc_reports' directory
cd .. # Navigate back to main analysis folder
doneViewing FastQC Reports
After running FastQC, you will find the output reports in the specified output directory (e.g., fastqc_reports). Each report consists of an HTML file and a ZIP file containing the raw data used to generate the report.
You can open the HTML report using a web browser. You may need to download the files to your local machine first, using FileZilla or by VSCode right-clicking the file in the left panel and clicking Download.
In VSCode, if you have the Live Preview extension installed, you can right-click on the HTML file and select Show Preview to view the report directly within VSCode.
Interpreting FastQC Reports
The FastQC report provides various modules that assess different aspects of the sequencing data quality. Each module is color-coded (green, yellow, red) to indicate the quality status:
- Green: Pass - The data quality is good for this metric.
- Yellow: Warning - The data quality is acceptable but may require further investigation.
- Red: Fail - The data quality is poor for this metric and may need to be addressed.
I would recomend the following video for a detailed explanation of how to interpret FastQC reports: FastQC Tutorial Video.
Per base Sequence Quality
Good quality scores are typically above 30 (green) across all bases. It is common to see a drop in quality scores towards the end of reads, especially in longer reads. If the quality drops significantly (red), you may consider trimming the low-quality bases.
Per base Sequence Scores
Good quality scores are typically above 30 (green) across all reads. If a significant portion of reads have low quality scores (red), it may indicate issues with the sequencing run.
Adapter Content and Overrepresented Sequences
If adapter sequences are detected (yellow or red), it indicates that some reads contain adapter contamination. You may need to trim these adapters from your reads using other tools.