view flexbar.pl @ 12:4cbf6c6d2f2b

Fixed issue where adapter removal can not be performed and further minor issues.
author jtilman
date Thu, 17 Jan 2013 18:09:44 +0100
parents 52c5e53aff28
children 346a2b0979ea
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;
}