Bio/Tools/GuessSeqFormat.pm

filter: Statementstmt 81.3% 122 / 150 Branchbran 65.0% 26 / 40 Conditioncond 58.4% 121 / 207 MC/DCmcdc 8.2% 8 / 97 Subroutinesub 92.8% 39 / 42 Podpod 100% 5 / 5 totaltotal 59.3% 321 / 541 CC 90 SCAR 19.0
CC
90
Cov
68%
guess
21.2
_possibly_genbank
9.1
_possibly_phylip
8.5
CRAP 6.7
« Bio/DB/GFF/Util/Binning.pm ↑ Summary Bio/Annotation/Reference.pm »
1 #------------------------------------------------------------------
2 #
3 # BioPerl module Bio::Tools::GuessSeqFormat
4 #
5 # Please direct questions and support issues to <bioperl-l@bioperl.org>
6 #
7 # Cared for by Andreas Kähäri, andreas.kahari@ebi.ac.uk
8 #
9 # You may distribute this module under the same terms as perl itself
10 #------------------------------------------------------------------
11  
12 =encoding utf-8
13  
14 =head1 NAME
15  
16 Bio::Tools::GuessSeqFormat - Module for determining the sequence
17 format of the contents of a file, a string, or through a
18 filehandle.
19  
20 =head1 SYNOPSIS
21  
22 # To guess the format of a flat file, given a filename:
23 my $guesser = Bio::Tools::GuessSeqFormat->new( -file => $filename );
24 my $format = $guesser->guess;
25  
26 # To guess the format from an already open filehandle:
27 my $guesser = Bio::Tools::GuessSeqFormat->new( -fh => $filehandle );
28 my $format = $guesser->guess;
29 # The filehandle will be returned to its original position. Note that this
30 # filehandle can be STDIN.
31  
32 # To guess the format of one or several lines of text (with
33 # embedded newlines):
34 my $guesser = Bio::Tools::GuessSeqFormat->new( -text => $linesoftext );
35 my $format = $guesser->guess;
36  
37 # To create a Bio::Tools::GuessSeqFormat object and set the
38 # filename, filehandle, or line to parse afterwards:
39 my $guesser = Bio::Tools::GuessSeqFormat->new();
40 $guesser->file($filename);
41 $guesser->fh($filehandle);
42 $guesser->text($linesoftext);
43  
44 # To guess in one go, given e.g. a filename:
45 my $format = Bio::Tools::GuessSeqFormat->new( -file => $filename )->guess;
46  
47 =head1 DESCRIPTION
48  
49 Bio::Tools::GuessSeqFormat tries to guess the format ("swiss",
50 "pir", "fasta" etc.) of the sequence or MSA in a file, in a
51 scalar, or through a filehandle.
52  
53 The guess() method of a Bio::Tools::GuessSeqFormat object will
54 examine the data, line by line, until it finds a line to which
55 only one format can be assigned. If no conclusive guess can be
56 made, undef is returned.
57  
58 If the Bio::Tools::GuessSeqFormat object is given a filehandle,
59 e.g. STDIN, it will be restored to its original position on
60 return from the guess() method.
61  
62 =head2 Formats
63  
64 Tests are currently implemented for the following formats:
65  
66 =over
67  
68 =item *
69  
70 ACeDB ("ace")
71  
72 =item *
73  
74 Blast ("blast")
75  
76 =item *
77  
78 ClustalW ("clustalw")
79  
80 =item *
81  
82 Codata ("codata")
83  
84 =item *
85  
86 EMBL ("embl")
87  
88 =item *
89  
90 FastA sequence ("fasta")
91  
92 =item *
93  
94 FastQ sequence ("fastq")
95  
96 =item *
97  
98 FastXY/FastA alignment ("fastxy")
99  
100 =item *
101  
102 Game XML ("game")
103  
104 =item *
105  
106 GCG ("gcg")
107  
108 =item *
109  
110 GCG Blast ("gcgblast")
111  
112 =item *
113  
114 GCG FastA ("gcgfasta")
115  
116 =item *
117  
118 GDE ("gde")
119  
120 =item *
121  
122 Genbank ("genbank")
123  
124 =item *
125  
126 Genscan ("genscan")
127  
128 =item *
129  
130 GFF ("gff")
131  
132 =item *
133  
134 HMMER ("hmmer")
135  
136 =item *
137  
138 PAUP/NEXUS ("nexus")
139  
140 =item *
141  
142 Phrap assembly file ("phrap")
143  
144 =item *
145  
146 NBRF/PIR ("pir")
147  
148 =item *
149  
150 Mase ("mase")
151  
152 =item *
153  
154 Mega ("mega")
155  
156 =item *
157  
158 GCG/MSF ("msf")
159  
160 =item *
161  
162 Pfam ("pfam")
163  
164 =item *
165  
166 Phylip ("phylip")
167  
168 =item *
169  
170 Prodom ("prodom")
171  
172 =item *
173  
174 Raw ("raw")
175  
176 =item *
177  
178 RSF ("rsf")
179  
180 =item *
181  
182 Selex ("selex")
183  
184 =item *
185  
186 Stockholm ("stockholm")
187  
188 =item *
189  
190 Swissprot ("swiss")
191  
192 =item *
193  
194 Tab ("tab")
195  
196 =item *
197  
198 Variant Call Format ("vcf")
199  
200 =back
201  
202 =head1 FEEDBACK
203  
204 =head2 Mailing Lists
205  
206 User feedback is an integral part of the evolution of this and
207 other Bioperl modules. Send your comments and suggestions
208 preferably to one of the Bioperl mailing lists. Your
209 participation is much appreciated.
210  
211 bioperl-l@bioperl.org - General discussion
212 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
213  
214 =head2 Support
215  
216 Please direct usage questions or support issues to the mailing list:
217  
218 I<bioperl-l@bioperl.org>
219  
220 rather than to the module maintainer directly. Many experienced and
221 reponsive experts will be able look at the problem and quickly
222 address it. Please include a thorough description of the problem
223 with code and data examples if at all possible.
224  
225 =head2 Reporting Bugs
226  
227 Report bugs to the Bioperl bug tracking system to help us
228 keep track the bugs and their resolution. Bug reports can be
229 submitted via the web:
230  
231 https://github.com/bioperl/bioperl-live/issues
232  
233 =head1 AUTHOR
234  
235 Andreas KE<228>hE<228>ri, andreas.kahari@ebi.ac.uk
236  
237 =head1 CONTRIBUTORS
238  
239 Heikki LehvE<228>slaiho, heikki-at-bioperl-dot-org
240 Mark A. Jensen, maj-at-fortinbras-dot-us
241  
242 =cut
243  
244  
245 package Bio::Tools::GuessSeqFormat;
246 147 $Bio::Tools::GuessSeqFormat::VERSION = '1.7.8';
247 147 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
248 147 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
249  
250  
251 147 ▶use base qw(Bio::Root::Root);
Subroutine BEGIN: called CC=1 SCAR=0.0
252  
253 =head1 METHODS
254  
255 Methods available to Bio::Tools::GuessSeqFormat objects
256 are described below. Methods with names beginning with an
257 underscore are considered to be internal.
258  
259 =cut
260  
261 =head2 new
262  
263 Title : new
264 Usage : $guesser = Bio::Tools::GuessSeqFormat->new( ... );
265 Function : Creates a new object.
266 Example : See SYNOPSIS.
267 Returns : A new object.
268 Arguments : -file The filename of the file whose format is to
269 be guessed, e.g. STDIN, or
270 -fh An already opened filehandle from which a text
271 stream may be read, or
272 -text A scalar containing one or several lines of
273 text with embedded newlines.
274  
275 If more than one of the above arguments are given, they
276 are tested in the order -text, -file, -fh, and the first
277 available argument will be used.
278  
279 =cut
280  
281 sub new
282 11 ▶{
Subroutine new: called CC=2 SCAR=6.9
Pod documented
283 11 my $class = shift;
284 11 my @args = @_;
285  
286 11 my $self = $class->SUPER::new(@args);
287  
288 11 my $attr;
289 my $value;
290  
291 11 ▶ while (@args) {
Branch: 1 branch
BranchTrueFalseTotal
if (@args) 10 11 21
292 10 $attr = shift @args;
293 10 $attr = lc $attr;
294 10 $value = shift @args;
295 10 $self->{$attr} = $value;
296 }
297  
298 11 return $self;
299 }
300  
301 =head2 file
302  
303 Title : file
304 Usage : $guesser->file($filename);
305 $filename = $guesser->file;
306 Function : Gets or sets the current filename associated with
307 an object.
308 Returns : The new filename.
309 Arguments : The filename of the file whose format is to be
310 guessed.
311  
312 A call to this method will clear the current filehandle and
313 the current lines of text associated with the object.
314  
315 =cut
316  
317 sub file
318 0 ▶{
Subroutine file: not called CC=2 SCAR=17.9
Pod documented
319 # Sets and/or returns the filename to use.
320 0 my $self = shift;
321 0 my $file = shift;
322  
323 0 ▶ if (defined $file) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $file) 0 0 0
324 # Set the active filename, and clear the filehandle and
325 # text line, if present.
326 0 $self->{-file} = $file;
327 0 $self->{-fh} = $self->{-text} = undef;
328 }
329  
330 0 return $self->{-file};
331 }
332  
333 =head2 fh
334  
335 Title : fh
336 Usage : $guesser->fh($filehandle);
337 $filehandle = $guesser->fh;
338 Function : Gets or sets the current filehandle associated with
339 an object.
340 Returns : The new filehandle.
341 Arguments : An already opened filehandle from which a text
342 stream may be read.
343  
344 A call to this method will clear the current filename and
345 the current lines of text associated with the object.
346  
347 =cut
348  
349 sub fh
350 0 ▶{
Subroutine fh: not called CC=2 SCAR=17.9
Pod documented
351 # Sets and/or returns the filehandle to use.
352 0 my $self = shift;
353 0 my $fh = shift;
354  
355 0 ▶ if (defined $fh) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $fh) 0 0 0
356 # Set the active filehandle, and clear the filename and
357 # text line, if present.
358 0 $self->{-fh} = $fh;
359 0 $self->{-file} = $self->{-text} = undef;
360 }
361  
362 0 return $self->{-fh};
363 }
364  
365  
366 =head2 text
367  
368 Title : text
369 Usage : $guesser->text($linesoftext);
370 $linesofext = $guesser->text;
371 Function : Gets or sets the current text associated with an
372 object.
373 Returns : The new lines of texts.
374 Arguments : A scalar containing one or several lines of text,
375 including embedded newlines.
376  
377 A call to this method will clear the current filename and
378 the current filehandle associated with the object.
379  
380 =cut
381  
382 sub text
383 0 ▶{
Subroutine text: not called CC=2 SCAR=17.9
Pod documented
384 # Sets and/or returns the text lines to use.
385 0 my $self = shift;
386 0 my $text = shift;
387  
388 0 ▶ if (defined $text) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $text) 0 0 0
389 # Set the active text lines, and clear the filehandle
390 # and filename, if present.
391 0 $self->{-text} = $text;
392 0 $self->{-fh} = $self->{-file} = undef;
393 }
394  
395 0 return $self->{-text};
396 }
397  
398 =head2 guess
399  
400 Title : guess
401 Usage : $format = $guesser->guess;
402 @format = $guesser->guess; # if given a line of text
403 Function : Guesses the format of the data accociated with the
404 object.
405 Returns : A format string such as "swiss" or "pir". If a
406 format can not be found, undef is returned.
407 Arguments : None.
408  
409 If the object is associated with a filehandle, the position
410 of the filehandle will be returned to its original position
411 before the method returns.
412  
413 =cut
414  
415 147 our %formats = (
416 ace => { test => \&_possibly_ace },
417 blast => { test => \&_possibly_blast },
418 bowtie => { test => \&_possibly_bowtie },
419 clustalw => { test => \&_possibly_clustalw },
420 codata => { test => \&_possibly_codata },
421 embl => { test => \&_possibly_embl },
422 fasta => { test => \&_possibly_fasta },
423 fastq => { test => \&_possibly_fastq },
424 fastxy => { test => \&_possibly_fastxy },
425 game => { test => \&_possibly_game },
426 gcg => { test => \&_possibly_gcg },
427 gcgblast => { test => \&_possibly_gcgblast },
428 gcgfasta => { test => \&_possibly_gcgfasta },
429 gde => { test => \&_possibly_gde },
430 genbank => { test => \&_possibly_genbank },
431 genscan => { test => \&_possibly_genscan },
432 gff => { test => \&_possibly_gff },
433 hmmer => { test => \&_possibly_hmmer },
434 nexus => { test => \&_possibly_nexus },
435 mase => { test => \&_possibly_mase },
436 mega => { test => \&_possibly_mega },
437 msf => { test => \&_possibly_msf },
438 pfam => { test => \&_possibly_pfam },
439 phrap => { test => \&_possibly_phrap },
440 phylip => { test => \&_possibly_phylip },
441 pir => { test => \&_possibly_pir },
442 prodom => { test => \&_possibly_prodom },
443 raw => { test => \&_possibly_raw },
444 rsf => { test => \&_possibly_rsf },
445 selex => { test => \&_possibly_selex },
446 stockholm => { test => \&_possibly_stockholm },
447 swiss => { test => \&_possibly_swiss },
448 tab => { test => \&_possibly_tab },
449 vcf => { test => \&_possibly_vcf },
450 );
451  
452 sub guess
453 10 ▶{
Subroutine guess: called CC=17 SCAR=30.5
Pod documented
454 10 my $self = shift;
455  
456 10 ▶ while (my ($fmt_key) = each (%formats)) {
Branch: 1 branch
BranchTrueFalseTotal
if (my($fmt_key) = each %Bio::Tools::GuessSeqFormat::formats) 340 10 350
457 340 $formats{$fmt_key}{fmt_string} = $fmt_key;
458 }
459  
460 10 my $fh;
461 my $start_pos;
462 10 ▶ if (defined $self->{-text}) {
Branch: 3 branches
BranchTrueFalseTotal
if (defined $self->{'-text'}) { } 2 8 10
elsif (defined $self->{'-file'}) { } 6 2 8
elsif (defined $self->{'-fh'}) { } 2 0 2
463 # Break the text into separate lines.
464 2 my $text = $self->{-text};
465 2 ▶ open $fh, '<', \$text or $self->throw("Could not read from string: $!");
Branch: 1 branch
BranchTrueFalseTotal
open $fh, "<", \$text or $self->throw("Could not read from string: $!") 2 0 2
466  
467 } elsif (defined $self->{-file}) {
468 # If given a filename, open the file.
469 6 my $file = $self->{-file};
470 6 ▶ open $fh, '<', $file or $self->throw("Could not read file '$file': $!");
Branch: 1 branch
BranchTrueFalseTotal
open $fh, "<", $file or $self->throw("Could not read file '${file}': $!") 6 0 6
471  
472 } elsif (defined $self->{-fh}) {
473 # If given a filehandle, get the current position in the stream.
474 2 $fh = $self->{-fh};
475 2 ▶ if (not seek $fh, 0, 1) { # seek to current position to determine seekability
Branch: 1 branch
BranchTrueFalseTotal
unless (seek $fh, 0, 1) 0 2 2
476 # Work around non-seekable filehandles if IO::Scalar is available
477 # (adapted from http://www.perlmonks.org/?node_id=33587)
478 # IO::Mark may be an option for very large streams?
479 $self->throw("Need IO::Scalar to guess from unseekable filehandles")
480 0 ▶ if not eval { require IO::Scalar };
Branch: 1 branch
BranchTrueFalseTotal
unless eval { do { require IO::Scalar } } 0 0 0
481 0 my $data;
482 0 { local $/; $data = <$fh>; $.-- }; # copy raw data from fh
483 0 tie *$fh, 'IO::Scalar', my $s; # replace fh by scalar-tied fh
484 0 print $fh $data; # write raw data to tied fh
485 0 seek $fh, 0, 0; # return to start of tied fh
486 }
487 2 $start_pos = tell $fh;
488 }
489  
490 10 my $done = 0;
491 10 my $lineno = 0;
492 10 my $guess;
493 10 ▶ while (!$done) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($done) 42 8 50
494 42 my $line; # The next line of the file.
495 42 my $match = 0; # Number of possible formats of this line.
496  
497 42 ▶ last if (!defined($line = <$fh>));
Branch: 1 branch
BranchTrueFalseTotal
unless defined($line = readline $fh) 2 40 42
498 40 ▶ next if ($line =~ /^\s*$/); # Skip white and empty lines.
Branch: 1 branch
BranchTrueFalseTotal
if $line =~ /^\s*$/ 0 40 40
499 40 chomp $line;
500 40 $line =~ s/\r$//; # Fix for DOS files on Unix.
501 40 ++$lineno;
502  
503 40 ▶ while (my ($fmt_key, $fmt) = each (%formats)) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %Bio::Tools::GuessSeqFormat::formats) 1360 40 1400
504 1360 ▶ if ($fmt->{test}($line, $lineno)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($fmt->{"test"}->($line, $lineno)) 8 1352 1360
505 8 ++$match;
506 8 $guess = $fmt->{fmt_string};
507 }
508 }
509  
510 # We're done if there was only one match.
511 40 $done = ($match == 1);
512 }
513  
514 10 ▶ if (defined $self->{-fh}) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $self->{'-fh'}) { } 2 8 10
515 # Go back to original position in filehandle
516 2 ▶ seek $fh, $start_pos, 0 or $self->throw("Could not reset filehandle $fh: $!");
Branch: 1 branch
BranchTrueFalseTotal
seek $fh, $start_pos, 0 or $self->throw("Could not reset filehandle ${fh}: $!") 2 0 2
517 } else {
518 # Close the filehandle we opened
519 8 close $fh;
520 }
521 10 ▶ return ($done ? $guess : undef);
Branch: 1 branch
BranchTrueFalseTotal
$done ? : 8 2 10
522 }
523  
524 =head1 HELPER SUBROUTINES
525  
526 All helper subroutines will, given a line of text and the line
527 number of the same line, return 1 if the line possibly is from a
528 file of the type that they perform a test of.
529  
530 A zero return value does not mean that the line is not part
531 of a certain type of file, just that the test did not find any
532 characteristics of that type of file in the line.
533  
534 =head2 _possibly_ace
535  
536 From bioperl test data, and from
537 "http://www.isrec.isb-sib.ch/DEA/module8/B_Stevenson/Practicals/transcriptome_recon/transcriptome_recon.html".
538  
539 =cut
540  
541 sub _possibly_ace
542 40 ▶{
Subroutine _possibly_ace: called CC=1 SCAR=0.0
543 40 my ($line, $lineno) = (shift, shift);
544 40 return ($line =~ /^(?:Sequence|Peptide|DNA|Protein) [":]/);
545 }
546  
547 =head2 _possibly_blast
548  
549 From various blast results.
550  
551 =cut
552  
553 sub _possibly_blast
554 40 ▶{
Subroutine _possibly_blast: called CC=2 SCAR=7.1
555 40 my ($line, $lineno) = (shift, shift);
556 40 ▶ return ($lineno == 1 &&
Condition66%2/3
$lineno == 1 && $line =~ /^[[:upper:]]*BLAST[[:upper:]]*.*\[.*\]$/
!ll&&!rl&&r
30100
MC/DC0%0/2
$lineno == 1 && $line =~ /^[[:upper:]]*BLAST[[:upper:]]*.*\[.*\]$/
$lineno == 1 $line =~ /^[[:upper:]]*BLAST[[:upper:]]*.*\[.*\]$/
Truth table66%2/3
A && B
A= $lineno == 1B= $line =~ /^[[:upper:]]*BLAST[[:upper:]]*.*\[.*\]$/
ABresult
0X0
100
111
557 $line =~ /^[[:upper:]]*BLAST[[:upper:]]*.*\[.*\]$/);
558 }
559  
560 =head2 _possibly_bowtie
561  
562 Contributed by kortsch.
563  
564 =cut
565  
566 sub _possibly_bowtie
567 40 ▶{
Subroutine _possibly_bowtie: called CC=2 SCAR=8.1
568 40 my ($line, $lineno) = (shift, shift);
569 40 ▶ return ($line =~ /^[[:graph:]]+\t[-+]\t[[:graph:]]+\t\d+\t([[:alpha:]]+)\t([[:graph:]]+)\t\d+\t[[:graph:]]?/)
Condition33%1/3
$line =~ /^[[:graph:]]+\t[-+]\t[[:graph:]]+\t\d+\t([[:alpha:]]+)\t([[:graph:]]+)\t\d+\t[[:graph:]]?/ && length $1 == length $2
!ll&&!rl&&r
4000
MC/DC0%0/2
$line =~ /^[[:graph:]]+\t[-+]\t[[:graph:]]+\t\d+\t([[:alpha:]]+)\t([[:graph:]]+)\t\d+\t[[:graph:]]?/ && length $1 == length $2
$line =~ /^[[:graph:]]+\t[-+]\t[[:graph:]]+\t\d+\t([[:alpha:]]+)\t([[:graph:]]+)\t\d+\t[[:graph:]]?/ length $1 == length $2
Truth table33%1/3
A && B
A= $line =~ /^[[:graph:]]+\t[-+]\t[[:graph:]]+\t\d+\t([[:alpha:]]+)\t([[:graph:]]+)\t\d+\t[[:graph:]]?/B= length $1 == length $2
ABresult
0X0
100
111
570 && length($1)==length($2);
571 }
572  
573 =head2 _possibly_clustalw
574  
575 From "http://www.ebi.ac.uk/help/formats.html".
576  
577 =cut
578  
579 sub _possibly_clustalw
580 40 ▶{
Subroutine _possibly_clustalw: called CC=2 SCAR=6.9
581 40 my ($line, $lineno) = (shift, shift);
582 40 ▶ return ($lineno == 1 && $line =~ /CLUSTAL/);
Condition100%3/3
$lineno == 1 && $line =~ /CLUSTAL/
!ll&&!rl&&r
3091
MC/DC100%2/2
$lineno == 1 && $line =~ /CLUSTAL/
$lineno == 1 $line =~ /CLUSTAL/
Truth table100%3/3
A && B
A= $lineno == 1B= $line =~ /CLUSTAL/
ABresult
0X0
100
111
583 }
584  
585 =head2 _possibly_codata
586  
587 From "http://www.ebi.ac.uk/help/formats.html".
588  
589 =cut
590  
591 sub _possibly_codata
592 40 ▶{
Subroutine _possibly_codata: called CC=5 SCAR=19.4
593 40 my ($line, $lineno) = (shift, shift);
594 40 ▶ return (($lineno == 1 && $line =~ /^ENTRY/) ||
Condition50%6/12
$lineno == 1 && $line =~ /^ENTRY/ || $lineno == 2 && $line =~ /^SEQUENCE/ || $line =~ m[^(?:ENTRY|SEQUENCE|///)]
l!l&&r!l&&!r
0040
$lineno == 1 and $line =~ /^ENTRY/ or $lineno == 2 and $line =~ /^SEQUENCE/
l!l&&r!l&&!r
0040
$lineno == 1 and $line =~ /^ENTRY/
!ll&&!rl&&r
30100
$lineno == 2 and $line =~ /^SEQUENCE/
!ll&&!rl&&r
3820
MC/DC0%0/5
$lineno == 1 && $line =~ /^ENTRY/ || $lineno == 2 && $line =~ /^SEQUENCE/ || $line =~ m[^(?:ENTRY|SEQUENCE|///)]
$lineno == 1 $line =~ /^ENTRY/ $lineno == 2 $line =~ /^SEQUENCE/ $line =~ m[^(?:ENTRY|SEQUENCE|///)]
Truth table27%3/11
A and B or C and D || E
A= $lineno == 1B= $line =~ /^ENTRY/C= $lineno == 2D= $line =~ /^SEQUENCE/E= $line =~ m[^(?:ENTRY|SEQUENCE|///)]
ABCDEresult
11XXX1
0X11X1
1011X1
0X0X11
0X1011
100X11
101011
0X0X00
0X1000
100X00
101000
595 ($lineno == 2 && $line =~ /^SEQUENCE/) ||
596 $line =~ m{^(?:ENTRY|SEQUENCE|///)});
597 }
598  
599 =head2 _possibly_embl
600  
601 From
602 "http://www.ebi.ac.uk/embl/Documentation/User_manual/usrman.html#3.3".
603  
604 =cut
605  
606 sub _possibly_embl
607 40 ▶{
Subroutine _possibly_embl: called CC=3 SCAR=11.0
608 40 my ($line, $lineno) = (shift, shift);
609 40 ▶ return ($lineno == 1 && $line =~ /^ID / && $line =~ /BP\.$/);
Condition83%5/6
$lineno == 1 && $line =~ /^ID / && $line =~ /BP\.$/
!ll&&!rl&&r
3820
$lineno == 1 and $line =~ /^ID /
!ll&&!rl&&r
3082
MC/DC0%0/3
$lineno == 1 && $line =~ /^ID / && $line =~ /BP\.$/
$lineno == 1 $line =~ /^ID / $line =~ /BP\.$/
Truth table75%3/4
A and B && C
A= $lineno == 1B= $line =~ /^ID /C= $line =~ /BP\.$/
ABCresult
0XX0
10X0
1100
1111
610 }
611  
612 =head2 _possibly_fasta
613  
614 From "http://www.ebi.ac.uk/help/formats.html".
615  
616 =cut
617  
618 sub _possibly_fasta
619 40 ▶{
Subroutine _possibly_fasta: called CC=3 SCAR=11.4
620 40 my ($line, $lineno) = (shift, shift);
621 40 ▶ return (($lineno != 1 && $line =~ /^[A-IK-NP-Z]+$/i) ||
Condition66%4/6
$lineno != 1 && $line =~ /^[A-IK-NP-Z]+$/i || $line =~ /^>\s*\w/
l!l&&r!l&&!r
0436
$lineno != 1 and $line =~ /^[A-IK-NP-Z]+$/i
!ll&&!rl&&r
10300
MC/DC33%1/3
$lineno != 1 && $line =~ /^[A-IK-NP-Z]+$/i || $line =~ /^>\s*\w/
$lineno != 1 $line =~ /^[A-IK-NP-Z]+$/i $line =~ /^>\s*\w/
Truth table60%3/5
A and B || C
A= $lineno != 1B= $line =~ /^[A-IK-NP-Z]+$/iC= $line =~ /^>\s*\w/
ABCresult
11X1
0X11
1011
0X00
1000
622 $line =~ /^>\s*\w/);
623 }
624  
625 =head2 _possibly_fastq
626  
627 From bioperl test data.
628  
629 =cut
630  
631 sub _possibly_fastq
632 40 ▶{
Subroutine _possibly_fastq: called CC=4 SCAR=15.6
633 40 my ($line, $lineno) = (shift, shift);
634 40 ▶ return ( ($lineno == 1 && $line =~ /^@/) ||
Condition55%5/9
$lineno == 1 && $line =~ /^@/ || $lineno == 3 && $line =~ /^\+/
l!l&&r!l&&!r
0040
$lineno == 1 and $line =~ /^@/
!ll&&!rl&&r
30100
$lineno == 3 and $line =~ /^\+/
!ll&&!rl&&r
3820
MC/DC0%0/4
$lineno == 1 && $line =~ /^@/ || $lineno == 3 && $line =~ /^\+/
$lineno == 1 $line =~ /^@/ $lineno == 3 $line =~ /^\+/
Truth table42%3/7
A and B || C and D
A= $lineno == 1B= $line =~ /^@/C= $lineno == 3D= $line =~ /^\+/
ABCDresult
11XX1
0X111
10111
0X0X0
0X100
100X0
10100
635 ($lineno == 3 && $line =~ /^\+/) );
636 }
637  
638 =head2 _possibly_fastxy
639  
640 From bioperl test data.
641  
642 =cut
643  
644 sub _possibly_fastxy
645 40 ▶{
Subroutine _possibly_fastxy: called CC=4 SCAR=15.6
646 40 my ($line, $lineno) = (shift, shift);
647 40 ▶ return (($lineno == 1 && $line =~ /^ FAST(?:XY|A)/) ||
Condition55%5/9
$lineno == 1 && $line =~ /^ FAST(?:XY|A)/ || $lineno == 2 && $line =~ /^ version \d/
l!l&&r!l&&!r
0040
$lineno == 1 and $line =~ /^ FAST(?:XY|A)/
!ll&&!rl&&r
30100
$lineno == 2 and $line =~ /^ version \d/
!ll&&!rl&&r
3820
MC/DC0%0/4
$lineno == 1 && $line =~ /^ FAST(?:XY|A)/ || $lineno == 2 && $line =~ /^ version \d/
$lineno == 1 $line =~ /^ FAST(?:XY|A)/ $lineno == 2 $line =~ /^ version \d/
Truth table42%3/7
A and B || C and D
A= $lineno == 1B= $line =~ /^ FAST(?:XY|A)/C= $lineno == 2D= $line =~ /^ version \d/
ABCDresult
11XX1
0X111
10111
0X0X0
0X100
100X0
10100
648 ($lineno == 2 && $line =~ /^ version \d/));
649 }
650  
651 =head2 _possibly_game
652  
653 From bioperl testdata.
654  
655 =cut
656  
657 sub _possibly_game
658 40 ▶{
Subroutine _possibly_game: called CC=1 SCAR=0.0
659 40 my ($line, $lineno) = (shift, shift);
660 40 return ($line =~ /^<!DOCTYPE game/);
661 }
662  
663 =head2 _possibly_gcg
664  
665 From bioperl, Bio::SeqIO::gcg.
666  
667 =cut
668  
669 sub _possibly_gcg
670 40 ▶{
Subroutine _possibly_gcg: called CC=1 SCAR=0.0
671 40 my ($line, $lineno) = (shift, shift);
672 40 return ($line =~ /Length: .*Type: .*Check: .*\.\.$/);
673 }
674  
675 =head2 _possibly_gcgblast
676  
677 From bioperl testdata.
678  
679 =cut
680  
681 sub _possibly_gcgblast
682 40 ▶{
Subroutine _possibly_gcgblast: called CC=4 SCAR=15.6
683 40 my ($line, $lineno) = (shift, shift);
684 40 ▶ return (($lineno == 1 && $line =~ /^!!SEQUENCE_LIST/) ||
Condition55%5/9
$lineno == 1 && $line =~ /^!!SEQUENCE_LIST/ || $lineno == 2 && $line =~ /^[[:upper:]]*BLAST[[:upper:]]*.*\[.*\]$/
l!l&&r!l&&!r
0040
$lineno == 1 and $line =~ /^!!SEQUENCE_LIST/
!ll&&!rl&&r
30100
$lineno == 2 and $line =~ /^[[:upper:]]*BLAST[[:upper:]]*.*\[.*\]$/
!ll&&!rl&&r
3820
MC/DC0%0/4
$lineno == 1 && $line =~ /^!!SEQUENCE_LIST/ || $lineno == 2 && $line =~ /^[[:upper:]]*BLAST[[:upper:]]*.*\[.*\]$/
$lineno == 1 $line =~ /^!!SEQUENCE_LIST/ $lineno == 2 $line =~ /^[[:upper:]]*BLAST[[:upper:]]*.*\[.*\]$/
Truth table42%3/7
A and B || C and D
A= $lineno == 1B= $line =~ /^!!SEQUENCE_LIST/C= $lineno == 2D= $line =~ /^[[:upper:]]*BLAST[[:upper:]]*.*\[.*\]$/
ABCDresult
11XX1
0X111
10111
0X0X0
0X100
100X0
10100
685 ($lineno == 2 &&
686 $line =~ /^[[:upper:]]*BLAST[[:upper:]]*.*\[.*\]$/));
687 }
688  
689 =head2 _possibly_gcgfasta
690  
691 From bioperl testdata.
692  
693 =cut
694  
695 sub _possibly_gcgfasta
696 40 ▶{
Subroutine _possibly_gcgfasta: called CC=4 SCAR=15.6
697 40 my ($line, $lineno) = (shift, shift);
698 40 ▶ return (($lineno == 1 && $line =~ /^!!SEQUENCE_LIST/) ||
Condition55%5/9
$lineno == 1 && $line =~ /^!!SEQUENCE_LIST/ || $lineno == 2 && $line =~ /FASTA/
l!l&&r!l&&!r
0040
$lineno == 1 and $line =~ /^!!SEQUENCE_LIST/
!ll&&!rl&&r
30100
$lineno == 2 and $line =~ /FASTA/
!ll&&!rl&&r
3820
MC/DC0%0/4
$lineno == 1 && $line =~ /^!!SEQUENCE_LIST/ || $lineno == 2 && $line =~ /FASTA/
$lineno == 1 $line =~ /^!!SEQUENCE_LIST/ $lineno == 2 $line =~ /FASTA/
Truth table42%3/7
A and B || C and D
A= $lineno == 1B= $line =~ /^!!SEQUENCE_LIST/C= $lineno == 2D= $line =~ /FASTA/
ABCDresult
11XX1
0X111
10111
0X0X0
0X100
100X0
10100
699 ($lineno == 2 && $line =~ /FASTA/));
700 }
701  
702 =head2 _possibly_gde
703  
704 From "http://www.ebi.ac.uk/help/formats.html".
705  
706 =cut
707  
708 sub _possibly_gde
709 40 ▶{
Subroutine _possibly_gde: called CC=2 SCAR=8.1
710 40 my ($line, $lineno) = (shift, shift);
711 40 ▶ return ($line =~ /^[{}]$/ ||
Condition33%1/3
$line =~ /^[{}]$/ || $line =~ /^(?:name|longname|sequence-ID| creation-date|direction|strandedness| type|offset|group-ID|creator|descrip| comment|sequence)/x
l!l&&r!l&&!r
0040
MC/DC0%0/2
$line =~ /^[{}]$/ || $line =~ /^(?:name|longname|sequence-ID| creation-date|direction|strandedness| type|offset|group-ID|creator|descrip| comment|sequence)/x
$line =~ /^[{}]$/ $line =~ /^(?:name|longname|sequence-ID| creation-date|direction|strandedness| type|offset|group-ID|creator|descrip| comment|sequence)/x
Truth table33%1/3
A || B
A= $line =~ /^[{}]$/B= $line =~ /^(?:name|longname|sequence-ID| creation-date|direction|strandedness| type|offset|group-ID|creator|descrip| comment|sequence)/x
ABresult
1X1
011
000
712 $line =~ /^(?:name|longname|sequence-ID|
713 creation-date|direction|strandedness|
714 type|offset|group-ID|creator|descrip|
715 comment|sequence)/x);
716 }
717  
718 =head2 _possibly_genbank
719  
720 From "http://www.ebi.ac.uk/help/formats.html".
721 Format of [apparantly optional] file header from
722 "http://www.umdnj.edu/rcompweb/PA/Notes/GenbankFF.htm". (TODO: dead link)
723  
724 =cut
725  
726 sub _possibly_genbank
727 40 ▶{
Subroutine _possibly_genbank: called CC=8 SCAR=22.1
728 40 my ($line, $lineno) = (shift, shift);
729 40 ▶ return (($lineno == 1 && $line =~ /GENETIC SEQUENCE DATA BANK/) ||
Condition71%15/21
$lineno == 1 && $line =~ /GENETIC SEQUENCE DATA BANK/ || $lineno == 1 && $line =~ /^LOCUS / || $lineno == 2 && $line =~ /^DEFINITION / || $lineno == 3 && $line =~ /^ACCESSION /
l!l&&r!l&&!r
1039
$lineno == 1 and $line =~ /GENETIC SEQUENCE DATA BANK/ or $lineno == 1 and $line =~ /^LOCUS / or $lineno == 2 and $line =~ /^DEFINITION /
l!l&&r!l&&!r
1039
$lineno == 1 and $line =~ /GENETIC SEQUENCE DATA BANK/ or $lineno == 1 and $line =~ /^LOCUS /
l!l&&r!l&&!r
0139
$lineno == 1 and $line =~ /GENETIC SEQUENCE DATA BANK/
!ll&&!rl&&r
30100
$lineno == 1 and $line =~ /^LOCUS /
!ll&&!rl&&r
3091
$lineno == 2 and $line =~ /^DEFINITION /
!ll&&!rl&&r
3720
$lineno == 3 and $line =~ /^ACCESSION /
!ll&&!rl&&r
3720
MC/DC37%3/8
$lineno == 1 && $line =~ /GENETIC SEQUENCE DATA BANK/ || $lineno == 1 && $line =~ /^LOCUS / || $lineno == 2 && $line =~ /^DEFINITION / || $lineno == 3 && $line =~ /^ACCESSION /
$lineno == 1 $line =~ /GENETIC SEQUENCE DATA BANK/ $lineno == 1 $line =~ /^LOCUS / $lineno == 2 $line =~ /^DEFINITION / $lineno == 3 $line =~ /^ACCESSION /
Truth table16%5/31
A and B or C and D or E and F || G and H
A= $lineno == 1B= $line =~ /GENETIC SEQUENCE DATA BANK/C= $lineno == 1D= $line =~ /^LOCUS /E= $lineno == 2F= $line =~ /^DEFINITION /G= $lineno == 3H= $line =~ /^ACCESSION /
ABCDEFGHresult
11XXXXXX1
0X11XXXX1
1011XXXX1
0X0X11XX1
0X1011XX1
100X11XX1
101011XX1
0X0X0X111
0X0X10111
0X100X111
0X1010111
100X0X111
100X10111
10100X111
101010111
0X0X0X0X0
0X0X0X100
0X0X100X0
0X0X10100
0X100X0X0
0X100X100
0X10100X0
0X1010100
100X0X0X0
100X0X100
100X100X0
100X10100
10100X0X0
10100X100
1010100X0
101010100
730 ($lineno == 1 && $line =~ /^LOCUS /) ||
731 ($lineno == 2 && $line =~ /^DEFINITION /) ||
732 ($lineno == 3 && $line =~ /^ACCESSION /));
733 }
734  
735 =head2 _possibly_genscan
736  
737 From bioperl test data.
738  
739 =cut
740  
741 sub _possibly_genscan
742 40 ▶{
Subroutine _possibly_genscan: called CC=3 SCAR=12.5
743 40 my ($line, $lineno) = (shift, shift);
744 40 ▶ return (($lineno == 1 && $line =~ /^GENSCAN.*Date.*Time/) ||
Condition50%3/6
$lineno == 1 && $line =~ /^GENSCAN.*Date.*Time/ || $line =~ /^(?:Sequence\s+\w+|Parameter matrix|Predicted genes)/
l!l&&r!l&&!r
0040
$lineno == 1 and $line =~ /^GENSCAN.*Date.*Time/
!ll&&!rl&&r
30100
MC/DC0%0/3
$lineno == 1 && $line =~ /^GENSCAN.*Date.*Time/ || $line =~ /^(?:Sequence\s+\w+|Parameter matrix|Predicted genes)/
$lineno == 1 $line =~ /^GENSCAN.*Date.*Time/ $line =~ /^(?:Sequence\s+\w+|Parameter matrix|Predicted genes)/
Truth table40%2/5
A and B || C
A= $lineno == 1B= $line =~ /^GENSCAN.*Date.*Time/C= $line =~ /^(?:Sequence\s+\w+|Parameter matrix|Predicted genes)/
ABCresult
11X1
0X11
1011
0X00
1000
745 ($line =~ /^(?:Sequence\s+\w+|Parameter matrix|Predicted genes)/));
746 }
747  
748 =head2 _possibly_gff
749  
750 From bioperl test data.
751  
752 =cut
753  
754 sub _possibly_gff
755 40 ▶{
Subroutine _possibly_gff: called CC=4 SCAR=15.6
756 40 my ($line, $lineno) = (shift, shift);
757 40 ▶ return (($lineno == 1 && $line =~ /^##gff-version/) ||
Condition55%5/9
$lineno == 1 && $line =~ /^##gff-version/ || $lineno == 2 && $line =~ /^##date/
l!l&&r!l&&!r
0040
$lineno == 1 and $line =~ /^##gff-version/
!ll&&!rl&&r
30100
$lineno == 2 and $line =~ /^##date/
!ll&&!rl&&r
3820
MC/DC0%0/4
$lineno == 1 && $line =~ /^##gff-version/ || $lineno == 2 && $line =~ /^##date/
$lineno == 1 $line =~ /^##gff-version/ $lineno == 2 $line =~ /^##date/
Truth table42%3/7
A and B || C and D
A= $lineno == 1B= $line =~ /^##gff-version/C= $lineno == 2D= $line =~ /^##date/
ABCDresult
11XX1
0X111
10111
0X0X0
0X100
100X0
10100
758 ($lineno == 2 && $line =~ /^##date/));
759 }
760  
761 =head2 _possibly_hmmer
762  
763 From bioperl test data.
764  
765 =cut
766  
767 sub _possibly_hmmer
768 40 ▶{
Subroutine _possibly_hmmer: called CC=4 SCAR=15.6
769 40 my ($line, $lineno) = (shift, shift);
770 40 ▶ return (($lineno == 2 && $line =~ /^HMMER/) ||
Condition55%5/9
$lineno == 2 && $line =~ /^HMMER/ || $lineno == 3 && $line =~ /Washington University School of Medicine/
l!l&&r!l&&!r
0040
$lineno == 2 and $line =~ /^HMMER/
!ll&&!rl&&r
3820
$lineno == 3 and $line =~ /Washington University School of Medicine/
!ll&&!rl&&r
3820
MC/DC0%0/4
$lineno == 2 && $line =~ /^HMMER/ || $lineno == 3 && $line =~ /Washington University School of Medicine/
$lineno == 2 $line =~ /^HMMER/ $lineno == 3 $line =~ /Washington University School of Medicine/
Truth table42%3/7
A and B || C and D
A= $lineno == 2B= $line =~ /^HMMER/C= $lineno == 3D= $line =~ /Washington University School of Medicine/
ABCDresult
11XX1
0X111
10111
0X0X0
0X100
100X0
10100
771 ($lineno == 3 &&
772 $line =~ /Washington University School of Medicine/));
773 }
774  
775 =head2 _possibly_nexus
776  
777 From "http://paup.csit.fsu.edu/nfiles.html".
778  
779 =cut
780  
781 sub _possibly_nexus
782 40 ▶{
Subroutine _possibly_nexus: called CC=2 SCAR=7.1
783 40 my ($line, $lineno) = (shift, shift);
784 40 ▶ return ($lineno == 1 && $line =~ /^#NEXUS/);
Condition66%2/3
$lineno == 1 && $line =~ /^#NEXUS/
!ll&&!rl&&r
30100
MC/DC0%0/2
$lineno == 1 && $line =~ /^#NEXUS/
$lineno == 1 $line =~ /^#NEXUS/
Truth table66%2/3
A && B
A= $lineno == 1B= $line =~ /^#NEXUS/
ABresult
0X0
100
111
785 }
786  
787 =head2 _possibly_mase
788  
789 From bioperl test data.
790 More detail from "http://www.umdnj.edu/rcompweb/PA/Notes/GenbankFF.htm" (TODO: dead link)
791  
792 =cut
793  
794 sub _possibly_mase
795 40 ▶{
Subroutine _possibly_mase: called CC=4 SCAR=15.6
796 40 my ($line, $lineno) = (shift, shift);
797 40 ▶ return (($lineno == 1 && $line =~ /^;;/) ||
Condition55%5/9
$lineno == 1 && $line =~ /^;;/ || $lineno > 1 && $line =~ /^;[^;]?/
l!l&&r!l&&!r
0040
$lineno == 1 and $line =~ /^;;/
!ll&&!rl&&r
30100
$lineno > 1 and $line =~ /^;[^;]?/
!ll&&!rl&&r
10300
MC/DC0%0/4
$lineno == 1 && $line =~ /^;;/ || $lineno > 1 && $line =~ /^;[^;]?/
$lineno == 1 $line =~ /^;;/ $lineno > 1 $line =~ /^;[^;]?/
Truth table28%2/7
A and B || C and D
A= $lineno == 1B= $line =~ /^;;/C= $lineno > 1D= $line =~ /^;[^;]?/
ABCDresult
11XX1
0X111
10111
0X0X0
0X100
100X0
10100
798 ($lineno > 1 && $line =~ /^;[^;]?/));
799 }
800  
801 =head2 _possibly_mega
802  
803 From the ensembl broswer (AlignView data export).
804  
805 =cut
806  
807 sub _possibly_mega
808 40 ▶{
Subroutine _possibly_mega: called CC=2 SCAR=7.1
809 40 my ($line, $lineno) = (shift, shift);
810 40 ▶ return ($lineno == 1 && $line =~ /^#mega$/);
Condition66%2/3
$lineno == 1 && $line =~ /^#mega$/
!ll&&!rl&&r
30100
MC/DC0%0/2
$lineno == 1 && $line =~ /^#mega$/
$lineno == 1 $line =~ /^#mega$/
Truth table66%2/3
A && B
A= $lineno == 1B= $line =~ /^#mega$/
ABresult
0X0
100
111
811 }
812  
813  
814 =head2 _possibly_msf
815  
816 From "http://www.ebi.ac.uk/help/formats.html".
817  
818 =cut
819  
820 sub _possibly_msf
821 40 ▶{
Subroutine _possibly_msf: called CC=2 SCAR=8.1
822 40 my ($line, $lineno) = (shift, shift);
823 40 ▶ return ($line =~ m{^//} ||
Condition33%1/3
$line =~ m[^//] || $line =~ /MSF:.*Type:.*Check:|Name:.*Len:/
l!l&&r!l&&!r
0040
MC/DC0%0/2
$line =~ m[^//] || $line =~ /MSF:.*Type:.*Check:|Name:.*Len:/
$line =~ m[^//] $line =~ /MSF:.*Type:.*Check:|Name:.*Len:/
Truth table33%1/3
A || B
A= $line =~ m[^//]B= $line =~ /MSF:.*Type:.*Check:|Name:.*Len:/
ABresult
1X1
011
000
824 $line =~ /MSF:.*Type:.*Check:|Name:.*Len:/);
825 }
826  
827 =head2 _possibly_phrap
828  
829 From "http://biodata.ccgb.umn.edu/docs/contigimage.html". (TODO: dead link)
830 From "http://genetics.gene.cwru.edu/gene508/Lec6.htm". (TODO: dead link)
831 From bioperl test data ("*.ace.1" files).
832  
833 =cut
834  
835 sub _possibly_phrap
836 40 ▶{
Subroutine _possibly_phrap: called CC=1 SCAR=0.0
837 40 my ($line, $lineno) = (shift, shift);
838 40 return ($line =~ /^(?:AS\ |CO\ Contig|BQ|AF\ |BS\ |RD\ |
839 QA\ |DS\ |RT\{)/x);
840 }
841  
842 =head2 _possibly_pir
843  
844 From "http://www.ebi.ac.uk/help/formats.html".
845 The ".,()" spotted in bioperl test data.
846  
847 =cut
848  
849 sub _possibly_pir # "NBRF/PIR" (?)
850 40 ▶{
Subroutine _possibly_pir: called CC=3 SCAR=12.5
851 40 my ($line, $lineno) = (shift, shift);
852 40 ▶ return (($lineno != 1 && $line =~ /^[\sA-IK-NP-Z.,()]+\*?$/i) ||
Condition50%3/6
$lineno != 1 && $line =~ /^[\sA-IK-NP-Z.,()]+\*?$/i || $line =~ /^>(?:P1|F1|DL|DC|RL|RC|N3|N1);/
l!l&&r!l&&!r
0040
$lineno != 1 and $line =~ /^[\sA-IK-NP-Z.,()]+\*?$/i
!ll&&!rl&&r
10300
MC/DC0%0/3
$lineno != 1 && $line =~ /^[\sA-IK-NP-Z.,()]+\*?$/i || $line =~ /^>(?:P1|F1|DL|DC|RL|RC|N3|N1);/
$lineno != 1 $line =~ /^[\sA-IK-NP-Z.,()]+\*?$/i $line =~ /^>(?:P1|F1|DL|DC|RL|RC|N3|N1);/
Truth table40%2/5
A and B || C
A= $lineno != 1B= $line =~ /^[\sA-IK-NP-Z.,()]+\*?$/iC= $line =~ /^>(?:P1|F1|DL|DC|RL|RC|N3|N1);/
ABCresult
11X1
0X11
1011
0X00
1000
853 $line =~ /^>(?:P1|F1|DL|DC|RL|RC|N3|N1);/);
854 }
855  
856 =head2 _possibly_pfam
857  
858 From bioperl test data.
859  
860 =cut
861  
862 sub _possibly_pfam
863 40 ▶{
Subroutine _possibly_pfam: called CC=1 SCAR=0.0
864 40 my ($line, $lineno) = (shift, shift);
865 40 return ($line =~ m{^\w+/\d+-\d+\s+[A-IK-NP-Z.]+}i);
866 }
867  
868 =head2 _possibly_phylip
869  
870 From "http://www.ebi.ac.uk/help/formats.html". Initial space
871 allowed on first line (spotted in ensembl AlignView exported
872 data).
873  
874 =cut
875  
876 sub _possibly_phylip
877 40 ▶{
Subroutine _possibly_phylip: called CC=6 SCAR=21.4
878 40 my ($line, $lineno) = (shift, shift);
879 40 ▶ return (($lineno == 1 && $line =~ /^\s*\d+\s\d+/) ||
Condition53%8/15
$lineno == 1 && $line =~ /^\s*\d+\s\d+/ || $lineno == 2 && $line =~ /^\w\s+[A-IK-NP-Z\s]+/ || $lineno == 3 && $line =~ /(?:^\w\s+[A-IK-NP-Z\s]+|\s+[A-IK-NP-Z\s]+)/
l!l&&r!l&&!r
0040
$lineno == 1 and $line =~ /^\s*\d+\s\d+/ or $lineno == 2 and $line =~ /^\w\s+[A-IK-NP-Z\s]+/
l!l&&r!l&&!r
0040
$lineno == 1 and $line =~ /^\s*\d+\s\d+/
!ll&&!rl&&r
30100
$lineno == 2 and $line =~ /^\w\s+[A-IK-NP-Z\s]+/
!ll&&!rl&&r
3820
$lineno == 3 and $line =~ /(?:^\w\s+[A-IK-NP-Z\s]+|\s+[A-IK-NP-Z\s]+)/
!ll&&!rl&&r
3820
MC/DC0%0/6
$lineno == 1 && $line =~ /^\s*\d+\s\d+/ || $lineno == 2 && $line =~ /^\w\s+[A-IK-NP-Z\s]+/ || $lineno == 3 && $line =~ /(?:^\w\s+[A-IK-NP-Z\s]+|\s+[A-IK-NP-Z\s]+)/
$lineno == 1 $line =~ /^\s*\d+\s\d+/ $lineno == 2 $line =~ /^\w\s+[A-IK-NP-Z\s]+/ $lineno == 3 $line =~ /(?:^\w\s+[A-IK-NP-Z\s]+|\s+[A-IK-NP-Z\s]+)/
Truth table26%4/15
A and B or C and D || E and F
A= $lineno == 1B= $line =~ /^\s*\d+\s\d+/C= $lineno == 2D= $line =~ /^\w\s+[A-IK-NP-Z\s]+/E= $lineno == 3F= $line =~ /(?:^\w\s+[A-IK-NP-Z\s]+|\s+[A-IK-NP-Z\s]+)/
ABCDEFresult
11XXXX1
0X11XX1
1011XX1
0X0X111
0X10111
100X111
1010111
0X0X0X0
0X0X100
0X100X0
0X10100
100X0X0
100X100
10100X0
1010100
880 ($lineno == 2 && $line =~ /^\w\s+[A-IK-NP-Z\s]+/) ||
881 ($lineno == 3 && $line =~ /(?:^\w\s+[A-IK-NP-Z\s]+|\s+[A-IK-NP-Z\s]+)/)
882 );
883 }
884  
885 =head2 _possibly_prodom
886  
887 From "http://prodom.prabi.fr/prodom/current/documentation/data.php".
888  
889 =cut
890  
891 sub _possibly_prodom
892 40 ▶{
Subroutine _possibly_prodom: called CC=3 SCAR=11.0
893 40 my ($line, $lineno) = (shift, shift);
894 40 ▶ return ($lineno == 1 && $line =~ /^ID / && $line =~ /\d+ seq\.$/);
Condition83%5/6
$lineno == 1 && $line =~ /^ID / && $line =~ /\d+ seq\.$/
!ll&&!rl&&r
3820
$lineno == 1 and $line =~ /^ID /
!ll&&!rl&&r
3082
MC/DC0%0/3
$lineno == 1 && $line =~ /^ID / && $line =~ /\d+ seq\.$/
$lineno == 1 $line =~ /^ID / $line =~ /\d+ seq\.$/
Truth table75%3/4
A and B && C
A= $lineno == 1B= $line =~ /^ID /C= $line =~ /\d+ seq\.$/
ABCresult
0XX0
10X0
1100
1111
895 }
896  
897 =head2 _possibly_raw
898  
899 From "http://www.ebi.ac.uk/help/formats.html".
900  
901 =cut
902  
903 sub _possibly_raw
904 40 ▶{
Subroutine _possibly_raw: called CC=1 SCAR=0.0
905 40 my ($line, $lineno) = (shift, shift);
906 40 return ($line =~ /^[A-Za-z\s]+$/);
907 }
908  
909 =head2 _possibly_rsf
910  
911 From "http://www.ebi.ac.uk/help/formats.html".
912  
913 =cut
914  
915 sub _possibly_rsf
916 40 ▶{
Subroutine _possibly_rsf: called CC=4 SCAR=17.1
917 40 my ($line, $lineno) = (shift, shift);
918 40 ▶ return (($lineno == 1 && $line =~ /^!!RICH_SEQUENCE/) ||
Condition44%4/9
$lineno == 1 && $line =~ /^!!RICH_SEQUENCE/ || $line =~ /^[{}]$/ || $line =~ /^(?:name|type|longname| checksum|creation-date|strand|sequence)/x
l!l&&r!l&&!r
0040
$lineno == 1 and $line =~ /^!!RICH_SEQUENCE/ or $line =~ /^[{}]$/
l!l&&r!l&&!r
0040
$lineno == 1 and $line =~ /^!!RICH_SEQUENCE/
!ll&&!rl&&r
30100
MC/DC0%0/4
$lineno == 1 && $line =~ /^!!RICH_SEQUENCE/ || $line =~ /^[{}]$/ || $line =~ /^(?:name|type|longname| checksum|creation-date|strand|sequence)/x
$lineno == 1 $line =~ /^!!RICH_SEQUENCE/ $line =~ /^[{}]$/ $line =~ /^(?:name|type|longname| checksum|creation-date|strand|sequence)/x
Truth table28%2/7
A and B or C || D
A= $lineno == 1B= $line =~ /^!!RICH_SEQUENCE/C= $line =~ /^[{}]$/D= $line =~ /^(?:name|type|longname| checksum|creation-date|strand|sequence)/x
ABCDresult
11XX1
0X1X1
101X1
0X011
10011
0X000
10000
919 $line =~ /^[{}]$/ ||
920 $line =~ /^(?:name|type|longname|
921 checksum|creation-date|strand|sequence)/x);
922 }
923  
924 =head2 _possibly_selex
925  
926 From "http://www.ebc.ee/WWW/hmmer2-html/node27.html".
927  
928 Assuming presence of Selex file header. Data exported by
929 Bioperl on Pfam and Selex formats are identical, but Pfam file
930 only holds one alignment.
931  
932 =cut
933  
934 sub _possibly_selex
935 40 ▶{
Subroutine _possibly_selex: called CC=5 SCAR=19.4
936 40 my ($line, $lineno) = (shift, shift);
937 40 ▶ return (($lineno == 1 && $line =~ /^#=ID /) ||
Condition50%6/12
$lineno == 1 && $line =~ /^#=ID / || $lineno == 2 && $line =~ /^#=AC / || $line =~ /^#=SQ /
l!l&&r!l&&!r
0040
$lineno == 1 and $line =~ /^#=ID / or $lineno == 2 and $line =~ /^#=AC /
l!l&&r!l&&!r
0040
$lineno == 1 and $line =~ /^#=ID /
!ll&&!rl&&r
30100
$lineno == 2 and $line =~ /^#=AC /
!ll&&!rl&&r
3820
MC/DC0%0/5
$lineno == 1 && $line =~ /^#=ID / || $lineno == 2 && $line =~ /^#=AC / || $line =~ /^#=SQ /
$lineno == 1 $line =~ /^#=ID / $lineno == 2 $line =~ /^#=AC / $line =~ /^#=SQ /
Truth table27%3/11
A and B or C and D || E
A= $lineno == 1B= $line =~ /^#=ID /C= $lineno == 2D= $line =~ /^#=AC /E= $line =~ /^#=SQ /
ABCDEresult
11XXX1
0X11X1
1011X1
0X0X11
0X1011
100X11
101011
0X0X00
0X1000
100X00
101000
938 ($lineno == 2 && $line =~ /^#=AC /) ||
939 ($line =~ /^#=SQ /));
940 }
941  
942 =head2 _possibly_stockholm
943  
944 From bioperl test data.
945  
946 =cut
947  
948 sub _possibly_stockholm
949 40 ▶{
Subroutine _possibly_stockholm: called CC=3 SCAR=12.5
950 40 my ($line, $lineno) = (shift, shift);
951 40 ▶ return (($lineno == 1 && $line =~ /^# STOCKHOLM/) ||
Condition50%3/6
$lineno == 1 && $line =~ /^# STOCKHOLM/ || $line =~ /^#=(?:GF|GS) /
l!l&&r!l&&!r
0040
$lineno == 1 and $line =~ /^# STOCKHOLM/
!ll&&!rl&&r
30100
MC/DC0%0/3
$lineno == 1 && $line =~ /^# STOCKHOLM/ || $line =~ /^#=(?:GF|GS) /
$lineno == 1 $line =~ /^# STOCKHOLM/ $line =~ /^#=(?:GF|GS) /
Truth table40%2/5
A and B || C
A= $lineno == 1B= $line =~ /^# STOCKHOLM/C= $line =~ /^#=(?:GF|GS) /
ABCresult
11X1
0X11
1011
0X00
1000
952 $line =~ /^#=(?:GF|GS) /);
953 }
954  
955  
956  
957 =head2 _possibly_swiss
958  
959 From "http://ca.expasy.org/sprot/userman.html#entrystruc".
960  
961 =cut
962  
963 sub _possibly_swiss
964 40 ▶{
Subroutine _possibly_swiss: called CC=3 SCAR=11.0
965 40 my ($line, $lineno) = (shift, shift);
966 40 ▶ return ($lineno == 1 && $line =~ /^ID / && $line =~ /AA\.$/);
Condition83%5/6
$lineno == 1 && $line =~ /^ID / && $line =~ /AA\.$/
!ll&&!rl&&r
3802
$lineno == 1 and $line =~ /^ID /
!ll&&!rl&&r
3082
MC/DC66%2/3
$lineno == 1 && $line =~ /^ID / && $line =~ /AA\.$/
$lineno == 1 $line =~ /^ID / $line =~ /AA\.$/
Truth table75%3/4
A and B && C
A= $lineno == 1B= $line =~ /^ID /C= $line =~ /AA\.$/
ABCresult
0XX0
10X0
1100
1111
967 }
968  
969 =head2 _possibly_tab
970  
971 Contributed by Heikki.
972  
973 =cut
974  
975 sub _possibly_tab
976 40 ▶{
Subroutine _possibly_tab: called CC=2 SCAR=7.1
977 40 my ($line, $lineno) = (shift, shift);
978 40 ▶ return ($lineno == 1 && $line =~ /^[^\t]+\t[^\t]+/) ;
Condition66%2/3
$lineno == 1 && $line =~ /^[^\t]+\t[^\t]+/
!ll&&!rl&&r
30100
MC/DC0%0/2
$lineno == 1 && $line =~ /^[^\t]+\t[^\t]+/
$lineno == 1 $line =~ /^[^\t]+\t[^\t]+/
Truth table66%2/3
A && B
A= $lineno == 1B= $line =~ /^[^\t]+\t[^\t]+/
ABresult
0X0
100
111
979 }
980  
981 =head2 _possibly_vcf
982  
983 From "http://www.1000genomes.org/wiki/analysis/vcf4.0".
984  
985 Assumptions made about sanity - format and date lines are line 1 and 2
986 respectively. This is not specified in the format document.
987  
988 =cut
989  
990 sub _possibly_vcf
991 40 ▶{
Subroutine _possibly_vcf: called CC=4 SCAR=15.6
992 40 my ($line, $lineno) = (shift, shift);
993 40 ▶ return (($lineno == 1 && $line =~ /##fileformat=VCFv/) ||
Condition55%5/9
$lineno == 1 && $line =~ /##fileformat=VCFv/ || $lineno == 2 && $line =~ /##fileDate=/
l!l&&r!l&&!r
0040
$lineno == 1 and $line =~ /##fileformat=VCFv/
!ll&&!rl&&r
30100
$lineno == 2 and $line =~ /##fileDate=/
!ll&&!rl&&r
3820
MC/DC0%0/4
$lineno == 1 && $line =~ /##fileformat=VCFv/ || $lineno == 2 && $line =~ /##fileDate=/
$lineno == 1 $line =~ /##fileformat=VCFv/ $lineno == 2 $line =~ /##fileDate=/
Truth table42%3/7
A and B || C and D
A= $lineno == 1B= $line =~ /##fileformat=VCFv/C= $lineno == 2D= $line =~ /##fileDate=/
ABCDresult
11XX1
0X111
10111
0X0X0
0X100
100X0
10100
994 ($lineno == 2 && $line =~ /##fileDate=/));
995 }
996  
997  
998  
999 147 1;
« Bio/DB/GFF/Util/Binning.pm ↑ Summary Bio/Annotation/Reference.pm »