/** * main service function. * @param type $idArr */ function execute($idArr) { $mgsInfo = getMgsInfo($idArr); $statics = getCogFuncStatics($mgsInfo); foreach ($statics as $row) { echo '"' . $row['function'] . ' (' . $row['alphabet'] . ')",'; } echo '<br>'; foreach ($statics as $row) { echo $row['count'] . ','; } }
/** * Download minimal gene set data with CSV format. * @param type $idArr */ function downloadMgsCSV($idArr) { header("Content-type: application/octet-stream;charset=gbk"); header("Content-Disposition: attachment; filename=ceg_filtered.csv"); $tmp = getMgsInfo($idArr); $br = "\r\n"; $t = "\t"; echo '"Access_num","koid","cogid","ec","Description","Category"' . $br; foreach ($tmp as $row) { echo '"' . $row['access_num'] . '","' . $row['koid'] . '","' . $row['cogid'] . '","' . $row['ec'] . '","' . $row['description'] . '","' . $row['category'] . '"' . $br; } }