spficklin 14 years ago
parent
commit
cc5e0c9377

+ 14 - 9
tripal_analysis_interpro/parseInterpro.inc

@@ -305,20 +305,25 @@ function tripal_analysis_interpro_parseSingleXMLFile ($analysis_id, $interproxml
    $type_id = db_result(db_query($sql));
 
    // Load the XML file
-   $interproput =  simplexml_load_file($interproxmlfile);
-
-   // Get entries parsing
-   $xml = $interproput->children();
+   $xml =  simplexml_load_file($interproxmlfile);
 
    // If there is an EBI header then we need to skip that
    // and set our proteins array to be the second element of the array. This
    // occurs if results were generated with the online InterProScan tool.
    // if the XML starts in with the results then this happens when InterProScan
    // is used command-line and we can just use the object as is
-   if(preg_match('/^Header$/',$xml[0]->getname())){
-      $proteins = $xml[1];  
-   } else {
-      $proteins = $xml[0];
+   if(preg_match('/^EBIInterProScanResults/',$xml->getname())){
+      $children = $xml->children();
+      $header = $children[0];
+      $proteins = $children[1];
+   } 
+   // if the XML starts with the <interpro_matches> tag
+   elseif(preg_match('/^interpro_matches/',$xml->getname())) {
+      $proteins = $xml;
+   }
+   else {
+      print "ERROR: cannot parse XML file format is not recognized\n";
+      return;
    }
 
    // Count the number of entires to be processed
@@ -411,7 +416,7 @@ function tripal_analysis_interpro_parseSingleXMLFile ($analysis_id, $interproxml
 			continue;
       }
       if(count($feature_arr) == 0){
-			print "Failed: '$feature' cannot find a matching feature in the database.\n";
+			print "Failed: cannot find a matching feature for '$feature' in the database.\n";
          continue;
       }
       $feature_id = $feature_arr[0]->feature_id;

+ 35 - 0
tripal_analysis_interpro/tripal_analysis_interpro.module

@@ -716,3 +716,38 @@ function tripal_analysis_interpro_extract_keywords ($analysis_id) {
 	print "Finished.\n";
 	
 }
+/**
+ *
+ *
+ * @ingroup tripal_analysis_interpro
+ */
+function tripal_analysis_interpro_job_describe_args($callback,$args){
+
+
+   $new_args = array();
+   if($callback == 'tripal_analysis_interpro_parseXMLFile'){
+
+      // add in the analysis 
+      if($args[0]){
+         $analysis = tripal_core_chado_select('analysis',array('name'),array('analysis_id' => $args[0]));
+      }
+      $new_args['Analysis'] = $analysis[0]->name;
+
+      $new_args['File or Directory Name'] = $args[1];
+
+      if($args[2]){
+         $new_args['Parse GO terms'] = 'Yes';
+      } else {
+         $new_args['Parse GO terms'] = 'No';
+      }
+
+      $new_args['Query name regular expression'] = $args[3];
+      $new_args['Query type'] = $args[4];
+      if($args[5] == 1){
+        $new_args['Feature identifier'] = 'feature unique name';
+      } else {
+        $new_args['Feature identifier'] = 'feature name';
+      }      
+   }
+   return $new_args;
+}

+ 14 - 2
tripal_core/tripal_core.module

@@ -255,5 +255,17 @@ function tripal_core_theme () {
       ),
    );
 }
-
-
+/**
+ *
+ * @ingroup tripal_core
+ */
+function tripal_core_job_describe_args($callback,$args){
+   $new_args = array();
+   if($callback == 'tripal_update_mview'){
+      // get this mview details
+      $sql = "SELECT * FROM {tripal_mviews} WHERE mview_id = %d ";
+      $mview = db_fetch_object(db_query($sql,$args[0]));     
+      $new_args['View Name'] = $mview->name;
+   }
+   return $new_args;
+}

+ 2 - 2
tripal_feature/tripal_feature.module

@@ -1597,7 +1597,7 @@ function tripal_feature_theme () {
  */
 function tripal_feature_preprocess_tripal_organism_feature_counts(&$variables){
    $organism = $variables['node']->organism;
-   $variables['tripal_feature']['feature_counts'] = tripal_feature_load_organism_feature_counts($organism);
+   $organism->feature_counts = tripal_feature_load_organism_feature_counts($organism);
 }
 
 /**
@@ -1607,7 +1607,7 @@ function tripal_feature_preprocess_tripal_organism_feature_counts(&$variables){
  */
 function tripal_feature_preprocess_tripal_organism_feature_browser(&$variables){
    $organism = $variables['node']->organism;
-   $variables['tripal_feature']['browser'] = tripal_feature_load_organism_feature_browser($organism);
+   $organism->feature_browser = tripal_feature_load_organism_feature_browser($organism);
 }