Added file to flatten fasta as prep for bioprospector
authorTim Reddy Tim <treddy@hudsonalpha.org>
Mon, 12 Jan 2009 22:47:46 +0000 (22:47 +0000)
committerTim Reddy Tim <treddy@hudsonalpha.org>
Mon, 12 Jan 2009 22:47:46 +0000 (22:47 +0000)
htswanalysis/scripts/flatten_fasta.pm [new file with mode: 0755]

diff --git a/htswanalysis/scripts/flatten_fasta.pm b/htswanalysis/scripts/flatten_fasta.pm
new file mode 100755 (executable)
index 0000000..adb6adf
--- /dev/null
@@ -0,0 +1,14 @@
+#!/usr/bin/perl -w
+
+my $started = 0;
+while( my $line = <>) {
+  if($line =~ /^>/) { 
+    if(!$started) { $started = 1; } else { print "\n"; }
+    print $line; 
+  }
+  else {
+    chomp $line;
+    print $line;
+  }
+}
+print "\n";