#!usr/bin/perl use strict; use library; my $filename = usrquery ("Please enter multiple FASTA filename: \n"); my %MULTIFAS = parseMULTIFAS ($filename); my @keys = keys %MULTIFAS; my ($key, $dna, $size) = ''; open_outfile; foreach $key (@keys) {if (length $key>0) { $dna = $MULTIFAS{"$key"}; $size = length($dna); my ($start, $stop, $j, $translated_frame, $frame) = ''; my (@all_orfs) = (); $j = 1; while ($j < 4) {$frame = $j; @all_orfs = (); $translated_frame = ''; for (my $i=($frame-1);$i < (length($dna)-2);$i +=3) {my $codon = substr ($dna, $i, 3); $translated_frame .= trans ($codon); } @all_orfs = split_sequence ($translated_frame); foreach my $ORF (@all_orfs) {$translated_frame =~ /$ORF/ig; $stop = pos ($translated_frame); $start = ($stop - (length $ORF))+1; my ($nt_start, $nt_stop) = counting ($start, $stop, $frame); my $aa = length $ORF; my $tag = "$key, $size bp, frame $frame, positions $nt_start to $nt_stop, $aa residues"; print OUTFILE "$tag\n"; print OUTFILE "$ORF\n"; } ++$j; } my $rc = revcomp ($dna); $j = 1; while ($j < 4) {$frame = $j; @all_orfs = (); $translated_frame = ''; for (my $i=($frame-1);$i < (length($dna)-2);$i +=3) {my $codon = substr ($rc, $i, 3); $translated_frame .= trans ($codon); } @all_orfs = split_sequence ($translated_frame); foreach my $ORF (@all_orfs) {$translated_frame =~ /$ORF/ig; $stop = pos ($translated_frame); $start = ($stop - (length $ORF))+1; my ($nt_start, $nt_stop) = counting ($start, $stop, $frame); my $rc_nt_start = (($size - $nt_start)+1); my $rc_nt_stop = (($size - $nt_stop)+1); my $aa = length $ORF; my $tag = "$key, $size bp, frame -$frame, positions $rc_nt_start to $rc_nt_stop, $aa residues."; print OUTFILE "$tag\n"; print OUTFILE "$ORF\n"; } ++$j; } }} # end of original foreach and if loops # close (OUTFILE); exit;