open my $IN, '<', 'domain.txt' or die $!;
while (<$IN>) {
my ($id, $from, $to) = split /[;\s]+/;
print "$id; $from $to\n";
for my $pos (0 .. length($hash1{$id})) {
print join ' ',
$pos,
substr($hash1{$id}, $pos, 1),
substr($hash2{$id}, $pos * 3, 3),
$from <= $pos && $pos <= $to ? 'YES' : 'NOT',
"\n";
}
}
####
#!/usr/bin/perl
use warnings;
use strict;
sub load_fasta {
my ($file) = @_;
open my $IN, '<', $file or die $!;
my ($seq, $id, %hash) = q();
my $store = sub {
$hash{$id} = $seq if $id;
($id) = shift =~ /\|(.*)/;
$seq = q();
};
while (<$IN>) {
chomp;
if (/^>/) {
$store->($_);
} else {
$seq .= $_;
}
}
$store->(q());
return %hash
}
my %hash1 = load_fasta('acids.txt');
my %hash2 = load_fasta('nucleotides.txt');
####
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord
}map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,