Announcement
Collapse
No announcement yet.
X
-
You're welcome ! It's just a quick hack that has the advantage to not use any memory but suffers from being extremely slow. Probably not suitable for Illumina sized data.
-
Thanks xApple. You're right...I ended up taking the average of the quality scores.
I will give your script a shot. Thanks!
Leave a comment:
-
That bioawk command doesn't compute the quality score for the entire file as per the question you originally asked. It computes it for every sequence and floods your standard output.
Here is a program that actually does what you asked.
Code:#!/usr/bin/env python """ Compute the average quality for a given FASTQ file. Written by Lucas Sinclair. Kopimi. You can use this script from the shell like this: $ fastq_avg_qual < reads.fastq """ # Iterative mean # def imean(numbers): count = 0 total = 0 for num in numbers: count += 1 total += num return float(total)/count # Do it # import sys from Bio import SeqIO records = (r for r in SeqIO.parse(sys.stdin, "fastq")) scores = (s for r in records for s in r.letter_annotations["phred_quality"]) print imean(scores)
Last edited by xApple; 07-12-2013, 07:45 AM.
Leave a comment:
-
For anyone still interested...
For simplicity, I ended up using Bioawk (https://github.com/lh3/bioawk):
Get the mean Phred quality score from FASTQ:
awk -c fastx '{ print ">"$name; print meanqual($qual) }' seq.fq.gz
Leave a comment:
-
Thanks to everyone's suggestions!
I will try a few of these and let you know what I ended up doing.
Leave a comment:
-
With Biopieces (www.biopieces.org) you can do it in two steps where you first find the mean score per sequence entry and then the overall mean score:
Code:read_fastq -i test.fq | mean_scores | mean_vals -k SCORES_MEAN -x
Leave a comment:
-
Originally posted by jgibbons1 View PostHello,
Given a fastq file, is there software that will calculate the average quality score for the entire file?
Thanks
Both Fastx toolkit (http://hannonlab.cshl.edu/fastx_toolkit/) and FastQC (http://www.bioinformatics.babraham.a...ojects/fastqc/) will generate statistics you could use.
If this is illumina data and you have access to CASAVA pipeline output then the summary file has a "mean" quality score for each sample that you could parse.
Leave a comment:
-
I'm trying to integrate this value into a larger analysis pipeline. Automating it would be more efficient.
Leave a comment:
-
Originally posted by jgibbons1 View PostThanks @JackieBadger
Do you know of any unix/linux based tools to do this? I'm trying to stay away from galaxy for this tidbit.
Leave a comment:
-
Thanks @JackieBadger
Do you know of any unix/linux based tools to do this? I'm trying to stay away from galaxy for this tidbit.
Leave a comment:
-
-
average quality score for fastq file
Hello,
Simple question here, but I've had a problem finding a program to do it.
Given a fastq file, is there software that will calculate the average quality score for the entire file?
ThanksTags: None
Latest Articles
Collapse
-
by seqadmin
The recent pandemic caused worldwide health, economic, and social disruptions with its reverberations still felt today. A key takeaway from this event is the need for accurate and accessible tools for detecting and tracking infectious diseases. Timely identification is essential for early intervention, managing outbreaks, and preventing their spread. This article reviews several valuable tools employed in the detection and surveillance of infectious diseases.
...-
Channel: Articles
11-27-2023, 01:15 PM -
-
by seqadmin
Microbiome research has led to the discovery of important connections to human and environmental health. Sequencing has become a core investigational tool in microbiome research, a subject that we covered during a recent webinar. Our expert speakers shared a number of advancements including improved experimental workflows, research involving transmission dynamics, and invaluable analysis resources. This article recaps their informative presentations, offering insights...-
Channel: Articles
11-09-2023, 07:02 AM -
ad_right_rmr
Collapse
News
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by seqadmin, Today, 09:55 AM
|
0 responses
9 views
0 likes
|
Last Post
by seqadmin
Today, 09:55 AM
|
||
Started by seqadmin, Yesterday, 10:48 AM
|
0 responses
17 views
0 likes
|
Last Post
by seqadmin
Yesterday, 10:48 AM
|
||
Started by seqadmin, 11-29-2023, 08:26 AM
|
0 responses
13 views
0 likes
|
Last Post
by seqadmin
11-29-2023, 08:26 AM
|
||
Started by seqadmin, 11-29-2023, 08:12 AM
|
0 responses
14 views
0 likes
|
Last Post
by seqadmin
11-29-2023, 08:12 AM
|
Leave a comment: