annotate Perl/translate.pl @ 15:dbde253606c5 draft default tip

Uploaded
author dereeper
date Wed, 11 Dec 2024 08:25:06 +0000
parents e42d30da7a74
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
1 #!/usr/bin/perl
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
2
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
3 use strict;
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
4
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
5 use File::Basename;
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
6 my $dirname = dirname(__FILE__);
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
7
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
8 my $out = $ARGV[1];
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
9 my $in = $ARGV[0];
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
10 open(F,$in);
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
11 open(O,">$out");
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
12 while(<F>){
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
13 if (/>(.*)/){
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
14 print O $_;
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
15 }
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
16 else{
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
17 my $dna = $_;
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
18 my $DNA = uc($dna);
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
19 $DNA =~s/\n//g;$DNA =~s/\r//g;
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
20 system("perl $dirname/DNA_Transcription_Translation.pl $DNA >>translate.log 2>&1");
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
21 my $result = `cat result.txt`;
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
22 chop($result);
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
23 print O $result."\n";
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
24 }
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
25 }
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
26 close(F);
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
27 close(O);