annotate PanExplorer_workflow/Perl/translate.pl @ 2:97e4e3e818b6 draft

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