| 1 | package FAST; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | 1 | ▶ | use 5.10.1; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use Carp; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use warnings FATAL => 'all'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||
| 8 | 1 | our $VERSION = '1.04'; | |||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||
| 10 | 1 | our $DEF_FORMAT = "fasta"; | |||||||||||||||||||||||||||||||||||||||||
| 11 | 1 | our $DEF_LOGNAME = "FAST.log.txt"; | |||||||||||||||||||||||||||||||||||||||||
| 12 | 1 | our $DEF_JOIN_STRING = " "; | |||||||||||||||||||||||||||||||||||||||||
| 13 | 1 | our $DEF_SPLIT_REGEX = ' '; | |||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||
| 15 | sub log { | ||||||||||||||||||||||||||||||||||||||||||
| 16 | 0 | ▶ | my ($logname, $DATE, $COMMAND, $comment, $fromSTDIN) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
log: not called CC=8 SCAR=42.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 17 | 0 | ▶ | unless ($logname and $DATE and $COMMAND) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$logname and $DATE and $COMMAND
$logname and $DATE
MC/DC0%0/3
$logname and $DATE and $COMMAND
$logname
$DATE
$COMMAND
Truth table0%0/4
A and B and C
A= $lognameB= $DATEC= $COMMAND
| |||||||||||||||||||||||||||||||||||||||||||
| 18 | 0 | carp join "","FAST::log: logname, DATE, or COMMAND undefined; logging not possible.\n"; | |||||||||||||||||||||||||||||||||||||||||
| 19 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 20 | } | ||||||||||||||||||||||||||||||||||||||||||
| 21 | 0 | ▶ | open (LOG, ">>$logname") or carp "FAST::log: cannot open logfile $logname\n"; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 22 | 0 | ▶ | if (*LOG) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 23 | 0 | ▶ | if (!$fromSTDIN) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 24 | 0 | print LOG "\n# FAST $VERSION $DATE "; | |||||||||||||||||||||||||||||||||||||||||
| 25 | 0 | ▶ | print LOG "$comment" if ($comment); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 26 | 0 | print LOG "\n"; | |||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | print LOG "$COMMAND" | |||||||||||||||||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||||||||||||||||
| 29 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 30 | 0 | print LOG " | $COMMAND" | |||||||||||||||||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||||||||||||||||
| 32 | 0 | close LOG; | |||||||||||||||||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||
| 37 | =head1 NAME | ||||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||
| 39 | FAST - FAST Analysis of Sequences Toolbox | ||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||
| 41 | =head1 VERSION | ||||||||||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||||||||||
| 43 | Version 1.03 | ||||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||
| 45 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||
| 47 | The Fast Analysis of Sequences Toolbox (FAST) is a set of UNIX | ||||||||||||||||||||||||||||||||||||||||||
| 48 | utilities (for example fasgrep, fascut, fashead and fastr) that | ||||||||||||||||||||||||||||||||||||||||||
| 49 | extends the UNIX toolbox paradigm to bioinformatic sequence | ||||||||||||||||||||||||||||||||||||||||||
| 50 | records. Modeled after the UNIX textutils (such as grep, cut, head, | ||||||||||||||||||||||||||||||||||||||||||
| 51 | tr, etc), FAST workflows are designed for "inline" (serial) processing | ||||||||||||||||||||||||||||||||||||||||||
| 52 | of flatfile biological sequence record databases per-sequence, rather | ||||||||||||||||||||||||||||||||||||||||||
| 53 | than per-line, through UNIX pipelines. The default data exchange | ||||||||||||||||||||||||||||||||||||||||||
| 54 | format is multifasta (specifically, a restriction of BioPerl FastA | ||||||||||||||||||||||||||||||||||||||||||
| 55 | format). FASTQ format is supported. FAST is designed for learnability, | ||||||||||||||||||||||||||||||||||||||||||
| 56 | interoperability, interface consistency, rapid prototyping, fine-tuned | ||||||||||||||||||||||||||||||||||||||||||
| 57 | control, and reproducibility. FAST tools expose the power of Perl and | ||||||||||||||||||||||||||||||||||||||||||
| 58 | BioPerl to users in an easy-to-learn command-line paradigm. | ||||||||||||||||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||||||||||||||||
| 60 | =head1 UTILITIES | ||||||||||||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||||||||||||
| 62 | FAST 1.0x contains the following utilities. Each has its own man page. | ||||||||||||||||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||||||||||||||||
| 64 | =over 4 | ||||||||||||||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||||||||||||||
| 66 | =item B<alncut> | ||||||||||||||||||||||||||||||||||||||||||
| 67 | select sites based on site variation and gap-content | ||||||||||||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||||||||||||
| 69 | =item B<alnpi> | ||||||||||||||||||||||||||||||||||||||||||
| 70 | calculate molecular population genetic statistics | ||||||||||||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||||||||||||
| 72 | =item B<fascodon> | ||||||||||||||||||||||||||||||||||||||||||
| 73 | tally/annotate codon usage | ||||||||||||||||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||||||||||||||||
| 75 | =item B<fascomp> | ||||||||||||||||||||||||||||||||||||||||||
| 76 | tally/annotate monomer frequencies | ||||||||||||||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||||||||||||||
| 78 | =item B<fasconvert> | ||||||||||||||||||||||||||||||||||||||||||
| 79 | convert sequences to or from from fasta format | ||||||||||||||||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||||||||||||||||
| 81 | =item B<fascut> | ||||||||||||||||||||||||||||||||||||||||||
| 82 | select/reorder sequence records based on index lists/ranges | ||||||||||||||||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||||||||||||||||
| 84 | =item B<fasfilter> | ||||||||||||||||||||||||||||||||||||||||||
| 85 | filter sequence records based on numerical values | ||||||||||||||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||||||||||||||
| 87 | =item B<fasgrep> | ||||||||||||||||||||||||||||||||||||||||||
| 88 | filter sequence records based on perl regular expressions | ||||||||||||||||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||||||||||||||||
| 90 | =item B<fashead> | ||||||||||||||||||||||||||||||||||||||||||
| 91 | filter leading sequence records | ||||||||||||||||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||||||||||||||
| 93 | =item B<faslen> | ||||||||||||||||||||||||||||||||||||||||||
| 94 | annotate sequence lengths | ||||||||||||||||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||||||||||||||||
| 96 | =item B<faspaste> | ||||||||||||||||||||||||||||||||||||||||||
| 97 | concatenate sequence records | ||||||||||||||||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||||||||||||||||
| 99 | =item B<fasrc> | ||||||||||||||||||||||||||||||||||||||||||
| 100 | reverse complement nucleotide sequences and alignments | ||||||||||||||||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||||||||||||||||
| 102 | =item B<fassort> | ||||||||||||||||||||||||||||||||||||||||||
| 103 | sort sequence records | ||||||||||||||||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||||||||||||||||
| 105 | =item B<fassub> | ||||||||||||||||||||||||||||||||||||||||||
| 106 | transform sequence records using regex-based substitutions | ||||||||||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||||||||||
| 108 | =item B<fastail> | ||||||||||||||||||||||||||||||||||||||||||
| 109 | filter trailing sequence records | ||||||||||||||||||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||||||||||||||||
| 111 | =item B<fastax> | ||||||||||||||||||||||||||||||||||||||||||
| 112 | filter sequence records based on NCBI taxonomy IDs or names | ||||||||||||||||||||||||||||||||||||||||||
| 113 | |||||||||||||||||||||||||||||||||||||||||||
| 114 | =item B<fastaxsort> | ||||||||||||||||||||||||||||||||||||||||||
| 115 | sort sequence records based on NCBI taxonomy IDs or names | ||||||||||||||||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||||||||||||||||
| 117 | =item B<fastr> | ||||||||||||||||||||||||||||||||||||||||||
| 118 | transform sequence records by character, degap, strict | ||||||||||||||||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||||||||||||||||
| 120 | =item B<fasuniq> | ||||||||||||||||||||||||||||||||||||||||||
| 121 | remove duplicate sequence records from sorted data | ||||||||||||||||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||||||||||||||||
| 123 | =item B<faswc> | ||||||||||||||||||||||||||||||||||||||||||
| 124 | tally sequences and characters | ||||||||||||||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||||||||||||||
| 126 | =item B<fasxl> | ||||||||||||||||||||||||||||||||||||||||||
| 127 | translate gapped and ungapped sequences and alignments | ||||||||||||||||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||||||||||||||||
| 129 | =item B<gbfalncut> | ||||||||||||||||||||||||||||||||||||||||||
| 130 | select sites by regex matching of features in a GenBank file | ||||||||||||||||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||||||||||||||||
| 132 | =item B<gbfcut> | ||||||||||||||||||||||||||||||||||||||||||
| 133 | print sequences by regex matching to features in a GenBank file | ||||||||||||||||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||||||||||||||||
| 135 | =back | ||||||||||||||||||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||||||||||||||||||
| 137 | =head1 AUTHORS | ||||||||||||||||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||||||||||||||||
| 139 | David H. Ardell, C<< <dhard at cpan.org> >> | ||||||||||||||||||||||||||||||||||||||||||
| 140 | and members of the Ardell Laboratory | ||||||||||||||||||||||||||||||||||||||||||
| 141 | and other contributors including: | ||||||||||||||||||||||||||||||||||||||||||
| 142 | Travis Lawrence | ||||||||||||||||||||||||||||||||||||||||||
| 143 | Dana Carper | ||||||||||||||||||||||||||||||||||||||||||
| 144 | Katherine Amrine | ||||||||||||||||||||||||||||||||||||||||||
| 145 | Kyle Kauffman | ||||||||||||||||||||||||||||||||||||||||||
| 146 | Claudia Canales | ||||||||||||||||||||||||||||||||||||||||||
| 147 | |||||||||||||||||||||||||||||||||||||||||||
| 148 | =head1 BUGS | ||||||||||||||||||||||||||||||||||||||||||
| 149 | |||||||||||||||||||||||||||||||||||||||||||
| 150 | Please report any bugs or feature requests to C<bug-fast at rt.cpan.org>, or through | ||||||||||||||||||||||||||||||||||||||||||
| 151 | the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=FAST>. I will be notified, and then you'll | ||||||||||||||||||||||||||||||||||||||||||
| 152 | automatically be notified of progress on your bug as I make changes. | ||||||||||||||||||||||||||||||||||||||||||
| 153 | |||||||||||||||||||||||||||||||||||||||||||
| 154 | =head1 ACKNOWLEDGEMENTS | ||||||||||||||||||||||||||||||||||||||||||
| 155 | |||||||||||||||||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||||||||||||||||
| 157 | =head1 LICENSE AND COPYRIGHT | ||||||||||||||||||||||||||||||||||||||||||
| 158 | |||||||||||||||||||||||||||||||||||||||||||
| 159 | Copyright 2015 David H. Ardell. | ||||||||||||||||||||||||||||||||||||||||||
| 160 | |||||||||||||||||||||||||||||||||||||||||||
| 161 | This program is free software; you can redistribute it and/or modify it | ||||||||||||||||||||||||||||||||||||||||||
| 162 | under the terms of the the Artistic License (2.0). You may obtain a | ||||||||||||||||||||||||||||||||||||||||||
| 163 | copy of the full license at: | ||||||||||||||||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||||||||||||||||
| 165 | L<http://www.perlfoundation.org/artistic_license_2_0> | ||||||||||||||||||||||||||||||||||||||||||
| 166 | |||||||||||||||||||||||||||||||||||||||||||
| 167 | Any use, modification, and distribution of the Standard or Modified | ||||||||||||||||||||||||||||||||||||||||||
| 168 | Versions is governed by this Artistic License. By using, modifying or | ||||||||||||||||||||||||||||||||||||||||||
| 169 | distributing the Package, you accept this license. Do not use, modify, | ||||||||||||||||||||||||||||||||||||||||||
| 170 | or distribute the Package, if you do not accept this license. | ||||||||||||||||||||||||||||||||||||||||||
| 171 | |||||||||||||||||||||||||||||||||||||||||||
| 172 | If your Modified Version has been derived from a Modified Version made | ||||||||||||||||||||||||||||||||||||||||||
| 173 | by someone other than you, you are nevertheless required to ensure that | ||||||||||||||||||||||||||||||||||||||||||
| 174 | your Modified Version complies with the requirements of this license. | ||||||||||||||||||||||||||||||||||||||||||
| 175 | |||||||||||||||||||||||||||||||||||||||||||
| 176 | This license does not grant you the right to use any trademark, service | ||||||||||||||||||||||||||||||||||||||||||
| 177 | mark, tradename, or logo of the Copyright Holder. | ||||||||||||||||||||||||||||||||||||||||||
| 178 | |||||||||||||||||||||||||||||||||||||||||||
| 179 | This license includes the non-exclusive, worldwide, free-of-charge | ||||||||||||||||||||||||||||||||||||||||||
| 180 | patent license to make, have made, use, offer to sell, sell, import and | ||||||||||||||||||||||||||||||||||||||||||
| 181 | otherwise transfer the Package with respect to any patent claims | ||||||||||||||||||||||||||||||||||||||||||
| 182 | licensable by the Copyright Holder that are necessarily infringed by the | ||||||||||||||||||||||||||||||||||||||||||
| 183 | Package. If you institute patent litigation (including a cross-claim or | ||||||||||||||||||||||||||||||||||||||||||
| 184 | counterclaim) against any party alleging that the Package constitutes | ||||||||||||||||||||||||||||||||||||||||||
| 185 | direct or contributory patent infringement, then this Artistic License | ||||||||||||||||||||||||||||||||||||||||||
| 186 | to you shall terminate on the date that such litigation is filed. | ||||||||||||||||||||||||||||||||||||||||||
| 187 | |||||||||||||||||||||||||||||||||||||||||||
| 188 | Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER | ||||||||||||||||||||||||||||||||||||||||||
| 189 | AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. | ||||||||||||||||||||||||||||||||||||||||||
| 190 | THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR | ||||||||||||||||||||||||||||||||||||||||||
| 191 | PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY | ||||||||||||||||||||||||||||||||||||||||||
| 192 | YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR | ||||||||||||||||||||||||||||||||||||||||||
| 193 | CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR | ||||||||||||||||||||||||||||||||||||||||||
| 194 | CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, | ||||||||||||||||||||||||||||||||||||||||||
| 195 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||||||||||||||||||||||||||||||||||||||||
| 196 | |||||||||||||||||||||||||||||||||||||||||||
| 197 | |||||||||||||||||||||||||||||||||||||||||||
| 198 | =cut | ||||||||||||||||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||||||||||||||||
| 200 | 1 | 1; # End of FAST | |||||||||||||||||||||||||||||||||||||||||