Hello!

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

Note that updates take place every 10 minutes, commits may not be seen immediately.
allow sif file to be a source of gene information
authorathreyab <athreyab@localhost>
Tue, 31 Jan 2012 22:56:55 +0000 (22:56 +0000)
committerathreyab <athreyab@localhost>
Tue, 31 Jan 2012 22:56:55 +0000 (22:56 +0000)
svn path=/; revision=290

Personnel/athreyab/interactions/interactionPathsFromSif.pl

index 9e5b5bb0998994d87838ad95379aecf7249a9c71..eb93e75735b78809c2066f7ea415e25a5479620d 100644 (file)
@@ -165,25 +165,32 @@ sub importSifData
                # strip off newline characters
                chomp $entry;
                $entry =~ s/\r//g;
-      $entry =~ s/\n//g;
-      
-      # split the columns into separate variables
-      my ($accession_left,$interaction_type,$accession_right) = split("\t", $entry);
-      
-      # skip if any of the variables are empty      
-      next if(isEmpty($accession_left));
+    $entry =~ s/\n//g;
+
+               # split the columns into separate variables
+    my ($accession_left,$interaction_type,$accession_right) = split("\t", $entry);
+    
+    # skip if any of the variables are empty      
+    next if(isEmpty($accession_left));
                next if(isEmpty($interaction_type));
                next if(isEmpty($accession_right));
       
-      #get object_id for object in the first column
+    #get object_id for object in the first column
                $accession_left_id = getObjectIdFromAccession($accession_left);
-
-               #get interaction_type_id for object in the first column
-               $interaction_type_id = getInteractionTypeForSifFormat($interaction_type);
+               if(isEmpty($accession_left_id)){
+                       $query = "INSERT INTO Object(`object_accession`, `species_id`) VALUES ('$accession_left', '$speciesIdForSif')";
+                       executeDbQuery($query);         
+                       $accession_left_id = getObjectIdFromAccession($accession_left);
+               }
 
                #get object_id for object in the second column
                $accession_right_id = getObjectIdFromAccession($accession_right);
-
+               if(isEmpty($accession_right_id)){
+                       $query = "INSERT INTO Object(`object_accession`, `species_id`) VALUES ('$accession_right', '$speciesIdForSif')";
+                       executeDbQuery($query);         
+                       $accession_right_id = getObjectIdFromAccession($accession_right);
+               }
+               $interaction_type_id=getInteractionTypeForSifFormat($interaction_type);
                next if(isEmpty($accession_left_id) || isEmpty($accession_right_id) || isEmpty($interaction_type_id));
                
                #check if the interaction is already recorded. Write to database only if it doesn't exist already.e