-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfastqc_batch.pl
56 lines (41 loc) · 1013 Bytes
/
fastqc_batch.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/data/home/jrowell32/perl/bin/perl
use strict;
use Getopt::Long;
use File::Basename;
use File::Temp;
my $script = basename($0);
my ($inDir, $outDir);
if (@ARGV < 1){
usage();
exit 1;
}
GetOptions ('o=s' => \$outDir,
'in=s' => \$inDir);
die usage() unless ((defined $outDir) && (defined $inDir));
my @list = glob("$inDir/*.fa*");
foreach my $file (@list) {
my $fileb = basename($file);
print "Running FastQC on $fileb.\n";
`fastqc -o $outDir $file 2>$outDir/fastqc.log`;
}
exit;
sub usage{
warn <<"EOF";
USAGE
$script -o <outdir> -in <indir>
DESCRIPTION
Runs FastQC on a directory of reads
and outputs statistics in the specified output directory
See the fastqc.log file in the output directory
See FastQC documentation for more info
OPTIONS
-in dir Directory with FASTQ files
-o dir Directory for output files
EXAMPLES
$script -o ./fastqc_results -in ../reads/
$script -h
EXIT STATUS
0 Successful completion
>0 An error occurred
EOF
}