Question: Is There A Way To Run Fastqc On All The Fastq Files In The Different Directories With Just One Command?
1
gravatar for Assa Yeroslaviz
6.9 years ago by
Assa Yeroslaviz1.4k
Munich
Assa Yeroslaviz1.4k wrote:

Hi,

I have a folder structure with multiple fastq files in different directories.

Is there a way to run fastqc on all the fastq files in the different directories with just one command?

I have tried it with

find . -name "*.fq" | fastqc -

but it didn't work.

thanks in advance

Assa

pipeline fastqc • 17k views
ADD COMMENTlink modified 5.6 years ago by zerbeb50 • written 6.9 years ago by Assa Yeroslaviz1.4k
2
gravatar for Pierre Lindenbaum
6.9 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum131k wrote:

try

find . -name "*.fq"  -exec cat '{}' ';' | fastqc  /dev/stdin

or

find . -name "*.fq.gz"  -exec gunzip -c  '{}' ';' | fastqc  /dev/stdin
ADD COMMENTlink modified 6.9 years ago • written 6.9 years ago by Pierre Lindenbaum131k
4

I like a similar (but maybe simpler?) version of this using xargs:

find . -name "*.fq" | xargs -n 1 fastqc

And if your filenames have spaces in them, it works fine with:

find . -name "*.fq" -print0 | xargs -0 -n 1 fastqc
ADD REPLYlink written 6.9 years ago by matted7.3k

My files are not zipped, so I used the first option. But I get an error massage:

Skipping '-' which didn't exist, or couldn't be read
find: `cat' terminated by signal 13
find: `cat' terminated by signal 13
find: `cat' terminated by signal 13
find: `cat' terminated by signal 13
find: `cat' terminated by signal 13
find: `cat' terminated by signal 13
find: `cat' terminated by signal 13
find: `cat' terminated by signal 13
...
ADD REPLYlink modified 6.9 years ago • written 6.9 years ago by Assa Yeroslaviz1.4k

removed the dash after fastqc

ADD REPLYlink written 6.9 years ago by Pierre Lindenbaum131k

This won't work, as it will open the interactive windows of the fastqc program (x11).

ADD REPLYlink written 6.9 years ago by Assa Yeroslaviz1.4k

sorry, I was reasoning with cutadapt not fastqc. Try to read /dev/stdin.

ADD REPLYlink written 6.9 years ago by Pierre Lindenbaum131k

I think I figure it out thanks to your Idea. I just changed cat with fastq

now it's running. I still need to see if it runs all over the files. but at least it works.

Thanks for the advice

ADD REPLYlink modified 6.9 years ago • written 6.9 years ago by Assa Yeroslaviz1.4k
1
gravatar for Fwip
6.9 years ago by
Fwip490
United States
Fwip490 wrote:

At least on my version (0.10.1, apparently), fastqc will accept filenames listed on the command line. So, in the same vein as Pierre's answer, I would probably do:

find -name '*.fq' -exec fastqc '{}' + ';' or find -name '*.fq' | xargs fastqc

(I think the xargs way is a little easier for my brain to remember).

ADD COMMENTlink modified 6.9 years ago • written 6.9 years ago by Fwip490
1
gravatar for zerbeb
5.6 years ago by
zerbeb50
San Francisco
zerbeb50 wrote:

Was having trouble with related issue and solved it.  This may not be your problem, but for posterity, I wanted to link.  

When fastq are generated by casava, fastqc has a special option.  I found this thread:

http://seqanswers.com/forums/showthread.php?t=34878

and it comes down to fastqc --casava *.fastq.gz that will generate results for the reads separately.  Maybe this will help others?

ADD COMMENTlink written 5.6 years ago by zerbeb50
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1012 users visited in the last hour