Read Proteomes

PHOTO EMBED

Thu Feb 18 2021 16:14:04 GMT+0000 (UTC)

Saved by @nhatphan108

    /*
    $allProteomes = explode(PHP_EOL, file_get_contents("http://www.uniprot.org/proteomes/"
     . "?query="
     . "&fil=" . urlencode("reference:yes")
     . "&columns="."id,name"
     . "&sort=score"
     . "&format=tab"));
    $parsed = $this->parseUniprotResponse($allProteomes);
    \Log::debug(count($allProteomes));

    Storage::disk('local')->put('uniprot_proteomes', serialize($parsed));*/
    \Log::debug("DONE");
      
    $retrieved = unserialize(Storage::disk('local')->get('uniprot_proteomes'));
    \Log::debug(count($retrieved));
    $filtered = array_filter($retrieved, function($each) use ($search_term) {
      if(strpos(strtolower($each['scientific_name']), strtolower($search_term))) {
        return true;
      }
    });
    \Log::debug($filtered);

    \Log::debug("Manual: ".count($filtered));
content_copyCOPY