". $url . "

"; $cookie = tempnam ("/tmp", "CURLCOOKIE"); $ch = curl_init(); curl_setopt( $ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1" ); curl_setopt( $ch, CURLOPT_URL, $url ); curl_setopt( $ch, CURLOPT_COOKIEJAR, $cookie ); curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true ); curl_setopt( $ch, CURLOPT_ENCODING, "" ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); curl_setopt( $ch, CURLOPT_AUTOREFERER, true ); curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false ); # required for https urls curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, $timeout ); curl_setopt( $ch, CURLOPT_TIMEOUT, $timeout ); curl_setopt( $ch, CURLOPT_MAXREDIRS, 10 ); $content = curl_exec( $ch ); $response = curl_getinfo( $ch ); curl_close ( $ch ); return array($content, $response); } function AllPermutations($InArray, $InProcessedArray = array()) { $ReturnArray = array(); foreach($InArray as $Key=>$value) { $CopyArray = $InProcessedArray; $CopyArray[$Key] = $value; $TempArray = array_diff_key($InArray, $CopyArray); if (count($TempArray) == 0) { $ReturnArray[] = $CopyArray; } else { $ReturnArray = array_merge($ReturnArray, AllPermutations($TempArray, $CopyArray)); } } return $ReturnArray; } function permutations($arr,$n) { $res = array(); foreach ($arr as $w) { if ($n==1) $res[] = $w; else { $perms = permutations($arr,$n-1); foreach ($perms as $p) { $res[] = $w." ".$p; } } } return $res; } if($_REQUEST){ if($_REQUEST['dosearchonwords']){ $wordlist = json_decode($_REQUEST['wordlistJSON']); }else if($_REQUEST['action']== "step1"){ $wordcombolist = array(); $searchwords = $_REQUEST['wordMatches']; echo "You are searching for ". sizeof($searchwords) . " different words:"; foreach($searchwords as $value){ echo $value . "----"; } echo "
"; //print_r(AllPermutations($searchwords)); $finalcombolist = array(); for($i = 1; $i <= sizeof($searchwords); $i++){ $finalcombolist[] = permutations($searchwords, $i); } foreach($finalcombolist as $key=> $value){ //echo "Number of words: " . ($key + 1 ). "
"; foreach($value as $combokey => $combovalue){ //echo $combovalue . ", "; array_push($wordcombolist, $combovalue); } echo "
"; } ?>

Select which words you would like to search for:

$wordvalue){?> Y - N
Notice: Undefined variable: wordvalue in /home/duaxlab/summer17a.duaxlab.org/team01b/index.php on line 110

$yvalue){ array_push($yesFind, $allwordcombos[$yvalue]); } foreach($_REQUEST['no'] as $nkey => $nvalue){ array_push($noFind, $allwordcombos[$nvalue]); } echo "Getting UniProt data..."; $url = str_replace( "&", "&", urldecode(trim("http://www.uniprot.org/uniprot/?query=" . $_REQUEST['proteinToSearch'].'&sort=score&offset=0&limit=250&format=rss')) ); $url = preg_replace("/\s+/", "%20", $url); echo "Accessing ". $url . "

"; $cookie = tempnam ("/tmp", "CURLCOOKIE"); $ch = curl_init(); curl_setopt( $ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1" ); curl_setopt( $ch, CURLOPT_URL, $url ); curl_setopt( $ch, CURLOPT_COOKIEJAR, $cookie ); curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true ); curl_setopt( $ch, CURLOPT_ENCODING, "" ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); curl_setopt( $ch, CURLOPT_AUTOREFERER, true ); curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false ); # required for https urls curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, $timeout ); curl_setopt( $ch, CURLOPT_TIMEOUT, $timeout ); curl_setopt( $ch, CURLOPT_MAXREDIRS, 10 ); $content = curl_exec( $ch ); $response = curl_getinfo( $ch ); curl_close ( $ch ); $xmlresponse = simplexml_load_string($content); //var_dump($xmlresponse); $objects = new SimpleXMLElement($content); foreach($objects->channel->item as $listkey => $listitem){ var_dump($listitem); $findmatches = preg_split("/,/", $_REQUEST['matchingwords']); //echo "looking in wikipedia entries for any of the matches:" . var_dump($findmatches); echo "
".$listitem->link; $uniprotdata = getWebUrl($listitem->link); foreach($yesFind as $yeskey => $yeswordtofind){ echo "Looking for: " . preg_replace("/\s+/", " & ", $yeswordtofind) . "
"; } foreach($noFind as $nokey => $nowordtofind){ echo "Looking to see if not present : " . preg_replace("/\s+/", " & ",$nowordtofind) . "
"; } /* foreach($findmatches as $key => $match){ if(preg_match("/"."/", $match, $uniprotdata[1])){ echo $match . "..Found
"; }else{ echo $match . "..Not Found
"; } } */ //var_dump($uniprotdata); echo "
"; } exit(); } ?>
Protein Search:
Words to search: (add another search term)