Here is as far as I can get with some real code and pseudo code. This is just to show you that I am actually trying. :-)

Pseudo - code

################################
# open DNA sequence file
################################

print "Enter in the name of the DNA sequence file:\n";
chomp (my $dna_seq = <STDIN>);
open(DNA_SEQ, $dna_seq)
        or die "Can't open sequence file for input: $!";

########################################################
# read sequence data into a hash - not sure if this is how I should do it?
########################################################


my %sequences;

$/ = '>'; # set to read in paragraph mode

print "\n***Discovered the following DNA sequences:***\n";

while ( <DNA_SEQ> ) {
        chomp;
        next unless s/^\s*(.+)//;                       
    my $name = $1;                              
    s/\s//g;                                                    
    $sequences{$name} = $_;
    print "$name found!\n";
}
close DNA_SEQ;


################################### # search for and characterize gaps ###################################

<<somehow get data from hash and present it to a loop>>

%gaptype;

<<major pseudo code below>>
foreach /\D(-+)\D/ found in each sequece # searches for gaps flanked by sequence
$position = pos($1);
$gaplength = $1;
$gaplength =~ tr/-//g; # count the number of '-' for that particular
# gap being processed
$gaptype{gaplength}++; # count the number of times each gap type appears

<<somehow get information from loop an print as seen below>>


____OUTPUT_____

Human
number of 3 base pair gaps:             2
                        at positions:           6, 16
number of 5 base pair gaps:             1
                        at positions:           25
.
.. and so on...
.


__DATA__ human acgtt---cgatacg---acgact-----t chimp acgtacgatac---actgca---ac mouse acgata---acgatcg----acgt


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to