| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
############################################################################### |
|
2
|
|
|
|
|
|
|
# # |
|
3
|
|
|
|
|
|
|
# Copyright © 2012-2013 -- IRB/INSERM # |
|
4
|
|
|
|
|
|
|
# (Institut de Recherche en Biothérapie / # |
|
5
|
|
|
|
|
|
|
# Institut National de la Santé et de la # |
|
6
|
|
|
|
|
|
|
# Recherche Médicale) # |
|
7
|
|
|
|
|
|
|
# # |
|
8
|
|
|
|
|
|
|
# Auteurs/Authors: Jerôme AUDOUX # |
|
9
|
|
|
|
|
|
|
# Nicolas PHILIPPE # |
|
10
|
|
|
|
|
|
|
# # |
|
11
|
|
|
|
|
|
|
# ------------------------------------------------------------------------- # |
|
12
|
|
|
|
|
|
|
# # |
|
13
|
|
|
|
|
|
|
# Ce fichier fait partie de la suite CracTools qui contient plusieurs pipeline# |
|
14
|
|
|
|
|
|
|
# intégrés permettant de traiter les évênements biologiques présents dans du # |
|
15
|
|
|
|
|
|
|
# RNA-Seq. Les CracTools travaillent à partir d'un fichier SAM de CRAC et d'un# |
|
16
|
|
|
|
|
|
|
# fichier d'annotation au format GFF3. # |
|
17
|
|
|
|
|
|
|
# # |
|
18
|
|
|
|
|
|
|
# Ce logiciel est régi par la licence CeCILL soumise au droit français et # |
|
19
|
|
|
|
|
|
|
# respectant les principes de diffusion des logiciels libres. Vous pouvez # |
|
20
|
|
|
|
|
|
|
# utiliser, modifier et/ou redistribuer ce programme sous les conditions de # |
|
21
|
|
|
|
|
|
|
# la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA sur # |
|
22
|
|
|
|
|
|
|
# le site "http://www.cecill.info". # |
|
23
|
|
|
|
|
|
|
# # |
|
24
|
|
|
|
|
|
|
# En contrepartie de l'accessibilité au code source et des droits de copie, # |
|
25
|
|
|
|
|
|
|
# de modification et de redistribution accordés par cette licence, il n'est # |
|
26
|
|
|
|
|
|
|
# offert aux utilisateurs qu'une garantie limitée. Pour les mêmes raisons, # |
|
27
|
|
|
|
|
|
|
# seule une responsabilité restreinte pèse sur l'auteur du programme, le # |
|
28
|
|
|
|
|
|
|
# titulaire des droits patrimoniaux et les concédants successifs. # |
|
29
|
|
|
|
|
|
|
# # |
|
30
|
|
|
|
|
|
|
# À cet égard l'attention de l'utilisateur est attirée sur les risques # |
|
31
|
|
|
|
|
|
|
# associés au chargement, à l'utilisation, à la modification et/ou au # |
|
32
|
|
|
|
|
|
|
# développement et à la reproduction du logiciel par l'utilisateur étant # |
|
33
|
|
|
|
|
|
|
# donné sa spécificité de logiciel libre, qui peut le rendre complexe à # |
|
34
|
|
|
|
|
|
|
# manipuler et qui le réserve donc à des développeurs et des professionnels # |
|
35
|
|
|
|
|
|
|
# avertis possédant des connaissances informatiques approfondies. Les # |
|
36
|
|
|
|
|
|
|
# utilisateurs sont donc invités à charger et tester l'adéquation du # |
|
37
|
|
|
|
|
|
|
# logiciel à leurs besoins dans des conditions permettant d'assurer la # |
|
38
|
|
|
|
|
|
|
# sécurité de leurs systêmes et ou de leurs données et, plus généralement, # |
|
39
|
|
|
|
|
|
|
# à l'utiliser et l'exploiter dans les mêmes conditions de sécurité. # |
|
40
|
|
|
|
|
|
|
# # |
|
41
|
|
|
|
|
|
|
# Le fait que vous puissiez accéder à cet en-tête signifie que vous avez # |
|
42
|
|
|
|
|
|
|
# pris connaissance de la licence CeCILL, et que vous en avez accepté les # |
|
43
|
|
|
|
|
|
|
# termes. # |
|
44
|
|
|
|
|
|
|
# # |
|
45
|
|
|
|
|
|
|
# ------------------------------------------------------------------------- # |
|
46
|
|
|
|
|
|
|
# # |
|
47
|
|
|
|
|
|
|
# This file is part of the CracTools which provide several integrated # |
|
48
|
|
|
|
|
|
|
# pipeline to analyze biological events present in RNA-Seq data. CracTools # |
|
49
|
|
|
|
|
|
|
# work on a SAM file generated by CRAC and an annotation file in GFF3 format.# |
|
50
|
|
|
|
|
|
|
# # |
|
51
|
|
|
|
|
|
|
# This software is governed by the CeCILL license under French law and # |
|
52
|
|
|
|
|
|
|
# abiding by the rules of distribution of free software. You can use, # |
|
53
|
|
|
|
|
|
|
# modify and/ or redistribute the software under the terms of the CeCILL # |
|
54
|
|
|
|
|
|
|
# license as circulated by CEA, CNRS and INRIA at the following URL # |
|
55
|
|
|
|
|
|
|
# "http://www.cecill.info". # |
|
56
|
|
|
|
|
|
|
# # |
|
57
|
|
|
|
|
|
|
# As a counterpart to the access to the source code and rights to copy, # |
|
58
|
|
|
|
|
|
|
# modify and redistribute granted by the license, users are provided only # |
|
59
|
|
|
|
|
|
|
# with a limited warranty and the software's author, the holder of the # |
|
60
|
|
|
|
|
|
|
# economic rights, and the successive licensors have only limited # |
|
61
|
|
|
|
|
|
|
# liability. # |
|
62
|
|
|
|
|
|
|
# # |
|
63
|
|
|
|
|
|
|
# In this respect, the user's attention is drawn to the risks associated # |
|
64
|
|
|
|
|
|
|
# with loading, using, modifying and/or developing or reproducing the # |
|
65
|
|
|
|
|
|
|
# software by the user in light of its specific status of free software, # |
|
66
|
|
|
|
|
|
|
# that may mean that it is complicated to manipulate, and that also # |
|
67
|
|
|
|
|
|
|
# therefore means that it is reserved for developers and experienced # |
|
68
|
|
|
|
|
|
|
# professionals having in-depth computer knowledge. Users are therefore # |
|
69
|
|
|
|
|
|
|
# encouraged to load and test the software's suitability as regards their # |
|
70
|
|
|
|
|
|
|
# requirements in conditions enabling the security of their systems and/or # |
|
71
|
|
|
|
|
|
|
# data to be ensured and, more generally, to use and operate it in the same # |
|
72
|
|
|
|
|
|
|
# conditions as regards security. # |
|
73
|
|
|
|
|
|
|
# # |
|
74
|
|
|
|
|
|
|
# The fact that you are presently reading this means that you have had # |
|
75
|
|
|
|
|
|
|
# knowledge of the CeCILL license and that you accept its terms. # |
|
76
|
|
|
|
|
|
|
# # |
|
77
|
|
|
|
|
|
|
############################################################################### |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=encoding utf8 |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 NAME |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
CracTools::SAMReader - An easy to use tool to read files in SAM format. |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
use CracTools::SAMReader; |
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
# Creating the reader |
|
90
|
|
|
|
|
|
|
my $sam_reader = CracTools::SAMreader->new($sam,'CRAC'); |
|
91
|
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
# Get an iterator to go through the SAM file in a linear way |
|
93
|
|
|
|
|
|
|
my $it = $sam_reader->iterator(); |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
# Iterate on lines and explore CRAC special fields of SAM |
|
96
|
|
|
|
|
|
|
while(my $line = $it->()) { |
|
97
|
|
|
|
|
|
|
if(defined $line->events('Junction') && $line->isClassified('normal')) { |
|
98
|
|
|
|
|
|
|
my @junctions = @{$line->events('Junction')}; |
|
99
|
|
|
|
|
|
|
foreach my $junction (@junctions) { |
|
100
|
|
|
|
|
|
|
print "Foud Junction : [type : $junction->{type}, loc : $junction->{loc}, gap : $junction->{gap}]\n"; |
|
101
|
|
|
|
|
|
|
} |
|
102
|
|
|
|
|
|
|
} |
|
103
|
|
|
|
|
|
|
} |
|
104
|
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
Reader for SAM format, including CRAC special fields. |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=cut |
|
110
|
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
package CracTools::SAMReader; |
|
112
|
|
|
|
|
|
|
|
|
113
|
1
|
|
|
1
|
|
35319
|
use strict; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
38
|
|
|
114
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
32
|
|
|
115
|
1
|
|
|
1
|
|
789
|
use CracTools::SAMReader::SAMline; |
|
|
1
|
|
|
|
|
4
|
|
|
|
1
|
|
|
|
|
1651
|
|
|
116
|
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=head1 METHODS |
|
118
|
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=head2 new |
|
120
|
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
Arg [1] : String - SAM file |
|
122
|
|
|
|
|
|
|
Arg [2] : (Optional) String - SAM type |
|
123
|
|
|
|
|
|
|
- CRAC |
|
124
|
|
|
|
|
|
|
- CRAC_EMT |
|
125
|
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
Example : $reader = CracTools::SAMreader->new('file.sam','CRAC'); |
|
127
|
|
|
|
|
|
|
Description : Create a new reader obect |
|
128
|
|
|
|
|
|
|
ReturnType : CracTools::SAMreader |
|
129
|
|
|
|
|
|
|
Exceptions : none |
|
130
|
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=cut |
|
132
|
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
sub new { |
|
134
|
1
|
|
|
1
|
1
|
1249
|
my $class = shift; |
|
135
|
1
|
|
|
|
|
4
|
my ($sam_file,$sam_type) = @_; |
|
136
|
|
|
|
|
|
|
|
|
137
|
1
|
|
|
|
|
8
|
my $self = bless{ |
|
138
|
|
|
|
|
|
|
sam_file => $sam_file, |
|
139
|
|
|
|
|
|
|
sam_type => $sam_type, |
|
140
|
|
|
|
|
|
|
}, $class; |
|
141
|
|
|
|
|
|
|
|
|
142
|
1
|
|
|
|
|
6
|
$self->init(); |
|
143
|
|
|
|
|
|
|
|
|
144
|
1
|
|
|
|
|
71
|
return $self; |
|
145
|
|
|
|
|
|
|
} |
|
146
|
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
=head2 iterator |
|
148
|
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
Example : my $it = $sam_reader->iterator(); |
|
150
|
|
|
|
|
|
|
while(my $line = $it->()) { |
|
151
|
|
|
|
|
|
|
print $line->seq,"\n"; |
|
152
|
|
|
|
|
|
|
} |
|
153
|
|
|
|
|
|
|
Description : Create an iterator to go throud each lines of the file |
|
154
|
|
|
|
|
|
|
ReturnType : Iterator on CracTools::SAMline |
|
155
|
|
|
|
|
|
|
Exceptions : none |
|
156
|
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=cut |
|
158
|
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
sub iterator { |
|
160
|
1
|
|
|
1
|
1
|
7
|
my $self = shift; |
|
161
|
1
|
|
|
|
|
4
|
my $f_it = $self->iteratorFile("IGNORE_HEADERS"); |
|
162
|
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
return sub { |
|
164
|
7
|
|
|
7
|
|
53
|
my ($line) = $f_it->(); |
|
165
|
7
|
|
|
|
|
11
|
my $sam_line; |
|
166
|
7
|
100
|
|
|
|
18
|
if(defined $line) { |
|
167
|
6
|
|
|
|
|
27
|
$sam_line = CracTools::SAMReader::SAMline->new($line); |
|
168
|
|
|
|
|
|
|
} |
|
169
|
7
|
|
|
|
|
20
|
return $sam_line; |
|
170
|
1
|
|
|
|
|
6
|
}; |
|
171
|
|
|
|
|
|
|
} |
|
172
|
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
=head2 iteratorFile |
|
174
|
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
Arg [1] : (Optional) String - options (IGNORE_HEADERS,..) |
|
176
|
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
Example : my $it_f = $sam_reader->iteratorFile(); |
|
178
|
|
|
|
|
|
|
while(my ($line,$line_number) = $it->()) { |
|
179
|
|
|
|
|
|
|
print $line,"\n"; |
|
180
|
|
|
|
|
|
|
} |
|
181
|
|
|
|
|
|
|
Description : Create an iterator to go throud each lines of the file |
|
182
|
|
|
|
|
|
|
ReturnType : Iterator on Array (String,Int) where the is the |
|
183
|
|
|
|
|
|
|
line, and the line number. |
|
184
|
|
|
|
|
|
|
Exceptions : none |
|
185
|
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
=cut |
|
187
|
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
sub iteratorFile { |
|
189
|
2
|
|
|
2
|
1
|
3
|
my $self = shift; |
|
190
|
2
|
|
|
|
|
4
|
my $option = shift; |
|
191
|
2
|
|
|
|
|
9
|
my $sam_file = $self->{sam_file}; |
|
192
|
|
|
|
|
|
|
|
|
193
|
2
|
50
|
|
|
|
10
|
if($sam_file =~ /\.sam$/) { |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
194
|
2
|
50
|
|
|
|
32
|
open(SAM,"< $sam_file") or die ("Cannot open $sam_file"); |
|
195
|
|
|
|
|
|
|
} elsif($self->{sam_file} =~ /\.sam.gz$/) { |
|
196
|
0
|
0
|
|
|
|
0
|
open(SAM,"gunzip -c $sam_file |") or die ("Cannot open $sam_file"); |
|
197
|
|
|
|
|
|
|
} elsif($self->{sam_file} =~ /\.bam$/) { |
|
198
|
0
|
0
|
|
|
|
0
|
open(SAM, "-|", "samtools view -h $sam_file" )or die "Cannot open $sam_file, check if samtools are installed."; |
|
199
|
|
|
|
|
|
|
} else { |
|
200
|
0
|
|
|
|
|
0
|
die "Unknown file format. Must be either a BAM or a SAM(.gz)"; |
|
201
|
|
|
|
|
|
|
} |
|
202
|
|
|
|
|
|
|
|
|
203
|
2
|
|
|
|
|
105
|
my $next_line; |
|
204
|
2
|
|
|
|
|
4
|
my $line_number = 0; |
|
205
|
|
|
|
|
|
|
|
|
206
|
2
|
100
|
66
|
|
|
15
|
if(defined $option && $option eq "IGNORE_HEADERS") { |
|
207
|
1
|
|
|
|
|
22
|
while(my $line = ) { |
|
208
|
4
|
100
|
|
|
|
22
|
if(!($line =~ /^@/)) { |
|
209
|
1
|
|
|
|
|
2
|
$next_line = $line; |
|
210
|
1
|
|
|
|
|
2
|
$line_number++; |
|
211
|
1
|
|
|
|
|
2
|
last; |
|
212
|
|
|
|
|
|
|
} |
|
213
|
|
|
|
|
|
|
} |
|
214
|
|
|
|
|
|
|
} else { |
|
215
|
1
|
|
|
|
|
14
|
$next_line = ; |
|
216
|
|
|
|
|
|
|
} |
|
217
|
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
return sub { |
|
219
|
11
|
|
|
11
|
|
21
|
my $sam_line = $next_line; |
|
220
|
11
|
|
|
|
|
40
|
$next_line = ; |
|
221
|
11
|
|
|
|
|
13
|
$line_number++; |
|
222
|
11
|
100
|
|
|
|
21
|
if($sam_line) { |
|
223
|
10
|
|
|
|
|
49
|
return $sam_line, $line_number; |
|
224
|
|
|
|
|
|
|
} else { |
|
225
|
1
|
|
|
|
|
3
|
return (); |
|
226
|
|
|
|
|
|
|
} |
|
227
|
2
|
|
|
|
|
14
|
}; |
|
228
|
|
|
|
|
|
|
} |
|
229
|
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
=head1 GETTERS AND SETTERS |
|
231
|
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
=cut |
|
233
|
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
=head2 header |
|
235
|
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
Description : Getter/setter for attribute header |
|
237
|
|
|
|
|
|
|
ReturnType : none |
|
238
|
|
|
|
|
|
|
Exceptions : none |
|
239
|
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
=cut |
|
241
|
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
sub header { |
|
243
|
4
|
|
|
4
|
1
|
9
|
my $self = shift; |
|
244
|
4
|
|
|
|
|
32
|
return $self->{header}; |
|
245
|
|
|
|
|
|
|
} |
|
246
|
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
=head2 refSeqLength |
|
248
|
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
Description : Return the length of the reference sequence given in argument |
|
250
|
|
|
|
|
|
|
ReturnType : Integer |
|
251
|
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
=cut |
|
253
|
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
sub refSeqLength { |
|
255
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
|
256
|
0
|
|
|
|
|
0
|
my $ref_seq = shift; |
|
257
|
0
|
0
|
|
|
|
0
|
croak("Missing reference sequence name in arguement") unless defined $ref_seq; |
|
258
|
0
|
|
|
|
|
0
|
my @header_lines = split('\n',$self->header); |
|
259
|
0
|
|
|
|
|
0
|
my $ref_seq_len; |
|
260
|
0
|
|
|
|
|
0
|
foreach (@header_lines) { |
|
261
|
0
|
0
|
|
|
|
0
|
if ($_ =~/\@SQ.*SN:$ref_seq/) { |
|
262
|
0
|
|
|
|
|
0
|
($ref_seq_len) = $_ =~ /LN:([^\t]+)/; |
|
263
|
|
|
|
|
|
|
} |
|
264
|
|
|
|
|
|
|
} |
|
265
|
0
|
|
|
|
|
0
|
return $ref_seq_len; |
|
266
|
|
|
|
|
|
|
} |
|
267
|
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
=head2 commandLine |
|
269
|
|
|
|
|
|
|
|
|
270
|
|
|
|
|
|
|
Description : Return crac command line defined in SAM's header |
|
271
|
|
|
|
|
|
|
ReturnType : String |
|
272
|
|
|
|
|
|
|
|
|
273
|
|
|
|
|
|
|
=cut |
|
274
|
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
sub commandLine { |
|
276
|
2
|
|
|
2
|
1
|
3
|
my $self = shift; |
|
277
|
2
|
50
|
|
|
|
7
|
if(defined $self->header) { |
|
278
|
2
|
|
|
|
|
6
|
my @header_lines = split('\n',$self->header); |
|
279
|
2
|
|
|
|
|
3
|
my $command_line; |
|
280
|
2
|
|
|
|
|
7
|
foreach (@header_lines) { |
|
281
|
6
|
100
|
|
|
|
35
|
if ($_ =~/\@PG.*PN:crac/) { |
|
282
|
2
|
|
|
|
|
24
|
($command_line) = $_ =~ /CL:([^\t]+)/; |
|
283
|
|
|
|
|
|
|
} |
|
284
|
|
|
|
|
|
|
} |
|
285
|
2
|
|
|
|
|
8
|
return $command_line; |
|
286
|
|
|
|
|
|
|
} else { |
|
287
|
0
|
|
|
|
|
0
|
return undef; |
|
288
|
|
|
|
|
|
|
} |
|
289
|
|
|
|
|
|
|
} |
|
290
|
|
|
|
|
|
|
|
|
291
|
|
|
|
|
|
|
=head2 getCracArgumentValue |
|
292
|
|
|
|
|
|
|
|
|
293
|
|
|
|
|
|
|
Description : Retrun the value of the specified argument in crac command line |
|
294
|
|
|
|
|
|
|
|
|
295
|
|
|
|
|
|
|
=cut |
|
296
|
|
|
|
|
|
|
|
|
297
|
|
|
|
|
|
|
sub getCracArgumentValue { |
|
298
|
2
|
|
|
2
|
1
|
489
|
my $self = shift; |
|
299
|
2
|
|
|
|
|
4
|
my $argument = shift; |
|
300
|
2
|
|
|
|
|
10
|
my $command_line = $self->commandLine; |
|
301
|
2
|
50
|
|
|
|
7
|
if(defined $command_line) { |
|
302
|
2
|
|
|
|
|
53
|
my ($value) = $command_line =~ /--$argument\s+(\S+)/; |
|
303
|
2
|
|
|
|
|
21
|
return $value; |
|
304
|
|
|
|
|
|
|
} else { |
|
305
|
0
|
|
|
|
|
0
|
return undef; |
|
306
|
|
|
|
|
|
|
} |
|
307
|
|
|
|
|
|
|
} |
|
308
|
|
|
|
|
|
|
|
|
309
|
|
|
|
|
|
|
=head2 hasCracOption |
|
310
|
|
|
|
|
|
|
|
|
311
|
|
|
|
|
|
|
Description : Return true if crac command line has specified a certain option |
|
312
|
|
|
|
|
|
|
|
|
313
|
|
|
|
|
|
|
=cut |
|
314
|
|
|
|
|
|
|
|
|
315
|
|
|
|
|
|
|
sub hasCracOption { |
|
316
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
|
317
|
0
|
|
|
|
|
0
|
my $option = shift; |
|
318
|
0
|
0
|
|
|
|
0
|
croak("Missing argument") unless defined $option; |
|
319
|
0
|
0
|
|
|
|
0
|
if(defined $self->commandLine) { |
|
320
|
0
|
|
|
|
|
0
|
return $self->commandLine =~ /--$option/; |
|
321
|
|
|
|
|
|
|
} else { |
|
322
|
0
|
|
|
|
|
0
|
return 0; |
|
323
|
|
|
|
|
|
|
} |
|
324
|
|
|
|
|
|
|
} |
|
325
|
|
|
|
|
|
|
|
|
326
|
|
|
|
|
|
|
=head1 PRIVATE METHODS |
|
327
|
|
|
|
|
|
|
|
|
328
|
|
|
|
|
|
|
=head2 init (private) |
|
329
|
|
|
|
|
|
|
|
|
330
|
|
|
|
|
|
|
Description : Initialization method |
|
331
|
|
|
|
|
|
|
ReturnType : none |
|
332
|
|
|
|
|
|
|
Exceptions : none |
|
333
|
|
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
=cut |
|
335
|
|
|
|
|
|
|
|
|
336
|
|
|
|
|
|
|
sub init { |
|
337
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
|
338
|
1
|
|
|
|
|
6
|
my $f_it = $self->iteratorFile; |
|
339
|
1
|
|
|
|
|
3
|
my $header; |
|
340
|
1
|
|
|
|
|
4
|
while(my ($line) = $f_it->()) { |
|
341
|
4
|
100
|
|
|
|
15
|
if($line =~ /^@/) { |
|
342
|
3
|
|
|
|
|
36
|
$header .= $line; |
|
343
|
|
|
|
|
|
|
} else { |
|
344
|
1
|
|
|
|
|
2
|
last; |
|
345
|
|
|
|
|
|
|
} |
|
346
|
|
|
|
|
|
|
} |
|
347
|
1
|
|
|
|
|
8
|
$self->{header} = $header; |
|
348
|
|
|
|
|
|
|
} |
|
349
|
|
|
|
|
|
|
|
|
350
|
|
|
|
|
|
|
=head1 AUTHORS |
|
351
|
|
|
|
|
|
|
|
|
352
|
|
|
|
|
|
|
Jerome AUDOUX ELE. |
|
353
|
|
|
|
|
|
|
|
|
354
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
355
|
|
|
|
|
|
|
|
|
356
|
|
|
|
|
|
|
Copyright (C) 2012-2013 -- IRB/INSERM |
|
357
|
|
|
|
|
|
|
(Institut de Recherche en Biothérapie / |
|
358
|
|
|
|
|
|
|
Institut National de la Santé et de la |
|
359
|
|
|
|
|
|
|
Recherche Médicale) |
|
360
|
|
|
|
|
|
|
LIRMM/UM2 |
|
361
|
|
|
|
|
|
|
(Laboratoire d'Informatique, de Robotique et de |
|
362
|
|
|
|
|
|
|
Microélectronique de Montpellier / |
|
363
|
|
|
|
|
|
|
Université de Montpellier 2) |
|
364
|
|
|
|
|
|
|
|
|
365
|
|
|
|
|
|
|
=head2 FRENCH |
|
366
|
|
|
|
|
|
|
|
|
367
|
|
|
|
|
|
|
Ce fichier fait partie du Pipeline de traitement de données NGS de la |
|
368
|
|
|
|
|
|
|
plateforme ATGC labélisée par le GiS IBiSA. |
|
369
|
|
|
|
|
|
|
|
|
370
|
|
|
|
|
|
|
Ce logiciel est régi par la licence CeCILL soumise au droit français et |
|
371
|
|
|
|
|
|
|
respectant les principes de diffusion des logiciels libres. Vous pouvez |
|
372
|
|
|
|
|
|
|
utiliser, modifier et/ou redistribuer ce programme sous les conditions de |
|
373
|
|
|
|
|
|
|
la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA sur |
|
374
|
|
|
|
|
|
|
le site "http://www.cecill.info". |
|
375
|
|
|
|
|
|
|
|
|
376
|
|
|
|
|
|
|
=head2 ENGLISH |
|
377
|
|
|
|
|
|
|
|
|
378
|
|
|
|
|
|
|
This File is part of the NGS data processing Pipeline of the ATGC |
|
379
|
|
|
|
|
|
|
accredited by the IBiSA GiS. |
|
380
|
|
|
|
|
|
|
|
|
381
|
|
|
|
|
|
|
This software is governed by the CeCILL license under French law and |
|
382
|
|
|
|
|
|
|
abiding by the rules of distribution of free software. You can use, |
|
383
|
|
|
|
|
|
|
modify and/ or redistribute the software under the terms of the CeCILL |
|
384
|
|
|
|
|
|
|
license as circulated by CEA, CNRS and INRIA at the following URL |
|
385
|
|
|
|
|
|
|
"http://www.cecill.info". |
|
386
|
|
|
|
|
|
|
|
|
387
|
|
|
|
|
|
|
=cut |
|
388
|
|
|
|
|
|
|
|
|
389
|
|
|
|
|
|
|
1; |