Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unless (open FILE, "<", '/scratch/SampleDataFiles/test.fasta') {
- die "Cannot Open File", $!;
- }
- $/ = ">";
- my @file = <FILE>;
- my $file = "@file";
- chomp $file;
- my $count = 0;
- my $sequence_count = 0;
- foreach $file (@file) {
- if ($file =~ /(.*;.*;?n)(w+)/) {
- my $head = $1;
- my $sequence = $2;
- $sequence_count = $sequence_count +1;
- if ($sequence =~ /([VILMFWCA]{8,}?)/i) {
- print "n", "Hydrophobic region(s) found in ", $head, "n";
- $count = $count +1;
- }
- while ($sequence =~ /([VILMFWCA]{8,}?)/gi) {
- my $pos = pos($sequence)-7;
- print $1, " found at ", $pos, "n", "n";
- }
- }
- }
- print "n", "n", "-------------------------", "n", "Hydrophobic region(s)
- found in ", $count, " out of ", $sequence_count , " sequences.", "n", "n";
- close FILE;
Add Comment
Please, Sign In to add comment