view flexbar.pl @ 11:52c5e53aff28

Revised perl wrapper.
author jtilman
date Wed, 02 Jan 2013 12:54:28 +0100
parents f0bdf862ba39
children 4cbf6c6d2f2b
line wrap: on
line source

#!/usr/bin/env perl

# Author: Johannes T. Roehr

use warnings;
use strict;


my ($outFile, $id, $folder, $format) = @ARGV[($#ARGV - 3) .. $#ARGV];

my $call = join " ", @ARGV[0..($#ARGV - 4)];

system $call .' --target reads > '. $outFile and exit 1;


foreach(<reads*>){
	
	my $fileType;
	
	$fileType = $1         if /\.(\w+)$/;
	$fileType = $format    if /\.\w+fast\w$/;
	$fileType = 'tabular'  if $fileType eq 'lengthdist';
	
	my $file = $_;
	
	s/_//g;
	
	my $name = "primary_". $id ."_". $_ ."_visible_". $fileType;
	
	rename $file, $name;
	rename $name, $folder;
}