chevalier 5 Jan 2009 20:49 Non evaluated contribution |
Ce message est destiné au MJ / Admin du site, Bonjour, je suis un informaticien intéressé par les outils bioinformatique, je suis entrain de développer une page équivalent à [url=http://itis.gbif.net/pls/itisca/taxaget?p_ifx=plglt&p_lang=fr/]SITI[/url] utilisant les informations de classification taxonomique depuis le site NBCI. J'ai remarqué sur la page d'édition des annonthons sur votre site, une partie qui affiche ses informations en entrant le code NBCI. j'aimerai savoir comment vous l'avez implémenter, c'est à dire récupérer le informations depuis NBCI et les afficher sur une page html. si cela ce fait par une requête ou une procédure du genre, j'aimerai savoir laquelle. j'apprécierais votre aide, Merci d'avance Cordialement.
|
Supervisor 6 Jan 2009 10:04 Game master |
The question is: software wise, how does the Annotathon deal with taxonomy information?
I have loaded the NCBI taxonomy [url=ftp://ftp.ncbi.nih.gov/pub/taxonomy/]dump files[/url] into local mySQL tables. I then use a few simple PHP functions (reproduced below) to manipulate the data through SQL: the three main functions are:
* taxid_from_taxname which returns a NCBI taxid for a text string, eg "[code]$taxid = taxid_from_taxname('proteobacteria');[/code]"
* tax_info which returns basic taxonomy info for a given taxid, eg "[code]echo tax_info($taxid);[/code]"
* tax_rank which returns specific rank names for a taxid, eg "[code]echo tax_rank('superkingdom',$taxid).'/'.tax_rank('phylum',$taxid).'/'.tax_rank('class',$taxid).'/'.tax_rank('order',$taxid);[/code]"
All the code is on https://launchpad.net/annotathon
[/code]
function taxid_from_taxname($name){
if ($name=='') {
return 'NULL';}
$result = dbQuery( "select * from tax_names where name='$name'");
$t = mysql_fetch_array($result);
if ($t[tax_id]>1) {
return $t[tax_id];}
$result = dbQuery( "select * from tax_names where name like '%$name%'");
$t = mysql_fetch_array($result);
if ($t[tax_id]>1) {
echo error(lang('taxdef')." '$name' ".lang('atncbi'),0);
return $t[tax_id];}
echo error(lang('taxdef')." '$name' ".lang('noncbi'));
return 'NULL';
}
function tax_info($id){
if (!$id>0) {return '';}
$result = dbQuery( "select * from tax_nodes join tax_genetic_codes using(gen_code) where tax_id=$id");
$t = mysql_fetch_array($result);
return lang('rank').": $t[rank] - ".lang('geneticcode').": $t[name] - ".lang('ncbiid').": $id ".
lang('kingdom').': '.tax_rank('superkingdom',$id)." - ".lang('phylum').": ".tax_rank('phylum',$id).
" - ".lang('class').": ".tax_rank('class',$id)." - ".lang('order').": ".tax_rank('order',$id)." ".
tax_lineage($id).'';
}
function taxname_from_taxid($id){
if (!$id>0) {return '';}
$result = dbQuery( "select * from tax_names where tax_id=$id and class='scientific name'");
$t = mysql_fetch_array($result);
return ($t[name]?$t[name]:lang('no_taxid'));
}
function tax_lineage($id){
if ($id <= 1) {return;}
$result = dbQuery( "select * from tax_nodes where tax_id=$id");
$t = mysql_fetch_array($result);
if ($id == $t[parent_id]) {return;}
$print = ($t[hidden]?'':taxname_from_taxid($id).'; ');
return tax_lineage($t[parent_id]).$print;
}
function tax_division($id){
if ($id <= 1) {return;}
$result = dbQuery( "select * from tax_nodes join tax_division using(div_id) where tax_id=$id");
$t = mysql_fetch_array($result);
if ($id == $t[parent_id]) {return;}
$print = ($t[inh_div_id]?'':$t[name]);
if ($print == '') {
return tax_division($t[parent_id]);}
else {
return $print;
}
}
function tax_rank($rank,$id){
if ($id <= 1) {return;}
$result = dbQuery( "select * from tax_nodes where tax_id=$id");
$t = mysql_fetch_array($result);
if ($id == $t[parent_id]) {return;}
$print = ($t[rank]==$rank?taxname_from_taxid($id):'');
if ($print == '') {
return tax_rank($rank,$t[parent_id]);}
else {
return $print;
}
}
[/code] |
chevalier 6 Jan 2009 13:23 Non evaluated contribution |
I've down some dump file before to save them in my database, but their contents is only ID's and other numeric values, it seems there is no taxonomy informations on theses files. but I'll look ones again. Thank you much. |