"; $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 ); //var_dump($response); /*$xmlresponse = simplexml_load_string($content); //var_dump($xmlresponse); $objects = new SimpleXMLElement($content); foreach($objects->channel->item as $listkey => $listitem){ var_dump($listitem); echo "
"; } */ $fastaobj = $content; $fastapieces = preg_split("/>/", $fastaobj); //var_dump($fastapieces); //get rid of first part $lengthResults = array(); array_shift($fastapieces); foreach($fastapieces as $sequencekey => $sequenceobj){ var_dump($sequenceobj); $lines = preg_split("/\n/", $sequenceobj); var_dump($lines); $sequence = ""; for($i = 1; $i < sizeof($lines); $i++){ $sequence = $sequence . $lines[$i]; } echo "This should be the full sequence: " . $sequence . "

"; //count the length if($lengthResults[strlen($sequence)]){ $lengthResults[strlen($sequence)] = $lengthResults[strlen($sequence)] + 1; }else{ $lengthResults[strlen($sequence)] = 1; } } //var_dump($lengthResults); foreach($lengthResults as $key => $value){ echo "Length: " . $key . "-> " . $value . "
"; } exit(); } ?>
Job ID: