Browse Source

Removed last extension: unigene_search

spficklin 12 years ago
parent
commit
226347fa81

+ 0 - 40
extensions/tripal_search_unigene/theme/css/tripal_search_unigene.css

@@ -1,40 +0,0 @@
-.tripal_search_unigene-views-exposed-form {
-	margin: 10px;
-	padding:10px;
-	background: #FFFFFF;
-	border: 1px solid #CCCCCC;
-}
-
-.tripal-search-unigene-exposed-widget {
-	clear:both;
-	padding: 5px;
-}
-
-.tripal-search-unigene-form-labels {
-	float:left;
-}
-
-.tripal_search_unigene-views-operator {
-	float:left;
-	clear:none;
-	margin-left: 5px;
-}
-
-.tripal_search_unigene-views-widget {
-	float:left;
-	clear:none;
-	margin-left: 5px;
-}
-
-.tripal_search_unigene-table {
-	margin-left: 10px;
-}
- 
- .tripal-search-unigene-exposed-widgets-fields legend{
-   color:green;
- }
- 
- #tripal_search_unigene-result-top:hover {
-   text-decoration: none;
-   color:#292929;
- }

+ 0 - 20
extensions/tripal_search_unigene/theme/js/tripal_search_unigene.js

@@ -1,20 +0,0 @@
-//
-// Copyright 2009 Clemson University
-//
-
-if (Drupal.jsEnabled) {
-
-   $(document).ready(function(){
-
-		// Move to the result top
-		var result_top = document.getElementById('tripal_search_unigene-result-top');
-		if (result_top) {	
-			 var target_offset = $("#tripal_search_unigene-result-top").offset();
-			 var target_top = target_offset.top;
-			 if (navigator.userAgent.indexOf('MSIE 8.0') !=-1) 	{
-				target_top -= 60;	
-			}
-			$('html, body').animate({scrollTop: target_top}, 1000);
-		}
-   });
-}

+ 0 - 195
extensions/tripal_search_unigene/theme/views-exposed-form--unigene_search.tpl.php

@@ -1,195 +0,0 @@
-<?php
-// $Id: views-exposed-form.tpl.php,v 1.4.4.1 2009/11/18 20:37:58 merlinofchaos Exp $
-/**
- * @file views-exposed-form.tpl.php
- *
- * This template handles the layout of the views exposed filter form.
- *
- * Variables available:
- * - $widgets: An array of exposed form widgets. Each widget contains:
- * - $widget->label: The visible label to print. May be optional.
- * - $widget->operator: The operator for the widget. May be optional.
- * - $widget->widget: The widget itself.
- * - $button: The submit button for the form.
- *
- * @ingroup views_templates
- */
-?>
-<?php if (!empty($q)): ?>
-  <?php
-    // This ensures that, if clean URLs are off, the 'q' is added first so that
-    // it shows up first in the URL.
-    print $q;
-
-  ?>
-<?php endif;     //dsm($widgets);?>
-<div class="tripal_search_unigene-views-exposed-form views-exposed-form">
-  <div class="views-exposed-widgets clear-block">
-    
-    <?php 
-    	$feature_type_id =  $widgets['filter-feature_type']; 
-    	$orgnism_common_name =  $widgets['filter-organism_common_name'];
-    	$analysis_name =  $widgets['filter-unigene'];
-    	$feature_name =  $widgets['filter-feature_name'];
-    	$feature_seqlen =  $widgets['filter-feature_seqlen'];
-    	$cvterm_name =  $widgets['filter-go_term'];
-    	$blast_value =  $widgets['filter-blast_value'];
-    	$interpro_value =  $widgets['filter-interpro_value'];
-    	$kegg_value =  $widgets['filter-kegg_value'];
-    ?>
-    
-    <div id="tripal-search-unigene-exposed-widgets">
-    <div> Search ESTs or unigene contigs by name, assembly, sequence type, length, or their putative function. <br><br></div>
-			<fieldset class="tripal-search-unigene-exposed-widgets-fields">
-				<legend>Search by Name</legend>
-				<div class="tripal-search-unigene-exposed-widget">
-					<div class="tripal-search-unigene-form-labels">
-						<label for="<?php print $orgnism_common_name->id; ?>"><?php print $orgnism_common_name->label; ?>
-						</label>
-					</div>
-					<?php if (!empty($orgnism_common_name->operator)): ?>
-					<div class="tripal_search_unigene-views-operator">
-					<?php print $orgnism_common_name->operator; ?>
-					</div>
-					<?php endif; ?>
-					<div class="tripal_search_unigene-views-widget">
-					<?php print $orgnism_common_name->widget; ?>
-					</div>
-				</div>
-				<div class="tripal-search-unigene-exposed-widget">
-					<div class="tripal-search-unigene-form-labels">
-						<label for="<?php print $feature_name->id; ?>"><?php print $feature_name->label; ?>
-						</label>
-					</div>
-					<?php if (!empty($feature_name->operator)): ?>
-					<div class="tripal_search_unigene-views-operator">
-					<?php print $feature_name->operator; ?>
-					</div>
-					<?php endif; ?>
-					<div class="tripal_search_unigene-views-widget">
-						<?php print $feature_name->widget; ?>
-					</div>
-				</div>
-			</fieldset>
-
-			<fieldset class="tripal-search-unigene-exposed-widgets-fields">
-				<legend>Search by Assembly</legend>
-				<div class="tripal-search-unigene-exposed-widget">
-					<div class="tripal-search-unigene-form-labels">
-						<label for="<?php print $feature_type_id->id; ?>"><?php print $feature_type_id->label; ?>
-						</label>
-					</div>
-					<?php if (!empty($feature_type_id->operator)): ?>
-					<div class="tripal_search_unigene-views-operator">
-					<?php print $feature_type_id->operator; ?>
-					</div>
-					<?php endif; ?>
-					<div class="tripal_search_unigene-views-widget">
-					<?php print $feature_type_id->widget; ?>
-					</div>
-				</div>
-				<div class="tripal-search-unigene-exposed-widget">
-					<div class="tripal-search-unigene-form-labels">
-						<label for="<?php print $analysis_name->id; ?>"><?php print $analysis_name->label; ?>
-						</label>
-					</div>
-					<?php if (!empty($analysis_name->operator)): ?>
-					<div class="tripal_search_unigene-views-operator">
-					<?php print $analysis_name->operator; ?>
-					</div>
-					<?php endif; ?>
-					<div class="tripal_search_unigene-views-widget">
-						<?php print $analysis_name->widget; ?>
-					</div>
-				</div>
-			</fieldset>
-
-			<fieldset class="tripal-search-unigene-exposed-widgets-fields">
-				<legend>Search by Sequence</legend>
-				<div class="tripal-search-unigene-exposed-widget">
-					<div class="tripal-search-unigene-form-labels">
-						<label for="<?php print $feature_seqlen->id; ?>"><?php print $feature_seqlen->label; ?>
-						</label>
-					</div>
-					<?php if (!empty($feature_seqlen->operator)): ?>
-					<div class="tripal_search_unigene-views-operator">
-					<?php print $feature_seqlen->operator; ?>
-					</div>
-					<?php endif; ?>
-					<div class="tripal_search_unigene-views-widget">
-					<?php print $feature_seqlen->widget; ?>
-					</div>
-				</div>
-			</fieldset>
-
-			<fieldset class="tripal-search-unigene-exposed-widgets-fields">
-				<legend>Search by Putative Function</legend>
-				<div class="tripal-search-unigene-exposed-widget">
-					<div class="tripal-search-unigene-form-labels">
-						<label for="<?php print $cvterm_name->id; ?>"><?php print $cvterm_name->label; ?>
-						</label>
-					</div>
-					<?php if (!empty($cvterm_name->operator)): ?>
-					<div class="tripal_search_unigene-views-operator">
-					<?php print $cvterm_name->operator; ?>
-					</div>
-					<?php endif; ?>
-					<div class="tripal_search_unigene-views-widget">
-					<?php print $cvterm_name->widget; ?>
-					</div>
-				</div>
-
-				<div class="tripal-search-unigene-exposed-widget">
-					<div class="tripal-search-unigene-form-labels">
-						<label for="<?php print $blast_value->id; ?>"><?php print $blast_value->label; ?>
-						</label>
-					</div>
-					<?php if (!empty($blast_value->operator)): ?>
-					<div class="tripal_search_unigene-views-operator">
-					<?php print $blast_value->operator; ?>
-					</div>
-					<?php endif; ?>
-					<div class="tripal_search_unigene-views-widget">
-						<?php print $blast_value->widget; ?>
-					</div>
-				</div>
-				
-				<div class="tripal-search-unigene-exposed-widget">
-					<div class="tripal-search-unigene-form-labels">
-						<label for="<?php print $kegg_value->id; ?>"><?php print $kegg_value->label; ?>
-						</label>
-					</div>
-					<?php if (!empty($kegg_value->operator)): ?>
-					<div class="tripal_search_unigene-views-operator">
-					<?php print $kegg_value->operator; ?>
-					</div>
-					<?php endif; ?>
-					<div class="tripal_search_unigene-views-widget">
-						<?php print $kegg_value->widget; ?>
-					</div>
-				</div>
-				
-				<div class="tripal-search-unigene-exposed-widget">
-					<div class="tripal-search-unigene-form-labels">
-						<label for="<?php print $interpro_value->id; ?>"><?php print $interpro_value->label; ?>
-						</label>
-					</div>
-					<?php if (!empty($interpro_value->operator)): ?>
-					<div class="tripal_search_unigene-views-operator">
-					<?php print $interpro_value->operator; ?>
-					</div>
-					<?php endif; ?>
-					<div class="tripal_search_unigene-views-widget">
-						<?php print $interpro_value->widget; ?>
-					</div>
-				</div>
-			</fieldset>
-
-		</div>
-    
-    <div class="tripal-search-unigene-exposed-widget">
-    	<input TYPE="Button" value="Reset" onClick="window.location = '<?php global $base_url; print "$base_url/est_search"?>';">
-      <?php $button = preg_replace("'Apply'", "Search", $button); print $button ?>
-    </div>
-  </div>
-</div>

+ 0 - 221
extensions/tripal_search_unigene/theme/views-view-table--unigene_search.tpl.php

@@ -1,221 +0,0 @@
-<?php
-// $Id: views-view-table.tpl.php,v 1.8 2009/01/28 00:43:43 merlinofchaos Exp $
-/**
- * @file views-view-table.tpl.php
- * Template to display a view as a table.
- *
- * - $title : The title of this group of rows.  May be empty.
- * - $header: An array of header labels keyed by field id.
- * - $fields: An array of CSS IDs to use for each field id.
- * - $class: A class or classes to apply to the table, based on settings.
- * - $row_classes: An array of classes to apply to each row, indexed by row
- *   number. This matches the index in $rows.
- * - $rows: An array of row items. Each row is an array of content.
- *   $rows are keyed by row number, fields within rows are keyed by field ID.
- * @ingroup views_templates
- */
-?>
-
-<?php
-$total = $view->total_rows;
-$query = $view->build_info['query'];
-$pager = $view->pager;
-$limit = $pager ['items_per_page'];
-$offset = $pager ['current_page'] * $limit;
-$args = $view->build_info['query_args'];
-global $base_url;
-?>
-
-<a id="tripal_search_unigene-result-top" name="search_results">
-&nbsp;&nbsp;&nbsp;Your search produced <b><?php print $total ?></b> results<br>
-<i>&nbsp;&nbsp;&nbsp;Note: To get complete annotation for a sequence, click on the sequence name.</i>
-</a>
-<table class="tripal_search_unigene-table <?php print $class; ?> tripal-table-horz">
-  <?php if (!empty($title)) : ?>
-    <caption><?php print $title; ?></caption>
-  <?php endif; ?>
-  <thead>
-    <tr class="tripal_search_unigene-table-header tripal-table-header">
-      <?php foreach ($header as $field => $label): ?>
-        <th class="views-field views-field-<?php print $fields[$field]; ?>">
-          <?php print $label; ?>
-        </th>
-      <?php endforeach; ?>
-    </tr>
-  </thead>
-  <tbody>
-    <?php foreach ($rows as $count => $row): 
-    			$rowclass = "";
-    			if ($count % 2 != 0) {
-    				$rowclass = "tripal_search_unigene-table-even-row tripal-table-even-row";
-    			} else {
-    				$rowclass = "tripal_search_unigene-table-odd-row tripal-table-odd-row";
-    			}
-    ?>
-      <tr class="<?php print $rowclass?> <?php print implode(' ', $row_classes[$count]); ?>">
-        <?php foreach ($row as $field => $content): ?>
-          <td class="views-field views-field-<?php print $fields[$field]; ?>">
-            <?php print $content; ?>
-          </td>
-        <?php endforeach; ?>
-      </tr>
-    <?php endforeach; ?>
-  </tbody>
-</table>
-
-<?php /* if ($count != 0) {
-	// Generate Excel files
-	// set parameters for excel file
-	$param_excel= array();
-	global $user;
-	$dir = file_directory_path().'/tripal/tripal_search_unigene/'.session_id();
-	if (!file_exists($dir)) {
-		mkdir ($dir, 0777);
-	}
-	$file =session_id().'/unigene_search_result.xls';
-	
-	$param_excel['sheet_name']		= 'unigene_search';
-	$path = "/tripal/tripal_search_unigene/$file";
-	$param_excel['filename']		= file_directory_path().$path;
-	$path_url =url("sites/default/files/tripal/tripal_search_unigene/$file");
-	# set SQL
-	$sql = "$query LIMIT $limit OFFSET $offset";
-	# create heades
-	$col_chr = 'A';
-	$headers = array();
-	$headers[$col_chr++] = array('align' => 'left', 'width' => 20, 'type' => 'hyperlink', 'field' => 'unigene_for_search_feature_name', 'heading' => 'Feature name');
-	$headers[$col_chr++] = array('align' => 'left', 'width' => 10, 'type' => 'text', 'field' => 'unigene_for_search_organism_common_name', 'heading' => 'Organism');
-	$headers[$col_chr++] = array('align' => 'left', 'width' => 10, 'type' => 'text', 'field' => 'unigene_for_search_feature_seqlen', 'heading' => 'Length');
-	$headers[$col_chr++] = array('align' => 'left', 'width' => 10, 'type' => 'text', 'field' => 'unigene_for_search_feature_type', 'heading' => 'Type');
-	$headers[$col_chr++] = array('align' => 'left', 'width' => 20, 'type' => 'text', 'field' => 'unigene_for_search_go_term', 'heading' => 'GO term');
-	$headers[$col_chr++] = array('align' => 'left', 'width' => 20, 'type' => 'text', 'field' => 'unigene_for_search_blast_value', 'heading' => 'Blast');
-	$headers[$col_chr++] = array('align' => 'left', 'width' => 20, 'type' => 'text', 'field' => 'unigene_for_search_kegg_value', 'heading' => 'KEGG');
-	$headers[$col_chr++] = array('align' => 'left', 'width' => 20, 'type' => 'text', 'field' => 'unigene_for_search_interpro_value', 'heading' => 'Interpro');
-	
-	# populate data
-	$result = chado_query($sql, $args);
-	$data = array();
-	while ($row = db_fetch_array($result)) {
-		$data[] = array ('unigene_for_search_feature_name' => $row['unigene_for_search_feature_name'],
-									 'hyperlink_unigene_for_search_feature_name' => "$base_url/ID".$row['unigene_for_search_feature_id'],
-									 'unigene_for_search_organism_common_name' => $row['unigene_for_search_organism_common_name'],
-									 'unigene_for_search_feature_seqlen' => $row['unigene_for_search_feature_seqlen'],
-									 'unigene_for_search_feature_type' => $row['unigene_for_search_feature_type'],
-									 'unigene_for_search_go_term' => $row['unigene_for_search_go_term'],
-									 'unigene_for_search_blast_value' => $row['unigene_for_search_blast_value'],
-									 'unigene_for_search_kegg_value' => $row['unigene_for_search_kegg_value'],
-									 'unigene_for_search_interpro_value' => $row['unigene_for_search_interpro_value']
-									 );
-	}
-	# add headers and data
-	$param_excel['contents']['sheet']['headers']= $headers;
-	$param_excel['contents']['sheet']['data']= $data;
-	# generate excel
-	ml_generate_excel($param_excel);
-	print "&nbsp;&nbsp;&nbsp;<a href=\"$path_url\">Download as Excel file</a>";
-	
-}
-*/?>
-
-<?php 
-# ----------------------------------------- #
-# [UD] ml_generate_excel
-# ----------------------------------------- #
-function ml_generate_excel ($param_excel) {
-	# get and update parameters
-	$writer		= ($param_excel['version'] == '2007') ? 'Excel2007' : 'Excel5';
-	$link_clr	= (empty($param_excel['link_clr'])) ? '0000FF' : $param_excel['link_clr'];
-	$filename	= $param_excel['filename'];
-	if (!preg_match("/(xls|xlsx)$/", $filename)) {
-		$filename = ($param_excel['version'] == '2007') ? $filename.'.xlsx' : $filename.'.xls';
-	}
-	/*********************************************/
-	# create an excel file
-	/*********************************************/
-	# create new PHPExcel object
-	$excel = new PHPExcel();
-	# Set properties
-	$excel->getProperties()->setCreator("Main Lab");
-	$excel->getProperties()->setLastModifiedBy("Main Lab");
-	$excel->getProperties()->setTitle("Office 2007 XLSX Document");
-	$excel->getProperties()->setSubject("");
-	$excel->getProperties()->setKeywords("");
-	$excel->getProperties()->setCategory("");
-	$excel->getProperties()->setDescription("");
-	# set default styles
-	$excel->getDefaultStyle()->getFont()->setName('Times New Roman');
-	$excel->getDefaultStyle()->getFont()->setSize(11);
-	# create worksheets
-	$sheet_no= 0;
-	foreach ($param_excel['contents'] as $sheet_name => $sheet) {
-		if ($sheet_no != 0) {
-			# add a new worksheet
-			$excel->createSheet();
-		}	
-		# set active sheet
-		$excel->setActiveSheetIndex($sheet_no);		
-		# get current worksheet
-		$worksheet = $excel->getActiveSheet();	
-		# set title for this sheet
-		$worksheet->setTitle($sheet_name);
-		# get headers
-		$headers= $param_excel['contents'][$sheet_name]['headers'];
-		# set style and headings for headers
-		foreach ($headers as $col_chr => $prop) {
-			# set alignment for column
-			$align= PHPExcel_Style_Alignment::HORIZONTAL_LEFT;
-			if ($prop['align'] == 'right') {
-				$align= PHPExcel_Style_Alignment::HORIZONTAL_RIGHT;
-			}
-			else if ($prop['align'] == 'center') {
-				$align= PHPExcel_Style_Alignment::HORIZONTAL_CENTER;
-			}
-			$worksheet->getStyle($col_chr.'1')->getAlignment()->setHorizontal($align);		
-			# set width
-			$worksheet->getColumnDimension($col_chr)->setWidth($prop['width']);
-			$worksheet->getStyle($col_chr.'1')->getFont()->setBold(true);
-			$worksheet->getStyle($col_chr.'1')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID);
-			$worksheet->getStyle($col_chr.'1')->getFill()->getStartColor()->setARGB('FFCDCDCD');
-			$worksheet->setCellValue($col_chr.'1', $prop['heading']);
-		}		
-		# add data to current worksheet
-		foreach ($param_excel['contents'][$sheet_name]['data'] as $idx => $row) {
-			foreach ($headers as $col_chr => $prop) {
-				$loc= $col_chr.($idx+2);
-				# set alignment for cell
-				$align= PHPExcel_Style_Alignment::HORIZONTAL_LEFT;
-				if ($prop['align'] == 'right') {
-					$align= PHPExcel_Style_Alignment::HORIZONTAL_RIGHT;
-				}
-				else if ($prop['align'] == 'center') {
-					$align= PHPExcel_Style_Alignment::HORIZONTAL_CENTER;
-				}
-				$worksheet->getStyle($loc)->getAlignment()->setHorizontal($align);
-				
-				if (!empty($row[$prop['field']])) {
-					# set cell value
-					if ($prop['type'] == 'text') {
-						$worksheet->setCellValue($loc, $row[$prop['field']]);
-					}
-					else if ($prop['type'] == 'hyperlink') {
-						$worksheet->setCellValue($loc, $row[$prop['field']]);
-						if ($row['hyperlink_'.$prop['field']]) {
-							# add underline
-							$worksheet->getStyle($loc)->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE);
-							# set link color
-							$worksheet->getStyle($loc)->getFont()->getColor()->setRGB($link_clr);		
-							# set URL
-							$worksheet->getCell($loc)->getHyperlink()->setUrl($row['hyperlink_'.$prop['field']]);
-						}
-					}
-				}
-			}
-		}
-		$sheet_no++;
-	}	
-		# create excel file
- 		$excel->setActiveSheetIndex(0);
- 		$objWriter = PHPExcel_IOFactory::createWriter($excel, $writer);
- 		$objWriter->save($filename);
-}
-?>

+ 0 - 12
extensions/tripal_search_unigene/tripal_search_unigene.info

@@ -1,12 +0,0 @@
-; $Id$
-package = Tripal Extensions
-name = Tripal Search Unigene
-description = A module to provide advanced search functions for unigenes
-core = 6.x
-
-dependencies[] = tripal_core
-dependencies[] = tripal_organism
-dependencies[] = tripal_cv
-dependencies[] = tripal_feature
-dependencies[] = tripal_analysis
-dependencies[] = views

+ 0 - 155
extensions/tripal_search_unigene/tripal_search_unigene.install

@@ -1,155 +0,0 @@
-<?php
-
-/*******************************************************************************
-*  Implementation of hook_install();
-*/
-function tripal_search_unigene_install(){
-
-   // create the module's data directory
-   tripal_create_moddir('tripal_search_unigene');
-	
-	// Create a sequence as the primiry key for the unigene_for_search
-	$sql = "DROP SEQUENCE IF EXISTS unigene_for_search_id; CREATE SEQUENCE unigene_for_search_id";
-	chado_query($sql);	
-
-	$view_name = 'unigene_for_search';
-   // Drop the MView table if it exists
-   $mview_id = tripal_mviews_get_mview_id($view_name);
-   if($mview_id){
-      tripal_mviews_action("delete",$mview_id);
-   }
-
-   $schema = " unigene_for_search_id integer, 
-   							  feature_id integer,
-   							  feature_type character varying(1024),
-   							  feature_name character varying(1024),
-   							  feature_uniquename text,
-   							  feature_is_obsolete boolean,
-   							  organism_common_name character varying(255),
-   							  feature_seqlen integer,
-   							  go_term character varying(1024),
-   							  unigene character varying(255),
-   							  blast_value text,
-   							  kegg_value text,
-   							  interpro_value text
-   							  ";
-   
-   $index = "feature_id, go_term, unigene, blast_value, kegg_value, interpro_value";
-   $singlet_type_id = tripal_cv_get_cvterm_by_name('singlet_in_analysis');
-   if ($singlet_type_id) {
-   	$singlet_condition = " AND F.feature_id NOT IN (SELECT feature_id from feature
-   						   WHERE type_id = (select cvterm_id from cvterm where name = 'EST')
-   						   AND feature_id NOT IN (SELECT F.feature_id FROM feature F
-   						   INNER JOIN featureprop FP ON F.feature_id = FP.feature_id
-   						   AND FP.type_id = (select cvterm_id from cvterm where name = 'singlet_in_analysis')))";
-   }
-   $EST_type = db_result(chado_query("SELECT cvterm_id FROM {cvterm} WHERE name = 'EST' AND cv_id = (SELECT cv_id FROM {cv} WHERE name = 'sequence')")); //P.S. 'EST' is not a tripal term
-   $sql = "SELECT nextval ('unigene_for_search_id') AS unigene_for_search_id, T.* FROM (
-						SELECT F.feature_id AS feature_id, 
-										(SELECT name FROM cvterm WHERE F.type_id = cvterm_id) AS feature_type,
-										F.name AS feature_name, 
-										F.uniquename AS feature_uniquename,
-										F.is_obsolete AS feature_is_obsolete,
-										O.common_name AS organism_common_name, 
-										F.seqlen AS feature_seqlen, 
-										C.name AS go_term,
-										UNIGENE.name AS unigene_name,
-										BLAST.value AS blast_value, 
-										KEGG.value AS KEGG_value, 
-										INTERPRO.value AS interpro_value 
-						FROM feature F
-						LEFT JOIN organism O ON F.organism_id = O.organism_id 
-						LEFT JOIN feature_cvterm FC ON F.feature_id = FC.feature_id 
-						LEFT JOIN cvterm C ON FC.cvterm_id = C.cvterm_id 
-						LEFT JOIN (SELECT AF.feature_id, AFP.value FROM analysisfeatureprop AFP
-													INNER JOIN analysisfeature AF ON AF.analysisfeature_id = AFP.analysisfeature_id
-													WHERE type_id = (SELECT cvterm_id FROM cvterm 
-																								WHERE name = 'analysis_blast_besthit_description' 
-																								AND cv_id = (SELECT cv_id FROM cv WHERE name = 'tripal')
-																								) GROUP BY feature_id, value
-													) BLAST ON BLAST.feature_id = F.feature_id
-						LEFT JOIN (SELECT AF.feature_id, AFP.value FROM analysisfeatureprop AFP
-													INNER JOIN analysisfeature AF ON AF.analysisfeature_id = AFP.analysisfeature_id
-													WHERE type_id = (SELECT cvterm_id FROM cvterm 
-																								WHERE name = 'analysis_kegg_output_keywords' 
-																								AND cv_id = (SELECT cv_id FROM cv WHERE name = 'tripal')
-																								) GROUP BY feature_id, value			
-													) KEGG ON KEGG.feature_id = F.feature_id
-						LEFT JOIN (SELECT AF.feature_id, AFP.value FROM analysisfeatureprop AFP
-													INNER JOIN analysisfeature AF ON AF.analysisfeature_id = AFP.analysisfeature_id
-													WHERE type_id = (SELECT cvterm_id FROM cvterm
-																								WHERE name = 'analysis_interpro_output_keywords' 
-																								AND cv_id = (SELECT cv_id FROM cv WHERE name = 'tripal')
-																								) GROUP BY feature_id, value
-													) INTERPRO ON INTERPRO.feature_id = F.feature_id 
-						LEFT JOIN (SELECT * FROM analysisfeature AF 
-													INNER JOIN analysis A ON A.analysis_id = AF.analysis_id 
-													INNER JOIN analysisprop AP ON AF.analysis_id = AP.analysis_id
-													WHERE AP.type_id = (SELECT cvterm_id FROM cvterm
-																								WHERE name = 'analysis_type' 
-																								AND cv_id = (SELECT cv_id FROM cv WHERE name = 'tripal')
-																								)
-													AND value = 'tripal_analysis_unigene') UNIGENE ON F.feature_id = UNIGENE.feature_id
-						WHERE F.type_id != (SELECT cvterm_id FROM cvterm WHERE name = 'EST_match') $singlet_condition
-						) T";
-   
-      // Create the MView
-      tripal_add_mview(
-      // view name
-      $view_name,
-      // tripal module name
-      ' tripal_search_unigene',
-      // table name
-      $view_name,
-      // table schema definition
-		$schema,
-      // columns for indexing
-      $index,
-      // SQL statement to populate the view
-      $sql,
-      // special index
-      ''
-   );
-
-   // add a job to the job queue so this view gets updated automatically next
-   // time the job facility is run
-   $mview_id = tripal_mviews_get_mview_id($view_name);
-   if($mview_id){
-      tripal_mviews_action('update',$mview_id);
-   }
-
-}
-
-/*******************************************************************************
- * Implementation of hook_uninstall()
- */
-function tripal_search_unigene_uninstall(){
-	$view_name = 'unigene_for_search';
-	// Drop the MView table if it exists
-	$mview_id = tripal_mviews_get_mview_id($view_name);
-	if($mview_id){
-		tripal_mviews_action("delete",$mview_id);
-	}
-	 
-	// Drop the sequence
-	$sql = "DROP SEQUENCE IF EXISTS unigene_for_search_id";
-	chado_query($sql);
-}
-
-/*******************************************************************************
- * Implementation of hook_requirements(). Make sure 'Tripal Core' is enabled
- * before installation
- */
-function tripal_search_unigene_requirements($phase) {
-   $requirements = array();
-   if ($phase == 'install') {
-      if (!function_exists('tripal_create_moddir')) {
-         $requirements ['tripal_search_unigene'] = array(
-            'title' => "tripal_search_unigene",
-            'value' => "error. Some required modules are just being installed. Please try again.",
-            'severity' => REQUIREMENT_ERROR,
-         );
-      }
-   }
-   return $requirements;
-}

+ 0 - 58
extensions/tripal_search_unigene/tripal_search_unigene.module

@@ -1,58 +0,0 @@
-<?php
-
-// require_once "PHPExcel/Classes/PHPExcel.php";
-
-/*************************************************************************
- * tripal_search_unigene_init
- */
-function tripal_search_unigene_init(){
-	drupal_add_css(drupal_get_path('module', 'tripal_search_unigene').'/theme/css/tripal_search_unigene.css');
-	drupal_add_js(drupal_get_path('module', 'tripal_search_unigene').'/theme/js/tripal_search_unigene.js');
-}
-
-/*************************************************************************
- * tripal_search_unigene_views_api
- */
-function tripal_search_unigene_views_api() {
-   return array(
-      'api' => 2.0,
-   );
-}
-
-// A function to rewrite the SQL statement before submitting the query
-// Force GROUP BY feature_id and return only one row
-
-function  tripal_search_unigene_views_pre_execute(&$view){
-	if ($view->name == 'unigene_search') {
-
-		// AGGREGATORS
-		$search = array('SELECT');
-		$replace = array('SELECT min(');
-		$view->build_info['query'] = str_replace($search, $replace, $view->build_info['query']);
-		$view->build_info['count_query']  = str_replace($search, $replace, $view->build_info['count_query']);
-		 
-		$search = array(',');
-		$replace = array(', min(');
-		$view->build_info['query'] = str_replace($search, $replace, $view->build_info['query']);
-		$view->build_info['count_query']  = str_replace($search, $replace, $view->build_info['count_query']);
-		 
-		$search = array(' AS ');
-		$replace = array(') AS ');
-		$view->build_info['query'] = str_replace($search, $replace, $view->build_info['query']);
-		$view->build_info['count_query']  = str_replace($search, $replace, $view->build_info['count_query']);
-
-		// GROUP BY
-		if (preg_match("'ORDER BY'",  $view->build_info['query'])) {
-			$search = array('ORDER BY');
-			$replace = array('GROUP BY unigene_for_search.feature_id ORDER BY');
-			$view->build_info['query'] = str_replace($search, $replace, $view->build_info['query']);
-		} else {
-			$view->build_info['query']  .= " GROUP BY unigene_for_search.feature_id";
-		}
-		$view->build_info['count_query'] .= " GROUP BY unigene_for_search.feature_id";
-		 
-		//drupal_set_message($view->build_info['query']);
-		//drupal_set_message($view->build_info['count_query']);
-		 
-	}
-}

+ 0 - 952
extensions/tripal_search_unigene/tripal_search_unigene.views.inc

@@ -1,952 +0,0 @@
-<?php
-
-/*************************************************************************
- * tripal_search_unigene_views_data()
- */
-
-function tripal_search_unigene_views_data()  {
-	global $db_url;
-	$data = array();
-	
-	// if the chado database is not local to the drupal database
-	// then we need to set the database name.  This should always
-	// be 'chado'.
-	if(is_array($db_url) and array_key_exists('chado', $db_url)) {
-		$database = 'chado';
-	}
-	
- 	// Basic table definition
-	$data['unigene_for_search']['table']['group'] = 'Tripal Search feature';
-	$data['unigene_for_search']['table']['base'] = array(
-		'field' => 'unigene_for_search_id',
-		'title' => t('Chado Feature with searchable annotations'),
-		'help'  => t('A materialized view for feature is generated to enable the search for different annotations'),
-	);
- 	if ($database) {
- 		$data['unigene_for_search']['table']['base']['database'] = $database;
-	}
-	
-	// Table Field Definitions----------------------
-	// Field: feature_id (integer)
-	$data['unigene_for_search']['unigene_for_search_id'] = array(
-		'title' => t('unigene_for_search ID'),
-		'help' => t('The primary key of unigene_for_search'),
-		'field' => array(
-			'handler' => 'views_handler_field_numeric',
-			'click sortable' => TRUE,
-		),
-		'sort' => array(
-			'handler' => 'views_handler_sort',
-		),
-		'filter' => array(
-			'handler' => 'views_handler_filter_numeric',
-		),
-	);
-			
-	// Field: feature_id (integer)
-	$data['unigene_for_search']['feature_id'] = array(
-		'title' => t('feature ID'),
-		'help' => t('The primary key of a feature'),
-		'field' => array(
-			'handler' => 'views_handler_field_numeric',
-			'click sortable' => TRUE,
-		),
-		'sort' => array(
-			'handler' => 'views_handler_sort',
-		),
-		'filter' => array(
-			'handler' => 'views_handler_filter_numeric',
-		),
-	);
-	
-	// Field: name (character varying(1024))
-	$data['unigene_for_search']['feature_type'] = array(
-		'title' => t('feature_type'),
-		'help' => t('Type of the feature'),
-		'field' => array(
-			'handler' => 'views_handler_field',
-			'click sortable' => TRUE,
-		),
-		'sort' => array(
-			'handler' => 'views_handler_sort',
-		),
-		'filter' => array(
-			'handler' => 'views_handler_filter_feature_type_id',
-		),
-		'argument' => array(
-			'handler' => 'views_handler_argument_string',
-		),
-	);
-	
-	// Field: name (character varying(255),)
-	$data['unigene_for_search']['feature_name'] = array(
-		'title' => t('feature_name'),
-		'help' => t('The optional human-readable common name for a feature, for display purposes.'),
-		'field' => array(
-			'handler' => 'views_handler_field',
-			'click sortable' => TRUE,
-		),
-		'sort' => array(
-			'handler' => 'views_handler_sort',
-		),
-		'filter' => array(
-			'handler' => 'views_handler_filter_string',
-		),
-		'argument' => array(
-			'handler' => 'views_handler_argument_string',
-		),
-	);
-	
-		// Field: uniquename (text)
-	$data['unigene_for_search']['feature_uniquename'] = array(
-		'title' => t('feature_uniquename'),
-		'help' => t('The unique name for a feature; may not be necessarily be particularly human-readable, although this is preferred. This name must be unique for this type of feature within this organism.'),
-		'field' => array(
-			'handler' => 'views_handler_field',
-			'click sortable' => TRUE,
-		),
-		'sort' => array(
-			'handler' => 'views_handler_sort',
-		),
-		'filter' => array(
-			'handler' => 'views_handler_filter_string',
-		),
-		'argument' => array(
-			'handler' => 'views_handler_argument_string',
-		),
-	);
-	
-	// Field: is_obsolete (boolean)
-	$data['unigene_for_search']['feature_is_obsolete'] = array(
-		'title' => t('feature_is_obsolete'),
-		'help' => t('Boolean indicating whether this feature has been obsoleted. Some chado instances may choose to simply remove the feature altogether, others may choose to keep an obsolete row in the table.'),
-		'field' => array(
-			'handler' => 'views_handler_field',
-			'click sortable' => TRUE,
-		),
-		'sort' => array(
-			'handler' => 'views_handler_sort',
-		),
-		'filter' => array(
-			'handler' => 'views_handler_filter_boolean_operator_string',
-		),
-	);
-	
-	// Field: common name (varchar 255)
-  $data['unigene_for_search']['organism_common_name'] = array(
-    'title' => 'organism_common_name',
-    'help' => 'The common name of the organism.',
-    'field' => array(
-       'handler' => 'views_handler_field',
-       'click sortable' => TRUE,
-     ),
-     'sort' => array(
-       'handler' => 'views_handler_sort',
-     ),
-     'filter' => array(
-       'handler' => 'views_handler_filter_organism_common_name',
-     ),
-     'argument' => array(
-       'handler' => 'views_handler_argument_string',
-     ),
-  );
-  
-  	// Field: seqlen (integer)
-	$data['unigene_for_search']['feature_seqlen'] = array(
-		'title' => t('feature_seqlen'),
-		'help' => t('The length of the residue feature. See column:residues. This column is partially redundant with the residues column, and also with featureloc. This column is required because the location may be unknown and the residue sequence may not be manifested, yet it may be desirable to store and query the length of the feature. The seqlen should always be manifested where the length of the sequence is known.'),
-		'field' => array(
-			'handler' => 'views_handler_field_numeric',
-			'click sortable' => TRUE,
-		),
-		'sort' => array(
-			'handler' => 'views_handler_sort',
-		),
-		'filter' => array(
-			'handler' => 'views_handler_filter_numeric',
-		),
-	);
-	
-		// Field: name (character varying(1024))
-	$data['unigene_for_search']['go_term'] = array(
-		'title' => t('go_term'),
-		'help' => t('GO Terms associated with a feature'),
-		'field' => array(
-			'handler' => 'views_handler_field',
-			'click sortable' => TRUE,
-		),
-		'sort' => array(
-			'handler' => 'views_handler_sort',
-		),
-		'filter' => array(
-			'handler' => 'views_handler_filter_string',
-		),
-		'argument' => array(
-			'handler' => 'views_handler_argument_string',
-		),
-	);
-		
-	// Field: name (character varying(255),)
-	$data['unigene_for_search']['unigene'] = array(
-		'title' => t('unigene'),
-		'help' => t('Unigene analysis name.'),
-		'field' => array(
-			'handler' => 'views_handler_field',
-			'click sortable' => TRUE,
-		),
-		'sort' => array(
-			'handler' => 'views_handler_sort',
-		),
-		'filter' => array(
-			'handler' => 'views_handler_filter_analysis_name',
-		),
-		'argument' => array(
-			'handler' => 'views_handler_argument_string',
-		),
-	);
-	
-		// Field: value (text,)
-	$data['unigene_for_search']['blast_value'] = array(
-		'title' => t('value'),
-		'help' => t(''),
-		'field' => array(
-			'handler' => 'views_handler_field',
-			'click sortable' => TRUE,
-		),
-		'sort' => array(
-			'handler' => 'views_handler_sort',
-		),
-		'filter' => array(
-			'handler' => 'views_handler_filter_string',
-		),
-		'argument' => array(
-			'handler' => 'views_handler_argument_string',
-		),
-	);
-	
-		// Field: value (text,)
-	$data['unigene_for_search']['kegg_value'] = array(
-		'title' => t('value'),
-		'help' => t(''),
-		'field' => array(
-			'handler' => 'views_handler_field',
-			'click sortable' => TRUE,
-		),
-		'sort' => array(
-			'handler' => 'views_handler_sort',
-		),
-		'filter' => array(
-			'handler' => 'views_handler_filter_string',
-		),
-		'argument' => array(
-			'handler' => 'views_handler_argument_string',
-		),
-	);
-	
-		// Field: value (text,)
-	$data['unigene_for_search']['interpro_value'] = array(
-		'title' => t('value'),
-		'help' => t(''),
-		'field' => array(
-			'handler' => 'views_handler_field',
-			'click sortable' => TRUE,
-		),
-		'sort' => array(
-			'handler' => 'views_handler_sort',
-		),
-		'filter' => array(
-			'handler' => 'views_handler_filter_string',
-		),
-		'argument' => array(
-			'handler' => 'views_handler_argument_string',
-		),
-	);
-
-	return $data;
-}
-
-/*************************************************************************
- * tripal_search_unigene_views_handlers
- */
-function tripal_search_unigene_views_handlers() {
- return array(
-   'info' => array(
-     'path' => drupal_get_path('module', 'tripal_search_unigene'),
-   ),
-   'handlers' => array(
-   	'views_handler_filter_organism_common_name' => array(
-   		'parent' => 'views_handler_filter_string'
-   	),
-   	'views_handler_filter_analysis_name' => array(
-   		'parent' => 'views_handler_filter_string'
-   	),
-   	'views_handler_filter_feature_type_id' => array(
-   		'parent' => 'views_handler_filter_numeric'
-   	),
-   ),
- );
-}
-
-/*************************************************************************
- * tripal_search_unigene_views_default_views
- */
-function tripal_search_unigene_views_default_views () {
-	$views = array();
-	$view = new view;
-	$view->name = 'unigene_search';
-	$view->description = 'Unigene Search';
-	$view->tag = '';
-	$view->view_php = '';
-	$view->base_table = 'unigene_for_search';
-	$view->is_cacheable = FALSE;
-	$view->api_version = 2;
-	$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
-	$handler = $view->new_display('default', 'Defaults', 'default');
-	$handler->override_option('fields', array(
-  'counter' => array(
-    'label' => '#',
-    'alter' => array(
-      'alter_text' => 0,
-      'text' => '',
-      'make_link' => 0,
-      'path' => '',
-      'link_class' => '',
-      'alt' => '',
-      'prefix' => '',
-      'suffix' => '',
-      'target' => '',
-      'help' => '',
-      'trim' => 0,
-      'max_length' => '',
-      'word_boundary' => 1,
-      'ellipsis' => 1,
-      'html' => 0,
-      'strip_tags' => 0,
-	),
-    'empty' => '',
-    'hide_empty' => 0,
-    'empty_zero' => 0,
-    'counter_start' => '1',
-    'exclude' => 0,
-    'id' => 'counter',
-    'table' => 'views',
-    'field' => 'counter',
-    'relationship' => 'none',
-	),
-  'feature_id' => array(
-    'label' => 'feature ID',
-    'alter' => array(
-      'alter_text' => 0,
-      'text' => '',
-      'make_link' => 0,
-      'path' => '',
-      'link_class' => '',
-      'alt' => '',
-      'prefix' => '',
-      'suffix' => '',
-      'target' => '',
-      'help' => '',
-      'trim' => 0,
-      'max_length' => '',
-      'word_boundary' => 1,
-      'ellipsis' => 1,
-      'html' => 0,
-      'strip_tags' => 0,
-	),
-    'empty' => '',
-    'hide_empty' => 0,
-    'empty_zero' => 0,
-    'set_precision' => FALSE,
-    'precision' => 0,
-    'decimal' => '.',
-    'separator' => '',
-    'prefix' => '',
-    'suffix' => '',
-    'exclude' => 1,
-    'id' => 'feature_id',
-    'table' => 'unigene_for_search',
-    'field' => 'feature_id',
-    'relationship' => 'none',
-	),
-  'feature_name' => array(
-    'label' => 'Sequence',
-    'alter' => array(
-      'alter_text' => 0,
-      'text' => '',
-      'make_link' => 1,
-      'path' => 'ID[feature_id]',
-      'link_class' => '',
-      'alt' => '',
-      'prefix' => '',
-      'suffix' => '',
-      'target' => '',
-      'help' => '',
-      'trim' => 0,
-      'max_length' => '',
-      'word_boundary' => 1,
-      'ellipsis' => 1,
-      'html' => 0,
-      'strip_tags' => 0,
-	),
-    'empty' => '',
-    'hide_empty' => 0,
-    'empty_zero' => 0,
-    'exclude' => 0,
-    'id' => 'feature_name',
-    'table' => 'unigene_for_search',
-    'field' => 'feature_name',
-    'relationship' => 'none',
-	),
-  'organism_common_name' => array(
-    'label' => 'Organism',
-    'alter' => array(
-      'alter_text' => 0,
-      'text' => '',
-      'make_link' => 0,
-      'path' => '',
-      'link_class' => '',
-      'alt' => '',
-      'prefix' => '',
-      'suffix' => '',
-      'target' => '',
-      'help' => '',
-      'trim' => 0,
-      'max_length' => '',
-      'word_boundary' => 1,
-      'ellipsis' => 1,
-      'html' => 0,
-      'strip_tags' => 0,
-	),
-    'empty' => '',
-    'hide_empty' => 0,
-    'empty_zero' => 0,
-    'exclude' => 0,
-    'id' => 'organism_common_name',
-    'table' => 'unigene_for_search',
-    'field' => 'organism_common_name',
-    'relationship' => 'none',
-	),
-  'feature_seqlen' => array(
-    'label' => 'Length',
-    'alter' => array(
-      'alter_text' => 1,
-      'text' => '[feature_seqlen] bp',
-      'make_link' => 0,
-      'path' => '',
-      'link_class' => '',
-      'alt' => '',
-      'prefix' => '',
-      'suffix' => '',
-      'target' => '',
-      'help' => '',
-      'trim' => 0,
-      'max_length' => '',
-      'word_boundary' => 1,
-      'ellipsis' => 1,
-      'html' => 0,
-      'strip_tags' => 0,
-	),
-    'empty' => '',
-    'hide_empty' => 0,
-    'empty_zero' => 0,
-    'set_precision' => FALSE,
-    'precision' => 0,
-    'decimal' => '.',
-    'separator' => ',',
-    'prefix' => '',
-    'suffix' => '',
-    'exclude' => 0,
-    'id' => 'feature_seqlen',
-    'table' => 'unigene_for_search',
-    'field' => 'feature_seqlen',
-    'relationship' => 'none',
-	),
-  'feature_type' => array(
-    'label' => 'Type',
-    'alter' => array(
-      'alter_text' => 0,
-      'text' => '',
-      'make_link' => 0,
-      'path' => '',
-      'link_class' => '',
-      'alt' => '',
-      'prefix' => '',
-      'suffix' => '',
-      'target' => '',
-      'help' => '',
-      'trim' => 0,
-      'max_length' => '',
-      'word_boundary' => 1,
-      'ellipsis' => 1,
-      'html' => 0,
-      'strip_tags' => 0,
-	),
-    'empty' => '',
-    'hide_empty' => 0,
-    'empty_zero' => 0,
-    'exclude' => 0,
-    'id' => 'feature_type',
-    'table' => 'unigene_for_search',
-    'field' => 'feature_type',
-    'relationship' => 'none',
-	),
-  'go_term' => array(
-    'label' => 'GO Term',
-    'alter' => array(
-      'alter_text' => 0,
-      'text' => '',
-      'make_link' => 0,
-      'path' => '',
-      'link_class' => '',
-      'alt' => '',
-      'prefix' => '',
-      'suffix' => '',
-      'target' => '',
-      'help' => '',
-      'trim' => 0,
-      'max_length' => '',
-      'word_boundary' => 1,
-      'ellipsis' => 1,
-      'html' => 0,
-      'strip_tags' => 0,
-	),
-    'empty' => '',
-    'hide_empty' => 0,
-    'empty_zero' => 0,
-    'exclude' => 0,
-    'id' => 'go_term',
-    'table' => 'unigene_for_search',
-    'field' => 'go_term',
-    'relationship' => 'none',
-	),
-  'blast_value' => array(
-    'label' => 'Blast',
-    'alter' => array(
-      'alter_text' => 0,
-      'text' => '',
-      'make_link' => 0,
-      'path' => '',
-      'link_class' => '',
-      'alt' => '',
-      'prefix' => '',
-      'suffix' => '',
-      'target' => '',
-      'help' => '',
-      'trim' => 1,
-      'max_length' => '200',
-      'word_boundary' => 0,
-      'ellipsis' => 1,
-      'html' => 0,
-      'strip_tags' => 0,
-	),
-    'empty' => '',
-    'hide_empty' => 0,
-    'empty_zero' => 0,
-    'exclude' => 0,
-    'id' => 'blast_value',
-    'table' => 'unigene_for_search',
-    'field' => 'blast_value',
-    'relationship' => 'none',
-	),
-  'kegg_value' => array(
-    'label' => 'KEGG',
-    'alter' => array(
-      'alter_text' => 0,
-      'text' => '',
-      'make_link' => 0,
-      'path' => '',
-      'link_class' => '',
-      'alt' => '',
-      'prefix' => '',
-      'suffix' => '',
-      'target' => '',
-      'help' => '',
-      'trim' => 1,
-      'max_length' => '200',
-      'word_boundary' => 0,
-      'ellipsis' => 1,
-      'html' => 0,
-      'strip_tags' => 0,
-	),
-    'empty' => '',
-    'hide_empty' => 0,
-    'empty_zero' => 0,
-    'exclude' => 0,
-    'id' => 'kegg_value',
-    'table' => 'unigene_for_search',
-    'field' => 'kegg_value',
-    'relationship' => 'none',
-	),
-  'interpro_value' => array(
-    'label' => 'Interpro',
-    'alter' => array(
-      'alter_text' => 0,
-      'text' => '',
-      'make_link' => 0,
-      'path' => '',
-      'link_class' => '',
-      'alt' => '',
-      'prefix' => '',
-      'suffix' => '',
-      'target' => '',
-      'help' => '',
-      'trim' => 1,
-      'max_length' => '200',
-      'word_boundary' => 0,
-      'ellipsis' => 1,
-      'html' => 0,
-      'strip_tags' => 0,
-	),
-    'empty' => '',
-    'hide_empty' => 0,
-    'empty_zero' => 0,
-    'exclude' => 0,
-    'id' => 'interpro_value',
-    'table' => 'unigene_for_search',
-    'field' => 'interpro_value',
-    'relationship' => 'none',
-	),
-	));
-	$handler->override_option('arguments', array(
-  'null' => array(
-    'default_action' => 'default',
-    'style_plugin' => 'default_summary',
-    'style_options' => array(),
-    'wildcard' => 'all',
-    'wildcard_substitution' => 'All',
-    'title' => '',
-    'breadcrumb' => '',
-    'default_argument_type' => 'fixed',
-    'default_argument' => '',
-    'validate_type' => 'php',
-    'validate_fail' => 'empty',
-    'must_not_be' => 0,
-    'id' => 'null',
-    'table' => 'views',
-    'field' => 'null',
-    'validate_user_argument_type' => 'uid',
-    'validate_user_roles' => array(
-      '2' => 0,
-      '3' => 0,
-      '5' => 0,
-      '4' => 0,
-	),
-    'relationship' => 'none',
-    'default_options_div_prefix' => '',
-    'default_argument_fixed' => '',
-    'default_argument_user' => 0,
-    'default_argument_php' => '',
-    'validate_argument_node_type' => array(
-      'iframe' => 0,
-      'news' => 0,
-      'chado_analysis' => 0,
-      'chado_analysis_blast' => 0,
-      'chado_analysis_interpro' => 0,
-      'chado_analysis_kegg' => 0,
-      'chado_analysis_unigene' => 0,
-      'chado_feature' => 0,
-      'chado_library' => 0,
-      'chado_organism' => 0,
-      'calendar_event' => 0,
-      'page' => 0,
-      'story' => 0,
-	),
-    'validate_argument_node_access' => 0,
-    'validate_argument_nid_type' => 'nid',
-    'validate_argument_vocabulary' => array(
-      '17' => 0,
-      '13' => 0,
-      '14' => 0,
-      '15' => 0,
-      '16' => 0,
-      '9' => 0,
-      '10' => 0,
-      '11' => 0,
-      '12' => 0,
-      '5' => 0,
-      '6' => 0,
-      '7' => 0,
-      '8' => 0,
-	),
-    'validate_argument_type' => 'tid',
-    'validate_argument_transform' => 0,
-    'validate_user_restrict_roles' => 0,
-    'validate_argument_php' => 'if (count($view->exposed_input)) {
-return TRUE;
-}',
-	),
-	));
-	$handler->override_option('filters', array(
-  'feature_name' => array(
-    'operator' => 'contains',
-    'value' => '',
-    'group' => '0',
-    'exposed' => TRUE,
-    'expose' => array(
-      'use_operator' => 1,
-      'operator' => 'feature_name_op',
-      'identifier' => 'feature_name',
-      'label' => 'sequence name',
-      'optional' => 1,
-      'remember' => 0,
-	),
-    'case' => 0,
-    'id' => 'feature_name',
-    'table' => 'unigene_for_search',
-    'field' => 'feature_name',
-    'relationship' => 'none',
-	),
-  'feature_seqlen' => array(
-    'operator' => '>=',
-    'value' => array(
-      'value' => '',
-      'min' => '',
-      'max' => '',
-	),
-    'group' => '0',
-    'exposed' => TRUE,
-    'expose' => array(
-      'use_operator' => 1,
-      'operator' => 'feature_seqlen_op',
-      'identifier' => 'feature_seqlen',
-      'label' => 'sequence length (bp)',
-      'optional' => 1,
-      'remember' => 0,
-	),
-    'id' => 'feature_seqlen',
-    'table' => 'unigene_for_search',
-    'field' => 'feature_seqlen',
-    'relationship' => 'none',
-	),
-  'feature_type' => array(
-    'operator' => '=',
-    'value' => '260',
-    'group' => '0',
-    'exposed' => TRUE,
-    'expose' => array(
-      'use_operator' => 0,
-      'operator' => 'feature_type_op',
-      'identifier' => 'feature_type',
-      'label' => 'type of sequence',
-      'optional' => 1,
-      'remember' => 0,
-	),
-    'case' => 0,
-    'id' => 'feature_type',
-    'table' => 'unigene_for_search',
-    'field' => 'feature_type',
-    'relationship' => 'none',
-	),
-  'go_term' => array(
-    'operator' => 'contains',
-    'value' => '',
-    'group' => '0',
-    'exposed' => TRUE,
-    'expose' => array(
-      'use_operator' => 1,
-      'operator' => 'go_term_op',
-      'identifier' => 'go_term',
-      'label' => 'GO term',
-      'optional' => 1,
-      'remember' => 0,
-	),
-    'case' => 0,
-    'id' => 'go_term',
-    'table' => 'unigene_for_search',
-    'field' => 'go_term',
-    'relationship' => 'none',
-	),
-  'organism_common_name' => array(
-    'operator' => '=',
-    'value' => 'chickpea',
-    'group' => '0',
-    'exposed' => TRUE,
-    'expose' => array(
-      'use_operator' => 0,
-      'operator' => 'organism_common_name_op',
-      'identifier' => 'organism_common_name',
-      'label' => 'organism',
-      'optional' => 1,
-      'remember' => 0,
-	),
-    'case' => 0,
-    'id' => 'organism_common_name',
-    'table' => 'unigene_for_search',
-    'field' => 'organism_common_name',
-    'relationship' => 'none',
-	),
-  'unigene' => array(
-    'operator' => '=',
-    'value' => 'Cicer arietinum unigene v1',
-    'group' => '0',
-    'exposed' => TRUE,
-    'expose' => array(
-      'use_operator' => 0,
-      'operator' => 'unigene_op',
-      'identifier' => 'unigene',
-      'label' => 'belongs to unigene',
-      'optional' => 1,
-      'remember' => 0,
-	),
-    'case' => 0,
-    'id' => 'unigene',
-    'table' => 'unigene_for_search',
-    'field' => 'unigene',
-    'relationship' => 'none',
-	),
-  'interpro_value' => array(
-    'operator' => 'contains',
-    'value' => '',
-    'group' => '0',
-    'exposed' => TRUE,
-    'expose' => array(
-      'use_operator' => 1,
-      'operator' => 'interpro_value_op',
-      'identifier' => 'interpro_value',
-      'label' => 'interpro description',
-      'optional' => 1,
-      'remember' => 0,
-	),
-    'case' => 0,
-    'id' => 'interpro_value',
-    'table' => 'unigene_for_search',
-    'field' => 'interpro_value',
-    'relationship' => 'none',
-	),
-  'blast_value' => array(
-    'operator' => 'contains',
-    'value' => '',
-    'group' => '0',
-    'exposed' => TRUE,
-    'expose' => array(
-      'use_operator' => 1,
-      'operator' => 'blast_value_op',
-      'identifier' => 'blast_value',
-      'label' => 'blast description',
-      'optional' => 1,
-      'remember' => 0,
-	),
-    'case' => 0,
-    'id' => 'blast_value',
-    'table' => 'unigene_for_search',
-    'field' => 'blast_value',
-    'relationship' => 'none',
-	),
-  'kegg_value' => array(
-    'operator' => 'contains',
-    'value' => '',
-    'group' => '0',
-    'exposed' => TRUE,
-    'expose' => array(
-      'use_operator' => 1,
-      'operator' => 'kegg_value_op',
-      'identifier' => 'kegg_value',
-      'label' => 'kegg description',
-      'optional' => 1,
-      'remember' => 0,
-	),
-    'case' => 0,
-    'id' => 'kegg_value',
-    'table' => 'unigene_for_search',
-    'field' => 'kegg_value',
-    'relationship' => 'none',
-	),
-	));
-	$handler->override_option('access', array(
-  'type' => 'none',
-	));
-	$handler->override_option('cache', array(
-  'type' => 'none',
-	));
-	$handler->override_option('title', 'Unigene Search');
-	$handler->override_option('css_class', 'tripal-search-feature');
-	$handler->override_option('empty', '<?php
-$view = views_get_current_view();
-  if (count($view->exposed_input)) {
-    drupal_set_message("Your search returns no results. Please adjust your search criteria and try again.");
-} 
-?>');
-	$handler->override_option('empty_format', '3');
-	$handler->override_option('use_pager', '1');
-	$handler->override_option('style_plugin', 'table');
-	$handler->override_option('style_options', array(
-  'grouping' => '',
-  'override' => 1,
-  'sticky' => 0,
-  'order' => 'asc',
-  'columns' => array(
-    'feature_id' => 'feature_id',
-    'feature_name' => 'feature_name',
-    'feature_seqlen' => 'feature_seqlen',
-    'feature_type' => 'feature_type',
-    'go_term' => 'go_term',
-    'organism_common_name' => 'organism_common_name',
-    'unigene' => 'unigene',
-    'blast_value' => 'blast_value',
-    'kegg_value' => 'kegg_value',
-    'interpro_value' => 'interpro_value',
-	),
-  'info' => array(
-    'feature_id' => array(
-      'sortable' => 1,
-      'separator' => '',
-	),
-    'feature_name' => array(
-      'sortable' => 1,
-      'separator' => '',
-	),
-    'feature_seqlen' => array(
-      'sortable' => 1,
-      'separator' => '',
-	),
-    'feature_type' => array(
-      'sortable' => 1,
-      'separator' => '',
-	),
-    'go_term' => array(
-      'sortable' => 1,
-      'separator' => '',
-	),
-    'organism_common_name' => array(
-      'sortable' => 1,
-      'separator' => '',
-	),
-    'unigene' => array(
-      'sortable' => 1,
-      'separator' => '',
-	),
-    'blast_value' => array(
-      'sortable' => 1,
-      'separator' => '',
-	),
-    'kegg_value' => array(
-      'sortable' => 1,
-      'separator' => '',
-	),
-    'interpro_value' => array(
-      'sortable' => 1,
-      'separator' => '',
-	),
-	),
-  'default' => '-1',
-	));
-	$handler = $view->new_display('page', 'Page', 'page_1');
-	$handler->override_option('path', 'unigene_search');
-	$handler->override_option('menu', array(
-  'type' => 'normal',
-  'title' => 'Unigene Search',
-  'description' => 'Advanced Search for unigenes',
-  'weight' => '0',
-  'name' => 'primary-links',
-	));
-	$handler->override_option('tab_options', array(
-  'type' => 'none',
-  'title' => '',
-  'description' => '',
-  'weight' => 0,
-  'name' => 'navigation',
-	));
-  $views[$view->name] = $view;
-  
-  return $views;
-}

+ 0 - 53
extensions/tripal_search_unigene/views_handler_filter_analysis_name.inc

@@ -1,53 +0,0 @@
-<?php
-class views_handler_filter_analysis_name extends views_handler_filter_string {
-	function value_form(&$form, &$form_state) {
-		$type_id = tripal_cv_get_cvterm_by_name("analysis_type");
-		$sql = "SELECT name, A.analysis_id 
-		        FROM {analysis} A 
-		           INNER JOIN {analysisprop} AP ON A.analysis_id = AP.analysis_id 
-		        WHERE type_id = %d AND value = 'tripal_analysis_unigene'";
-
-		$results = chado_query($sql,$typ_id->cvterm_id);
-		$analyses = array();
-		$block_ana = array();
-		$counter = 0;
-		while ($ana = db_fetch_object($results)) {
-			// check if the organisms is synced
-			if (db_result(db_query("SELECT * FROM {chado_analysis} WHERE analysis_id = $ana->analysis_id"))) {
-				// check user's permission
-				if (tripal_analysis_check_permission($ana->analysis_id)) {
-					$analyses[$ana->name] = t($ana->name);
-				} else {
-					$block_ana[$counter] = t($ana->name);
-					$counter ++;
-				}
-			}
-		}
-		
-		if ($block_ana) {
-			$where = "";
-			for ($i = 0; $i < count($block_ana); $i ++) {
-					$where .= "unigene_for_search.unigene <> '$block_ana[$i]'";
-					if ($i != count($block_ana) - 1) {
-						$where .= " AND ";
-					}
-			}
-			$this->query->add_where($this->options['group'], $where);
-		}
-		
-		$form['value'] = array(
-		'#type' => 'select',
-		'#title' => t('Analysis'),
-		'#options' => $analyses,
-		'#default_value' => 0,
-		);
-
-		return $form;
-	}
-
-	function operator_options () {
-		return array(
-			'=' => t('Is equal to')
-		);
-	}
-}

+ 0 - 26
extensions/tripal_search_unigene/views_handler_filter_feature_type_id.inc

@@ -1,26 +0,0 @@
-<?php
-class views_handler_filter_feature_type_id extends views_handler_filter_string {
-
-	function value_form(&$form, &$form_state) {
-
-		$sql = "SELECT distinct feature_type FROM {unigene_for_search}";
-		$results = chado_query($sql);
-		$options = array ();
-		while($type = db_fetch_object($results)) {
-			$options[$type->feature_type] = $type->feature_type;
-		}
-
-		$form['value'] = array(
-		'#type' => 'select',
-		'#title' => t('Type of sequence'),
-		'#options' => $options,
-		);
-		return $form;
-	}
-
-	function operator_options () {
-		return array(
-			'=' => t('Is equal to')
-		);
-	}
-}

+ 0 - 30
extensions/tripal_search_unigene/views_handler_filter_organism_common_name.inc

@@ -1,30 +0,0 @@
-<?php
-class views_handler_filter_organism_common_name extends views_handler_filter_string {
-
-	function value_form(&$form, &$form_state) {
-		$sql = "SELECT distinct common_name, organism_id FROM {organism}";
-		$results = chado_query($sql);
-		$organisms = array();
-		
-		while ($org = db_fetch_object($results)) {
-			// check if the organisms is synced
-			if (db_result(db_query("SELECT * FROM {chado_organism} WHERE organism_id = $org->organism_id"))) {
-				$organisms[$org->common_name] = t($org->common_name);
-			}
-		}
-		$form['value'] = array(
-		'#type' => 'select',
-		'#title' => t('Organism'),
-		'#options' => $organisms,
-		'#default_value' => 0,
-		);
- 
-	return $form;
-	}
-	
-	function operator_options () {
-		return array(
-			'=' => t('Is equal to')
-		);
-	}
-}