forked from Molmed/sisyphus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerateIncludedTiles.pl
executable file
·97 lines (62 loc) · 1.84 KB
/
generateIncludedTiles.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/usr/bin/perl -w
use strict;
use FindBin; # Find the script location
use lib "$FindBin::Bin/lib";# Add the script libdir to libs
use Pod::Usage;
use Getopt::Long;
use Molmed::Sisyphus::Common;
=pod
=head1 NAME
generateIncludedTiles.pl - Print tiles to include, one tile per line to stdout.
=head1 SYNOPSIS
generateIncludedTiles.pl -help|-man
generateIncludedTiles.pl -runfolder <runfolder>
=head1 OPTIONS
=over 4
=item -h|-help
Prints out a brief help text.
=item -m|-man
Opens the man page
=item -runfolder
The runfolder to extract the included tiles information from.
=item -format
Format as a comma-separated string to be consumed by bcl2fastq.
=item -debug
Print debuging information
=head1 DESCRIPTION
Generates a list of tiles to include. Please note that the error rate used to
decide if a tile should be included or not is decided by the values
specified in the sisyphus.yml config file.
=cut
my $rfPath = undef;
my $debug = undef;
my $format = undef;
my ($help,$man) = (0,0);
GetOptions('help|?'=>\$help,
'man'=>\$man,
'runfolder=s' => \$rfPath,
'format' => \$format,
'debug' => \$debug,
) or pod2usage(-verbose => 0);
pod2usage(-verbose => 1) if ($help);
pod2usage(-verbose => 2) if ($man);
unless(defined $rfPath && -e $rfPath){
print STDERR "Runfolder not specified or does not exist\n";
pod2usage(-verbose => 1);
exit 1;
}
my $sisyphus = Molmed::Sisyphus::Common->new(PATH=>$rfPath, DEBUG=>$debug);
# Spits which tiles to keep and which to exclude
# based on the errors rates.
my ($incTilesRef, $excTilesRef) = $sisyphus->getExcludedAndIncludedTiles();
my @incTiles = @{$incTilesRef};
my @excTiles = @{$excTilesRef};
if(defined($format)){
my $includeTiles = join ',', @incTiles;
print "$includeTiles\n";
}
else {
foreach(@incTiles){
print "$_\n";
}
}