# HG changeset patch # User lz_hust # Date 1559358501 14400 # Node ID d0a9360bb58e0730b9cdae3a32d9d2ccdfcc9471 # Parent 551fc755f1966f397ef9f19a4ddf737e86b7f7dc Uploaded diff -r 551fc755f196 -r d0a9360bb58e fasta-tool.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fasta-tool.pl Fri May 31 23:08:21 2019 -0400 @@ -0,0 +1,960 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fasta-tool/fasta-tool.pl at master · huster16/fasta-tool · GitHub + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Skip to content +
+ + + + + + + + +
+ +
+ + +
+ +
+ + + +
+
+
+ + + + + + + + + + + +
+
+ + + + + + + + Permalink + + + + + +
+ + +
+ + Branch: + master + + + + + + + +
+ +
+ + Find file + + + Copy path + +
+
+ + +
+ + Find file + + + Copy path + +
+
+ + + + +
+
+ + + + + 1st + + + + 7bdf0b2 + May 31, 2019 + +
+ +
+
+ + 1 contributor + + +
+ +

+ Users who have contributed to this file +

+
+ +
+
+
+
+ + + + + + +
+ +
+ +
+ 24 lines (21 sloc) + + 470 Bytes +
+ +
+ +
+ Raw + Blame + History +
+ + +
+ + + +
+
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#!/usr/bin/perl -w
+
# usage : perl toolExample.pl <FASTA file> <output file>
+
open (IN, "<$ARGV[0]");
open (OUT, ">$ARGV[1]");
while (<IN>) {
chop;
if (m/^>/) {
s/^>//;
if ($. > 1) {
print OUT sprintf("%.3f", $gc/$length) . "\n";
}
$gc = 0;
$length = 0;
} else {
++$gc while m/[gc]/ig;
$length += length $_;
}
}
print OUT sprintf("%.3f", $gc/$length) . "\n";
close( IN );
close( OUT );
+ + + +
+ +
+ + + +
+ + +
+ + +
+
+ + + +
+ +
+ +
+
+ + +
+ + + + + + +
+ + + You can’t perform that action at this time. +
+ + + + + + + + + + + + + + +
+ + + +