\n" ); } if( $Linux ) { #........sasha add to database......... //require("/www/db/connect.php"); $GenebeeTaskID=14; $SenderMail=$email; $emailaddress; //insert_message_to_db($GenebeeTaskID, $SenderMail); #............................... } // Basic/advanced ? //if( isset( $WIDTH ) ) { if( isset( $adv_opt ) ) { $Advanced = TRUE; //echo "Advanced mode
\n"; } else { $Advanced = FALSE; //echo "Basic mode
\n"; // Defaults for Basic $WIDTH = 640; $HEIGHT = 480; $MMFACTOR = 8; } ?> Genebee ClustalW 1.83
Processing your request...
\n"; # -------------------------------------------------------- # Check for correctness of parameters if (!$seq) # check for sequence presence { echo "\n
Please remember to enter or paste your sequences !
"; echo ""; exit(); } if (strcmp($tree_type, "none") && (!strcmp($output_format, "PHYLIP"))) { echo "\n
Error: You cannot build tree with PHYLIP alignment
"; echo ""; exit(); } # -------------------------------------------------------- # Write sequence to file if( $Linux ) { $prefix = tempnam("/tmp", "cl"); # unique filename prefix #$prefix = tempnam("bbb", "aaa"); } $fp = fopen($prefix, "w"); if (!$fp) { echo "\n
Cannot create temporary file for sequence
"; echo ""; exit(); } if (!fputs($fp, $seq)) { echo "\n
Cannot write to temporary file
"; fclose($fp); #system("rm $prefix*"); echo ""; exit(); } fclose($fp); # -------------------------------------------------------- # Create parameters string $param = "-outfile=$prefix.al"; if (!strcmp($alignment, "Slow")) { $param = $param." -align"; } else { $param = $param." -quicktree"; } if (strcmp($output_format, "CLUSTAL")) $param = $param." -output=$output_format"; $param = $param." -outorder=$output_order"; if( $Advanced ) { //---------------------------------- Adv if (!strcmp($alignment, "Fast")) { $param = $param." -ktuple=$ktuple -window=$win_len -topdiags=$topdiag"; $param = $param." -pairgap=$pairgap -score=$score"; } if (!strcmp($alignment, "Slow")) { $param = $param." -pwmatrix=$slow_pwmatrix -pwdnamatrix=$slow_dnamatrix"; $param = $param." -pwgapopen=$slow_gapopen -pwgapext=$slow_gapext"; } if (strcmp($seqtype, "Auto")) $param = $param." -type=$seqtype"; $param = $param." -matrix=$multi_pwmatrix -dnamatrix=$multi_dnamatrix"; $param = $param." -gapopen=$multi_gapopen -gapext=$multi_gapext"; if ($adv_opt) $param = $param." $adv_opt"; // *** expert options } # -------------------------------------------------------- # If phylogenetic tree requested. switch ($tree_type) { //case nj: $tree_ext = ".nj"; break; //case phylip: $tree_ext = ".ph"; break; //case dist: $tree_ext = ".dst"; break; case "nj": $tree_ext = ".nj"; break; case "phylip": $tree_ext = ".ph"; break; case "dist": $tree_ext = ".dst"; break; } $tparam0 = "$prefix.al -tree -outputtree"; if( $Advanced ) { //---------------------------------- Adv if (strcmp($tree_type, "none")) { //$tparam = "$prefix.al -tree -outputtree=$tree_type"; $tparam = "$tparam0=$tree_type"; if (!strcmp($kimura, "On")) $tparam = $tparam." -kimura"; if (!strcmp($ignore_gaps, "On")) $tparam = $tparam." -tossgaps"; } } else { //---------------------------------- Basic //if (strcmp($tree_type, "none")) $tparam = "$prefix.al -tree -outputtree=$tree_type"; if (strcmp($tree_type, "none")) $tparam = "$tparam0=$tree_type"; } # -------------------------------------------------------- # Check for type of results: email or visual if ($email) { $pstr = "\n"; if ($title) $pstr = $pstr." $title \n\n"; if( $Advanced ) { //---------------------------------- Adv $pstr = $pstr."\nGeneral options \n"; $pstr = $pstr." Alignment: $alignment \n"; $pstr = $pstr." Show dendrogram: $dendrogram \n"; $pstr = $pstr." Output format: $output_format \n"; $pstr = $pstr." Output order: $output_order \n"; if (!strcmp($alignment, "Fast")) { $pstr = $pstr."\nFast Pairwise alignment options \n"; $pstr = $pstr." KTuple (word size): $ktuple \n"; $pstr = $pstr." Window length: $win_len \n"; $pstr = $pstr." TOPDIAG: $topdiag \n"; $pstr = $pstr." PAIRGAP: $pairgap \n"; $pstr = $pstr." Score type: $score \n"; } if (!strcmp($alignment, "Slow")) { $pstr = $pstr."\nSlow Pairwise alignment options \n"; $pstr = $pstr." Protein weight matrix: $slow_pwmatrix \n"; $pstr = $pstr." DNA weight matrix: $slow_dnamatrix \n"; $pstr = $pstr." Gap open: $slow_gapopen \n"; $pstr = $pstr." Gap extension: $slow_gapext \n"; } $pstr = $pstr."\nMultiple alignment options \n"; $pstr = $pstr." Type: $seqtype \n"; $pstr = $pstr." Protein weight matrix: $multi_pwmatrix \n"; $pstr = $pstr." DNA weight matrix: $multi_dnamatrix \n"; $pstr = $pstr." Gap open: $multi_gapopen \n"; $pstr = $pstr." Gap extension: $multi_gapext \n"; $pstr = $pstr."\nPhylogenetic tree options \n"; $pstr = $pstr." Tree type: $tree_type \n"; if (strcmp($tree_type, "none")) { $pstr = $pstr." Kimura's correction $kimura \n"; $pstr = $pstr." Ignore gaps: $ignore_gaps \n"; } if ($adv_opt) $pstr = $pstr."\nOther advanced parameters: $adv_opt \n"; $fp = fopen("$prefix.param", "w"); if (!$fp) { echo "\n
Cannot create temporary file for parameters
"; echo ""; exit(); } if (!fputs($fp, $pstr)) { echo "\n
Cannot write to temporary parameters file
"; fclose($fp); system("rm $prefix*"); echo ""; exit(); } fclose($fp); if (!strcmp($dendrogram, "On")) $dendr = "YES"; system("chmod 777 $prefix*"); system("./adv_run $email $prefix \"$param\" \"$tparam\" $dendr &"); } else { //---------------------------------- Basic $pstr = $pstr."Alignment: $alignment \n"; $pstr = $pstr."Tree type: $tree_type \n"; $pstr = $pstr."Output format: $output_format \n"; $pstr = $pstr."Output order: $output_order \n\n"; $fp = fopen("$prefix.param", "w"); if (!$fp) { echo "\n
Cannot create temporary file for parameters
"; echo ""; exit(); } if (!fputs($fp, $pstr)) { echo "\n
Cannot write to temporary parameters file
"; fclose($fp); system("rm $prefix*"); echo ""; exit(); } fclose($fp); system("chmod 777 $prefix*"); system("./basic_run $email $prefix \"$param\" \"$tparam\" &"); } echo "\nResults have been sent to $email"; echo "\n"; exit(); } // ---------------------------------------- end of email $param = "./clustalw $prefix $param 2>&1 >/dev/null"; if( $Linux ) { echo "
"; system($param); echo "
"; } # -------------------------------------------------------- # Check for presence of output files if (!file_exists("$prefix.al") ) { echo "\n

