// annexe.h
// -------- Based on "simil.php3"
//
// Two modes: $Linux - basic
// $Windows - test on Win
//
// 25.05.2001 - progress bar
if( $Linux ) {
//++$indir = "/hdisk1/g_mail/-m_in/"; // ************* Linux indir
//++$indir = "/g_mail_in/-m_in/"; // ************* Linux indir
//++$outdir = "/g_mail_out/m_out/"; // ************* outdir ?
//++
//++$pid = getmypid(); // see at startr of annot.php
$sem_name = $indir.$pid.".lok"; // ************ Linux
$fp = fopen( $sem_name, "w" );
fclose( $fp );
}
# --------------------------------------------------------
# Creates input file
# --------------------------------------------------------
if( $Linux ) {
$inp_file = $indir.$pid; // ************* Linux
} else {
$inp_file = "annot.par";
}
$fp = fopen( $inp_file, "w" );
fputs( $fp, "From: " );
fputs( $fp, $EMAIL."\n" );
fputs( $fp, "\n[addrfrom]\n" );
fputs( $fp, "from: WWW to: GeneBee (MOSAIC)\n\n" );
//-fputs( $fp, "Screening by similarity\n" );
fputs( $fp, "Automated Annotation\n\n" );
fputs( $fp, "[sequence]\n" );
#-------------
$i = 0;
while( $SEQ[$i] == ' ' )
$i++;
$SEQ = substr( $SEQ, $i );
if( $SEQ[0] != '>' )
$SEQ = ">YourSeqName\n".$SEQ;
fputs( $fp, $SEQ );
$MOLTYPE = getMolType( $SEQ ); // ***
//if( $MATR == "" ) {
if( !isset( $MATR ) ) {
//if( $molType == 1 )
if( $MOLTYPE == 0 ) { // ***getMolType is changed to be like in C++
$MATR = "blosum62";
} else {
$MATR = "dnarna";
}
}
/*
fputs( $fp, "\n\n[matrix]\n" );
if( $Linux )
$fmat = fopen( "../data/".$MATR.".matrix", "r" ); // ************ Linux
else
$fmat = fopen( $MATR.".matrix", "r" );
while( $buf = fgets( $fmat, 128 ) ) {
fputs( $fp, $buf );
}
fclose( $fmat );
*/
fputs( $fp, "\n\n[banks]\n" );
fputs( $fp, "/mirrors/ftp.expasy.ch/sprottrem/sprot.dat" );
/**/
fputs( $fp, "\n\n[params]\n" );
fputs( $fp, "Length threshold!L $ML_THRESH\n" );
fputs( $fp, "Power threshold!P $MP_THRESH\n" );
fputs( $fp, "Subalign. power!F $AP_THRESH\n" );
fputs( $fp, "Min. homology ratio!H $MHP_THRESH\n" );
fputs( $fp, "Coincidence ratio!C $C_RATIO\n" );
fputs( $fp, "Window width!W $W_WIDTH\n" ); // hidden
fputs( $fp, "Number of coincide!k $NUM_COI\n" ); // hidden
fputs( $fp, "Part size!p $P_SIZE\n" ); // hidden
fputs( $fp, "Max. number of shifts!s $MN_SHIFTS\n" );
fputs( $fp, "Max. number of supermotifs!M $MN_ALIGN\n" );
fputs( $fp, "Start position!T $SP_SEQ\n" );
fputs( $fp, "End position!t $EP_SEQ\n" );
fputs( $fp, "Gap penalty!G $GAP_PEN\n" );
fputs( $fp, "Accurate Dothelix!A $DOTHELIX\n" );
fputs( $fp, "Motif frequences recalc.!h $MFR\n" );
fputs( $fp, "Reverse!E $TRANS\n" );
fputs( $fp, "Clusterization!D $CLUSTER\n" ); // hidden
fputs( $fp, "SelectNonCrossSuper!l Y\n" ); // hidden
fputs( $fp, "Proteint Colors!c color1.def\n" );
fputs( $fp, "Weight_matrix!m matrix1.def\n" );
fputs( $fp, "Translation code!e code.def\n" );
/**/
fclose( $fp );
// to provide progress bar:
$nRep = 0;
$myColor = array( "red", "black", "blue" );
if( $Linux ) {
chmod( $inp_file, 0666 ); // ************ Linux
unlink( $sem_name );
# -----------------------------------------------------------
# Wait while query will be ready
# -----------------------------------------------------------
while( file_exists( $inp_file ) ) {
sleep( 1 );
clearstatcache();
if( $nRep == 0 ) {
echo "Progress bar: ";
}
if( $nRep % 60 == 0 ) {
echo "o";
//echo " O.";
flush();
}
$nRep++;
}
}
if( $Windows ) { // simulate progress bar
$i = 0;
while( file_exists( $inp_file ) ) {
sleep( 1 );
clearstatcache();
if( $nRep == 0 ) {
echo "Progress bar: ";
}
if( $nRep % 5 == 0 ) {
echo " O.";
flush();
$i++;
//++if( $i > 3 ) break;
if( $i > 0 ) break;
}
$nRep++;
}
echo "
";
}
/***/
?>