-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathcallCentrifugeOnConvertedDB.pl
More file actions
75 lines (53 loc) · 1.29 KB
/
callCentrifugeOnConvertedDB.pl
File metadata and controls
75 lines (53 loc) · 1.29 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
use FindBin;
use lib "$FindBin::Bin/perlLib";
use Cwd qw/getcwd abs_path/;
use File::Copy;
$| = 1;
use SimulationsKraken;
use Util;
my $centrifugeBinDir = SimulationsKraken::getCentrifugeDir();
unless(scalar(@ARGV) == 3)
{
print_help();
}
my $database = $ARGV[0];
my $FASTQ = $ARGV[1];
my $outputDir = $ARGV[2];
# test that database is valid
# todo reinstate
#my %taxonID_2_contigs;
#my %contigLength;
#Util::read_taxonIDs_and_contigs($database, \%taxonID_2_contigs, \%contigLength);
unless(-e $outputDir)
{
mkdir($outputDir) or die "Cannot mkdir $outputDir";
}
$outputDir = abs_path($outputDir);
my %taxonID_original_2_contigs;
my %contigLength;
Util::read_taxonIDs_and_contigs($database, \%taxonID_original_2_contigs, \%contigLength);
my $centrifugeDBDir = $database . '/centrifuge';
SimulationsKraken::doCentrifugeOnExistingDB (
$centrifugeDBDir,
$FASTQ,
$outputDir,
$centrifugeBinDir,
\%taxonID_original_2_contigs,
$database
);
sub print_help
{
print qq(
callCentrifugeOnConvertedDB.pl
Call Centrifuge with a FASTQ file on a converted DB.
Usage:
perl callCentrifugeOnConvertedDB.pl dbNAME FASTQFILE outputDir
Example:
perl callCentrifugeOnConvertedDB.pl databases/miniSeq test.fastq testCentrifugeResults
);
exit;
}