This is a test version of Biostars. For the public version, visit https://www.biostars.org.
The Gene Database Web Results Are Not The Same As With Esearch

Hello! I am new in bioinformatics. I am trying to do some querys with ncbi eutils to databases like pubmed, gene, etc. My problem is that, when i do a simple search ( like "polymerase") in gene or protein (and perhaps in other, i have not tried), i get some results, and when I make a request with esearch the results are differents. But the results counts is the same in both, so i think the problem is the order of the results.

i have been reading esearch query parameters and and i have not seen anything about the order. Is this normal? How can i do to get the same results as on the web?

This my request code:

function esearch_query($db, $term) { 
    $context = stream_context_create(array(
      'http'=>array(
        'user_agent' => 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11'
       )
    ));

    $xml = file_get_contents('http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=' . $db . '&term=' . $term . '&usehistory=y', FALSE, $context);

    $xml_file = simplexml_load_string($xml);
    $search_results['count'] = $xml_file->Count;
    $search_results['querykey'] = $xml_file->QueryKey;
    $search_results['webenv'] = $xml_file->WebEnv; 
    foreach ( $xml_file->IdList->Id as $items ) {
        $search_results['ids'][] = $items;
    }
    return $search_results;
}

Thanks everybody! I hope someone can help me!

ncbi eutils gene

0 answers

No answers yet.

Log in to answer this question.