You should enter two or more\n sequences in supported formats"; system("rm $prefix*"); echo ""; exit(); } # -------------------------------------------------------- # If phylogenetic tree requested. //if ($tparam) if( isset($tparam) && $tparam ) { $tparam = "./clustalw $tparam 2>&1 >/dev/null"; if( $Linux ) { echo "

";   system($tparam); echo "
"; } if (!file_exists($prefix.$tree_ext) ) { echo ""; system("rm $prefix*"); exit(); } } #-------------------------------------------------------------- # THE SHOW RESULTS PART OF SCRIPT #-------------------------------------------------------------- echo "

"; function show_fast_params() { global $ktuple, $win_len, $topdiag, $pairgap,$score; echo "\n \n \n \n \n \n \n
Fast alignment
K-Tuple $ktuple
Window-length $win_len
TOPDIAG $topdiag
PAIRGAP $pairgap
Score type $score
\n"; } function show_slow_params() { global $slow_pwmatrix, $slow_dnamatrix, $slow_gapopen, $slow_gapext; echo "\n \n \n \n \n \n
Slow alignment
Protein weight matrix $slow_pwmatrix
DNA weight matrix $slow_dnamatrix
Gap open $slow_gapopen
Gap extension $slow_gapext
\n"; } # Here we print out results if( $Advanced ) { //---------------------------------- Adv echo "

