Hello!

To see the file structure, click on "tree".

Note that updates take place every 10 minutes, commits may not be seen immediately.
Added script to find interactions given a list of genes
authorelserj <elserj@localhost>
Tue, 7 Sep 2010 22:22:07 +0000 (22:22 +0000)
committerelserj <elserj@localhost>
Tue, 7 Sep 2010 22:22:07 +0000 (22:22 +0000)
svn path=/; revision=30

interactome_scripts/find_matching_interactions.pl [new file with mode: 0755]

diff --git a/interactome_scripts/find_matching_interactions.pl b/interactome_scripts/find_matching_interactions.pl
new file mode 100755 (executable)
index 0000000..1fc77cf
--- /dev/null
@@ -0,0 +1,40 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+# program to take a list of genes, and find all interactions in an interaction file (sif format) 
+#     where both interaction genes are in the list
+
+if($#ARGV != 2) {
+       print "usage: find_matching_interactions.pl input_gene_list interaction_file output_file\n";
+       exit;
+}
+
+my $in_file = $ARGV[0];
+my $inter_file = $ARGV[1];
+my $out_file = $ARGV[2];
+
+# read in the genes to look for
+open (in_file, "$in_file");
+
+my %in_hash;
+while(<in_file>) {
+       my $line = $_;
+       chomp $line;
+       
+       $in_hash{$line} = $line;
+}
+
+# read in the interaction file and do the lookups
+open (inter_file, "$inter_file");
+open (out_file, ">$out_file");
+
+while(<inter_file>) {
+       my $line = $_;
+       chomp $line;
+       my ($inter_1, $type, $inter_2) = split("\t", $line);
+       if(defined($in_hash{$inter_1}) && defined($in_hash{$inter_2}) ) {
+               print out_file "$line\n";
+       }
+}