<?php $page_dir = str_replace('\\', '/', dirname(__FILE__)) . '/'; $serv_dir = $page_dir . "../../service/"; require_once $serv_dir . 'cegRecordServ.php'; require_once $serv_dir . 'keggServ.php'; require_once $serv_dir . 'util.php'; $flag = 0; if (isset($_GET['access_num'])) { $flag = 1; $accessNum = trim($_GET['access_num']); $cegBase = getCegBaseByAccessNum($accessNum); $gidArr = getGidByAccessNum($accessNum); $itemArr = array(); foreach ($gidArr as $gid) { $annotation = getAnnotationByGid($gid); $item['gid'] = $gid; $item['gene_name'] = $annotation['Gene_Name']; $item['description'] = $annotation['fundescrp']; $item['sequence'] = getPlainNaSeq($gid); $item['rfc_arr'] = getCompatibleRFC($item['sequence']); $item['biobrick_arr'] = getBiobrickByGid($gid); array_push($itemArr, $item); } } if (!$flag) { die; } ?> <!DOCTYPE html>
/** * get biobricks belong to category of protein coding sequence in Registry of standard biological parts. * @param type $gid * @return array */ function getBiobrickByGid($gid) { $result = array(); $cdsArr = queryAllCdsBiobrick(); $annotation = getAnnotationByGid($gid); foreach ($cdsArr as $cds) { if (strtoupper($cds['protein']) == strtoupper($annotation['Gene_Name'])) { $match = array('gid' => $gid, 'biobrick_name' => $cds['name'], 'protein' => $cds['protein']); array_push($result, $match); } } return $result; }