# HG changeset patch # User jtilman # Date 1356894099 18000 # Node ID a8399cb4972bea2b7e3b55c3e89c0d86fdb8d4c1 # Parent 68a4edf205f37733aae5b93c60357a7369cfa054 Uploaded Flexbar perl tool wrapper file flexbar.pl diff -r 68a4edf205f3 -r a8399cb4972b flexbar.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/flexbar.pl Sun Dec 30 14:01:39 2012 -0500 @@ -0,0 +1,42 @@ +#!/usr/bin/env perl + +# Author: Johannes T. Roehr + +use warnings; +use strict; + +my $flexbarDir = ""; + +my $pwd = $ENV{PWD}; + +my $lastIdx = $#ARGV; +my $format = $ARGV[$lastIdx]; +my $folder = $ARGV[$lastIdx - 1]; +my $id = $ARGV[$lastIdx - 2]; +my $outFile = $ARGV[$lastIdx - 3]; + +my $call = join " ", @ARGV[0..($lastIdx - 4)]; + +system $flexbarDir . $call .' --target reads > '. $outFile; + +foreach(<$pwd ."/reads"*>){ + + if(/^\.\//){ + my $file = $pwd ."/". $_; + + s/^\.\///; + my $fileType; + + $fileType = $1 if /\.(\w+)$/; + $fileType = $format if /\.\w+fast\w$/; + $fileType = 'tabular' if $fileType eq 'lengthdist'; + + s/_//g; + + my $name = "primary_". $id ."_". $_ ."_visible_". $fileType; + + rename $file, $name; + rename $name, $folder; + } +} +