function downloadCegCustom($idArr) { header("Content-type: application/octet-stream;charset=gbk"); header("Content-Disposition: attachment; filename=ceg.xml"); $tmp = getCegDescCate($idArr); $br = "\n"; $t = "\t"; echo '<Ceg>' . $br; foreach ($tmp as $row) { echo '<Cluster>' . $br; echo $t . '<Access_num>' . $row['cluster'] . '</Access_num>' . $br; echo $t . '<Description>' . $row['description'] . '</Description>' . $br; echo $t . '<Category>' . cate2Name($row['category']) . '</Category>' . $br; echo '</Cluster>' . $br; } echo '</Ceg>'; }
/** * Get information of a minimal gene set by array of reference species ID. * @param type $idArr * @return array */ function getMgsInfo($idArr) { $result = array(); $tmp = getCegBaseByIdArr($idArr); foreach ($tmp as $row) { $cegInfo['access_num'] = $row['access_num']; $cegInfo['koid'] = $row['koid']; $cegInfo['cogid'] = $row['cogid']; $cegInfo['ec'] = $row['ec']; $cegInfo['description'] = $row['description']; $cegInfo['category'] = cate2Name(deterCegBaseCate($row)); array_push($result, $cegInfo); } return $result; }