changeset 4:00edccfa662b draft

iAssembler perl wrapper
author rogerngo
date Wed, 16 May 2012 00:24:20 -0400
parents cfe16849421e
children 1d53d653adef
files iAssembler_wrapper.pl
diffstat 1 files changed, 43 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/iAssembler_wrapper.pl	Wed May 16 00:24:20 2012 -0400
@@ -0,0 +1,43 @@
+#!/usr/bin/perl
+
+# Wrapper script written by: Roger Ngo, Sam Min and Todd H. Oakley, UCSB
+
+use warnings;
+use strict;
+use Cwd;
+
+my $dir = getcwd();
+
+my $iAssemblerBinPath = '/labdata/nfs/galaxy/pkgs/iAssembler';
+my $iAssemblerToolPath = '/labdata/nfs/galaxy/galaxy-dist/tools/iAssembler';
+
+#iAssembler_wrapper.pl -i $input -e $maxlength -h $minoverlap -p $minpercent  ...example
+
+my $input=$ARGV[1];
+my $maxlength=$ARGV[3];
+my $minoverlap=$ARGV[5];
+my $minpercent=$ARGV[7];
+
+open my $file, '<', $iAssemblerToolPath."\/increment.txt";
+	my $increment = <$file>;
+	$increment = int($increment);
+close $file;
+
+my $temp = $increment;
+
+open(UPDATE, '>'.$iAssemblerToolPath."\/increment.txt");
+	$increment = $increment + 1;
+	print UPDATE $increment;
+close(UPDATE);
+
+qx/cp $input $iAssemblerBinPath\/input.$temp.fasta/;
+
+chdir($iAssemblerBinPath);
+
+qx/$iAssemblerBinPath\/iAssembler.pl -i input.$temp.fasta -e $maxlength -h $minoverlap -p $minpercent/;
+
+chdir("$dir");
+
+qx/cp $iAssemblerBinPath\/input.$temp.fasta_output\/unigene_seq.fasta unigene_seq.fasta/;
+
+qx/rm -rf $iAssemblerBinPath\/input.$temp.*/;