Difference between revisions of "FastqQC"
From AMOS WIKI
(Created page with 'Quality check a fastq for position dependent sequencing or quality biases Example fastqqc.pl -tsv file.fq > file.fq.qc File:Fastqqc.png == FastqQC Plot == <pre> ## R …') |
|||
Line 26: | Line 26: | ||
qc2name=paste(dir, qc2pre,"_sequence.txt.qc", sep="") | qc2name=paste(dir, qc2pre,"_sequence.txt.qc", sep="") | ||
qc2 <- read.table(qc2name, header=TRUE) | qc2 <- read.table(qc2name, header=TRUE) | ||
+ | |||
+ | len<-dim(qc1)[1] | ||
plot(qc1$pos, qc1$X.A, type="l", col="red", ylim=c(0,40), xlab="", ylab="", main=qc1pre, axes=FALSE, frame.plot=TRUE) | plot(qc1$pos, qc1$X.A, type="l", col="red", ylim=c(0,40), xlab="", ylab="", main=qc1pre, axes=FALSE, frame.plot=TRUE) | ||
Line 33: | Line 35: | ||
lines(qc1$pos, qc1$X.N, col="black") | lines(qc1$pos, qc1$X.N, col="black") | ||
lines(qc1$pos, qc1$Q, col="purple", lty=2) | lines(qc1$pos, qc1$Q, col="purple", lty=2) | ||
− | abline(v=seq(0, | + | abline(v=seq(0,len,10), col="grey", lty=3) |
− | abline(h=seq(0, | + | abline(h=seq(0,len,10), col="grey", lty=3) |
− | axis(side=1, at=seq(0, | + | axis(side=1, at=seq(0,len,by=10)) |
− | axis(side=2, at=seq(0, | + | axis(side=2, at=seq(0,len,by=10)) |
plot(qc2$pos, qc2$X.A, type="l", col="red", ylim=c(0,40), xlab="", ylab="", main=qc2pre, frame.plot=TRUE) | plot(qc2$pos, qc2$X.A, type="l", col="red", ylim=c(0,40), xlab="", ylab="", main=qc2pre, frame.plot=TRUE) | ||
Line 44: | Line 46: | ||
lines(qc2$pos, qc2$X.N, col="black") | lines(qc2$pos, qc2$X.N, col="black") | ||
lines(qc2$pos, qc2$Q, col="purple", lty=2) | lines(qc2$pos, qc2$Q, col="purple", lty=2) | ||
− | abline(v=seq(0, | + | abline(v=seq(0,len,10), col="grey", lty=3) |
− | abline(h=seq(0, | + | abline(h=seq(0,len,10), col="grey", lty=3) |
− | axis(side=1, at=seq(0, | + | axis(side=1, at=seq(0,len,by=10)) |
− | axis(side=2, at=seq(0, | + | axis(side=2, at=seq(0,len,by=10)) |
dev.off() | dev.off() | ||
</pre> | </pre> |
Latest revision as of 19:34, 17 May 2010
Quality check a fastq for position dependent sequencing or quality biases
Example
fastqqc.pl -tsv file.fq > file.fq.qc
FastqQC Plot
## R script for generating quality plot ## Shows the per position sequence composition (A=red, T=orange, G=green, C=cyan, N=black) ## And the per position average quality value (dashed-purple line) prefix="s_7" dir="./" pdf(paste(paste(dir,prefix,sep=""),".qc.pdf",sep="")) par(mfrow=c(2,1)) qc1pre = paste(prefix,"_1", sep="") qc1name=paste(dir, qc1pre,"_sequence.txt.qc", sep="") qc1 <- read.table(qc1name, header=TRUE) qc2pre = paste(prefix,"_2", sep="") qc2name=paste(dir, qc2pre,"_sequence.txt.qc", sep="") qc2 <- read.table(qc2name, header=TRUE) len<-dim(qc1)[1] plot(qc1$pos, qc1$X.A, type="l", col="red", ylim=c(0,40), xlab="", ylab="", main=qc1pre, axes=FALSE, frame.plot=TRUE) lines(qc1$pos, qc1$X.C, col="cyan") lines(qc1$pos, qc1$X.G, col="green") lines(qc1$pos, qc1$X.T, col="orange") lines(qc1$pos, qc1$X.N, col="black") lines(qc1$pos, qc1$Q, col="purple", lty=2) abline(v=seq(0,len,10), col="grey", lty=3) abline(h=seq(0,len,10), col="grey", lty=3) axis(side=1, at=seq(0,len,by=10)) axis(side=2, at=seq(0,len,by=10)) plot(qc2$pos, qc2$X.A, type="l", col="red", ylim=c(0,40), xlab="", ylab="", main=qc2pre, frame.plot=TRUE) lines(qc2$pos, qc2$X.C, col="cyan") lines(qc2$pos, qc2$X.G, col="green") lines(qc2$pos, qc2$X.T, col="orange") lines(qc2$pos, qc2$X.N, col="black") lines(qc2$pos, qc2$Q, col="purple", lty=2) abline(v=seq(0,len,10), col="grey", lty=3) abline(h=seq(0,len,10), col="grey", lty=3) axis(side=1, at=seq(0,len,by=10)) axis(side=2, at=seq(0,len,by=10)) dev.off()