"); } function parse_Fasta ($f) { $sqs = explode(">", $f); $data = []; 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] = ['db'=> $db, 'id'=> $id, 'swpid' => $swp, 'info' => $info, 'sequence' => $lines[1]]; } } return $data; } #start Session to hold input data session_start(); # Check if input comes from an uploaded file if ($_FILES['uploadFile']['name']) { $_REQUEST['fasta'] = file_get_contents($_FILES['uploadFile']['tmp_name']); } if (!$_REQUEST['fasta']) { ?>
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 |
---|---|---|---|
=$p['id']?> | =$p['db']?> | =$p['swpid']?> | =$p['info']?> |