Para-Seqs stuff

Figure 3. Parallel versions of Glimmer Process workflow

Figure 4. Parallel versions of TigrScan process work flow

Pseudo Code for Database segmentation

#Open and read the genome file

Read $genomefile

#Read the 1st line of the FASTA file and display

Read line 1 of $genomefile

Display line1

#Extract the number of bases per line

$bases : no. of bases per line

$zone <-- f(organism,$bases)

Input : $THREADS

#Read the number of lines

$line : no. of lines in the $genomefile

#Compute the distribution desired

$split_lines <-- $lines/$THREADS

$firstline <-- 1

#Remove the existing splitfiles and intersection files

remove all splitfiles

remove all intersection files

#Main splitting code

for $i = 1 to $THREADS-1

{

open splitfile$I

if $i=1 then ($previous <-- $THREADS) else ($previous <-- $i-1)

open intersection$i

open intersection$previous

$lowerzone <-- ($i*$split_lines)-$zone

$upperzone <-- (($i-1)*$split_lines)+$zone

for $line = $firstline to $firstline+$split_lines

{

write to splitfile$i

if ($line > $lowerzone) write to intersection$i file

if ($line <= $upperzone) write to intersection$previous file

}

$firstline <-- $line

#This section ensures that no line gets missed in the

#last thread file , since the average distribution estimated

# per line ($split_lines) may not be an integer

open splitfile$THREADS

$previous <-- $THREADS-1

open intersection$THREADS file

open intersection$previous file

$lowerzone <-- $lines - $zone

$upperzone <-- (($THREADS -1)* $split_lines) + $zone

while (presence of line from current position in $genomefile)

{

$line <-- $line + 1

write to splitfile$THREADS

if $line>$lowerzone write to intersection$THREADS file

if $line<=$upperzone write to intersection$previous file

}

#This section builds the last intersection

#file in order as a FASTA format

$line <-- 0

open intersection$THREADS file

open dummy file

while(presence of line in intersection$THREADS)

{

$line <-- $line + 1

if $line>$zone write to dummy

}

$line <-- 0

while(presence of line in intersection$THREADS)

{

$line <-- $line + 1

if $line<=$zone write to dummy

}

remove intersection$THREADS

rename dummy as intersection$THREADS

exit