view flexbar.pl @ 33:3b010ddcea2a draft

Uploaded
author jtilman
date Sun, 24 Jun 2018 12:25:51 -0400
parents c554e6d251fd
children
line wrap: on
line source

#!/usr/bin/env perl

# Flexbar wrapper for Galaxy tool definition, version 3.4
# Author: Johannes Roehr

use warnings;
use strict;

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

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

system $call .' --target FlexbarTargetFile --output-log '. $outFile and exit 1;


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