Thursday, April 24, 2014

FastQC to check fastq files from terminal via SSH

If you want to check quality of fastq files and get a full report use FastQC.
Download FastQC
Unpack unzip
Check if you have java runtime environment JRE, above 1.6 or 1.7: java -version
Change permissions to fastqc: chmod 755 fastqc
Run FastQC: ./fastqc
This will run fastqc as a graphical interaction interface.

If you run it on a server, log in with: ssh -X

Choose file you want to analyze and run the analysis.

If you want to run it in a non interactive mode to analyze multiple files at once or to pipe it in a script use: ./fastqc filename1.fastq filename2.fastq filename3.fastq
Each file will be analyzed and an html report will be created and no interactive mode will be launched when you put the filename after ./fastqc

If you copy the executable file fastqc to a folder where you have your fastq files and try to run it with ./fastqc you will get this message:
Error: Could not find or load main class

as java cannot find the initial class file FastQCApplication.class that is located in the FastQC folder.

You may want instead to create a link in that folder to the fastqc file or place a link in usr/local/bin/:
sudo ln -s /path/to/FastQC/fastqc /usr/local/bin/fastqc

No comments:

Post a Comment