Error: Received request was empty

") if (!isFasta($_REQUEST['fasta'])) { # Not fasta: take as list of ids # Parsing list $idList = explode("\n", $_REQUEST['fasta']); $fasta = ''; foreach ($idList as $id) { if (!$id) continue; # Clean id spaces and lines $id = preg_replace("/[ \r]/","",$id); # get Uniprot Fasta $thisFasta = file_get_contents("https://www.uniprot.org/uniprot/$id.fasta"); if (!isFasta($thisFasta)) { print "

Error: $id not found

"; } else { $fasta .= $thisFasta; } } } else { $fasta = $_REQUEST['fasta']; } $_SESSION['data'] = parse_Fasta($fasta); } ?>

Processed unique sequence(s)

Id Database SwissProt Id Header
"); } function parse_Fasta ($f) { $sqs = explode(">", $f); $data=Array(); foreach ($sqs as $s) { if ($s) { $lines = explode("\n",$s,2); list($db,$id,$info) = explode("|",$lines[0]); list ($swp,$info) = explode(" ",$info,2); $data[$id] = array('db'=> $db, 'id'=> $id, 'swpid' => $swp, 'info' => $info, 'sequence' => $lines[1]); } } return $data; } ?>