changeset 25:c361b3fb806e

added Nicola Path 2.0
author Franco Caramia <franco.caramia@petermac.org>
date Tue, 03 Jun 2014 17:31:28 +1000
parents 6bcf47cc272a
children 00278c5fe014
files contra.xml contra_wrapper.pl tool_dependencies.xml
diffstat 3 files changed, 38 insertions(+), 82 deletions(-) [+]
line wrap: on
line diff
--- a/contra.xml	Mon May 19 20:00:44 2014 -0400
+++ b/contra.xml	Tue Jun 03 17:31:28 2014 +1000
@@ -2,8 +2,10 @@
   <description>: Copy Number Analysis for Targeted Resequencing</description>
   <requirements>
     <requirement type="package" version="2.17.0">bedtools</requirement>
-    <requirement type="package" name="samtools" version="0.1.18">samtools</requirement>
-    <requirement type="package" name="contra" version="2.0.4">contra</requirement>
+    <requirement type="package" version="0.1.18">samtools</requirement>
+    <requirement type="package" version="3.0.3">R</requirement>
+    <requirement type="package" version="2.0.4">contra</requirement>
+
   </requirements>
   <command interpreter="perl">
     
--- a/contra_wrapper.pl	Mon May 19 20:00:44 2014 -0400
+++ b/contra_wrapper.pl	Tue Jun 03 17:31:28 2014 +1000
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 
-use FindBin;
+use Find;
 use File::Path qw(make_path);
 use File::Spec;
 
@@ -22,7 +22,7 @@
 	{
 		my $variable = $tmp[1];
 		$variable =~ s/=/ /g;
-		print "$variable\n";
+		
 		$player_options = "$player_options $variable";
 	}
 	elsif($tmp[0] eq "CONTRAOUTPUT") 
@@ -40,52 +40,28 @@
 }
 
 
-my $working_dir = "CONTRA_OUTPUT";
+
+my $working_dir = File::Spec->catfile($contra_dir, 'CONTRA_OUTPUT');
 make_path($contra_dir);
 #remove extension
 
-#run contra 
-system(File::Spec->catfile($FindBin::Bin, 'contra.py') . " -o $working_dir $player_options > /dev/null 2>&1");
+my $cmd = "contra.py -o $working_dir $player_options";
+print "Command to be executed: $cmd\n";
+system($cmd);
 
 #set html
 #print "$contra_output - $working_dir\n";
 open(HTML, ">$contra_output");
 print HTML "<html><head><title>Contra: Copy Number Analysis for Targeted Resequencing</title></head><body><h3>Contra Output Files:</h3><p><ul>\n";
-move_files($working_dir);
+find({wanted => \&add_file, preprocess => sub {sort @_}}, $working_dir);
 print HTML "</ul></p>\n";
 close(HTML);
 