Advanced Genebee ClustalW 1.83 Results

"; if ($title) echo "$title"; echo "

\n
The alignment parameters
\n"; echo ""; if(!strcmp($alignment,"Slow")) show_slow_params(); else show_fast_params(); echo "\n"; if (strcmp($tree_type, "none")) echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Multiple alignment
Type $seqtype
Protein weight matrix $multi_pwmatrix
DNA weight matrix $multi_dnamatrix
Gap open $multi_gapopen
Gap extension $multi_gapext
\n \n \n \n
Phylogenetic tree
Kimura's corrections $kimura
Ignore gaps $ignore_gaps
"; if ($adv_opt) echo "

Other advanced parameters:   $adv_opt

\n"; if (!strcmp($dendrogram, "On")) { echo "


The dendrogram
\n
";
        $fp = fopen("$prefix.dnd", "r");
        fpassthru($fp);
        echo "
\n"; } } else { //---------------------------------- Basic echo "
Basic Genebee ClustalW 1.83 Results

"; if ($title) echo "$title"; echo "

\n"; } echo "
The aligned sequence in "; echo "$output_format format ("; echo "$output_order order )
\n
";
   readfile("$prefix.al");
   //$fp = fopen("$prefix.al", "r");
   //fpassthru($fp);
   echo "
\n"; if (strcmp($tree_type, "none")) { echo "
The phylogenetic tree in $tree_type format
\n
";
       readfile($prefix.$tree_ext);
       //$fp = fopen($prefix.$tree_ext, "r");
       //fpassthru($fp);
       echo "
\n"; } //if( $Linux ) { // *** See at bottom // system("rm $prefix*"); //} # # Images # /** function f_treeImages( $prefix, $Windows ) { // ----------------------- if( $Windows ) $IMAGE_PREF = "clu1"; else $IMAGE_PREF = tempnam( "../../trash/", "clustal" ); } **/ # ----------------------------------------------------------- //if (strcmp($tree_type, "none") ) { // if( isset( $PICTURE ) && strcmp($PICTURE, "NONE") ) { if( isset( $PICTURE[0] ) && strcmp($PICTURE[0], "NONE") ) { echo "
Graphical Phylogenetic Tree

"; include "clusima.h"; //f_treeImages( $prefix, $Windows ); } //} if( $Linux ) { system("rm $prefix*"); } if( isset( $PICTURE[0] ) && strcmp($PICTURE[0], "NONE") ) { echo "

"; ?>
Redesigned by Valeri Kazatchenko. Last updated: May 25, 2001.
Comments and bug-reports send to Vladimir Nikolaev
Created: .
\n
\n"; echo "Created: ".Date("D M j Y", time())."
\n"; } ?>