View Single Post
Old 04-22-2016, 03:31 AM   #12
anais.barray
Junior Member
 
Location: France

Join Date: Apr 2016
Posts: 1
Default

I didn't intend to revive this thread, but as I was searching for a solution to automatize the fastq read counting process, this solution may come in handy to some :

Quote:
for i in `find . -name "*.fastq"`; do echo "$i" >> project_nbread.txt; egrep -c "`head -n 1 $i | awk -F '[@:]' '{ print $2 } '`" $i >> project_nbread.txt ; done
In the case of only one file, you can use this :
Quote:
egrep -c "`head -n 1 file.fastq | awk -F '[@:]' '{ print $2 } '`" file.fastq
This solution will count the number of lines where the id is found in the header of a fastq seq, i.e the number of fastq reads.
anais.barray is offline   Reply With Quote