-sub move_files
-{
-	my $local_dir = $_[0];
-	opendir(DIR, $local_dir);
-	#print ("Openning: $local_dir\n");
-	my @FILES= readdir(DIR); 
-	closedir(DIR);
-	foreach my $file (@FILES) 
-	{
-		if ($file eq "." || $file eq "..")
-		{
-			#print ("./ or ../ skipped\n");
-		}
-		elsif (-d "$local_dir/$file")
-		{
-			#print ("moving to: $local_dir/$file\n");
-			move_files("$local_dir/$file");
-		}
-		elsif (-f "$local_dir/$file")
-		{
-			#print ("mv $local_dir/$file $contra_dir\n");
-			print HTML "<li><a href=$file>$file</a></li>\n";
-			system ("mv $local_dir/$file $contra_dir");
-		}
-		else
-		{
-			die("Unrecognized file generated: $file\n");
-		}
-		
-		
-	}
-	
+sub add_file {
+	if (-f $File::Find::name) {
+		my $rel_path = File::Spec->abs2rel($File::Find::name, $working_dir);
+		print ("adding $rel_path\n");
+		print HTML "<li><a href=\"CONTRA_OUTPUT/$rel_path\">$rel_path</a></li>\n";
+ 	}
 }
 
--- a/tool_dependencies.xml	Mon May 19 20:00:44 2014 -0400
+++ b/tool_dependencies.xml	Tue Jun 03 17:31:28 2014 +1000
@@ -1,44 +1,28 @@
 <?xml version="1.0"?>
 <tool_dependency>
+    
+    <package name="R" version="3.0.3">
+        <repository name="package_r_3_0_3" owner="iuc" />
+    </package>
+    
     <package name="samtools" version="0.1.18">
-        <install version="1.0">
-            <actions>
-                <action type="download_by_url">http://sourceforge.net/projects/samtools/files/samtools/0.1.18/samtools-0.1.18.tar.bz2</action>
-                <action type="shell_command">sed -i.bak -e 's/-lcurses/-lncurses/g' Makefile</action>
-                <action type="shell_command">make</action>
-                <action type="move_file">
-                    <source>samtools</source>
-                    <destination>$INSTALL_DIR/bin</destination>
-                </action>
-                <action type="move_file">
-                    <source>misc/maq2sam-long</source>
-                    <destination>$INSTALL_DIR/bin</destination>
-                </action>
-                <action type="set_environment">
-                    <environment_variable name="PATH" action="prepend_to">$INSTALL_DIR/bin</environment_variable>
-                </action>
-            </actions>
-        </install>
-        <readme>
-            Compiling SAMtools requires the ncurses and zlib development libraries.
-        </readme>
+        <repository name="package_samtools_0_1_18" owner="devteam" />
     </package>
 
-
    <package name="bedtools" version="2.17.0">
        <install version="1.0">
-           <actions>
-		<action type="download_by_url" target_filename="bedtools-2.17.0.tar.gz" >http://bedtools.googlecode.com/files/BEDTools.v2.17.0.tar.gz</action>
-		<action type="shell_command">make all</action>
-		<action type="make_directory">$INSTALL_DIR/bin</action>
-		<action type="move_directory_files">
-                    <source_directory>bin</source_directory>
-                    <destination_directory>$INSTALL_DIR/bin</destination_directory>
-                </action>                                
-		<action type="set_environment">
-		   <environment_variable name="PATH" action="prepend_to">$INSTALL_DIR/bin</environment_variable>
-		</action>
-           </actions>
+        <actions>
+            <action type="download_by_url" target_filename="bedtools-2.17.0.tar.gz" >http://bedtools.googlecode.com/files/BEDTools.v2.17.0.tar.gz</action>
+            <action type="shell_command">make all</action>
+            <action type="make_directory">$INSTALL_DIR/bin</action>
+            <action type="move_directory_files">
+                <source_directory>bin</source_directory>
+                <destination_directory>$INSTALL_DIR/bin</destination_directory>
+            </action>                   
+    		<action type="set_environment">
+    		   <environment_variable name="PATH" action="prepend_to">$INSTALL_DIR/bin</environment_variable>
+    		</action>
+        </actions>
        </install>
        <readme>
 		GCC version 4.1 or greater is recommended. 3.x versions will typically not compile BEDTools. g++ required
@@ -48,13 +32,7 @@
         <install version="1.0">
             <actions>
                 <action type="download_by_url">http://downloads.sourceforge.net/project/contra-cnv/CONTRA.V2.0/CONTRA.v2.0.4.tar.gz</action>
-                <action type="shell_command">rm -rf bedtools_installation_guide.txt</action>
-                <action type="shell_command">rm -rf BEDTools-User-Manual.v4.pdf</action>
-                <action type="shell_command">rm -rf BEDTools.v2.11.2.tar.gz</action>
-		<action type="shell_command">rm -rf CONTRA_User_Guide.2.0.pdf</action>
-		<action type="make_directory">$INSTALL_DIR/bin</action>
-		<action type="make_directory">$INSTALL_DIR/bin/scripts</action>
-		<action type="move_file">
+                <action type="move_file">
                     <source>contra.py</source>
                     <destination>$INSTALL_DIR/bin</destination>
                 </action>
@@ -62,7 +40,7 @@
                     <source>baseline.py</source>
                     <destination>$INSTALL_DIR/bin</destination>
                 </action>
-		<action type="move_directory_files">
+                <action type="move_directory_files">
                     <source_directory>scripts</source_directory>
                     <destination_directory>$INSTALL_DIR/bin/scripts</destination_directory>
                 </action>