Repository 'activity_files_merge'
hg clone https://toolshed.g2.bx.psu.edu/repos/anmoljh/activity_files_merge

Changeset 0:b06d2e06b740 (2018-05-31)
Next changeset 1:0a71d32d6e51 (2018-06-05)
Commit message:
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
added:
merge_activity_files.pl
merge_activity_files.xml
b
diff -r 000000000000 -r b06d2e06b740 merge_activity_files.pl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/merge_activity_files.pl Thu May 31 11:24:57 2018 -0400
[
@@ -0,0 +1,25 @@
+#!/usr/bin/perl 
+use warnings;
+use strict;
+open(FH,$ARGV[0])  or die "Couldn't open file, $!";
+open(DH,">$ARGV[4]") or die "Couldn't open file, $!";
+my $first_line = scalar <FH>;
+chomp($first_line);
+$first_line = join(",",$first_line,"outcome\n");
+print DH $first_line;
+while(<FH>){chomp($_);
+my $line= join(",",$_,"$ARGV[1]\n");
+print DH $line;
+}
+close FH;
+open(SH,$ARGV[2]) or die "Coudn't open file,$!";
+scalar <SH>;
+while(<SH>){ 
+if($ARGV[1] ne $ARGV[3]){chomp($_);
+my $line1= join(",",$_,"$ARGV[3]\n");
+print DH $line1;
+}
+else{ print ("There is error to assign activity\n");exit;}
+}
+close SH;
+close DH;
b
diff -r 000000000000 -r b06d2e06b740 merge_activity_files.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/merge_activity_files.xml Thu May 31 11:24:57 2018 -0400
b
@@ -0,0 +1,30 @@
+<tool id="merge_activity_files" name="Merge Activity files" version="1.0">
+<description>"Merge data files of Active and Inactive compounds"</description>
+<stdio>
+ <exit_code range="1:" />
+</stdio>
+<command interpreter="perl">merge_activity_files.pl $Input1 $Activity1 $Input2 $Activity2 $Merged_file</command>
+<inputs>
+ <param format="csv" name="Input1" type="data" label="Descriptor File 1" help="Upload Active/Inactive descriptor file in csv format"/>
+  <param name="Activity1" type="text" value="Active" label="Select type of molecules" help="write something which defines data eg active,positive,inactive,negative,etc." >
+    <validator type="empty_field" message="This field can't be left blank"/>
+        </param>
+  <param format="txt" name="Input2" type="data" label="Descriptor File 2" help="Upload Active/Inactive descriptor file in csv format"/>
+  <param name="Activity2" type="text" value="Inactive" label="Select type of molecules" help="write something which defines data eg active,positive,inactive,negative,etc.">
+    <validator type="empty_field" message="This field can't be left blank"/>
+        </param>
+</inputs>
+<outputs>
+    <data format="csv" name="Merged_file" label="Merged Mega Descriptor File"/> 
+</outputs>
+<tests>
+    <test>
+        <param name="Input1" value="actives_with_names.csv"  />
+        <param name="Activity1"  value="Active"  />
+        <param name="Input2" value="inactives_with_names.csv" />
+        <param name="Activity2"  value="Inactive"  />
+        <output name="Merged_file" file="merged.csv" compare="sim_size" delta="90000000" />
+    </test>
+</tests>
+<help>Provide descriptor files of active/positive and inactive/negative molecules and assign them properly.</help>
+</tool>