Difference between revisions of "4) Creating a FASTA file and reversing the sequence of it and printing it out in another FASTA file"
imported>S |
imported>S |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
<p><span style="font-size:14px"><strong><em> My input file is TERT protein sequence, and its reverse output printed in "reverse_TERTseq.fasta"</em>: </strong></span></p> | <p><span style="font-size:14px"><strong><em> My input file is TERT protein sequence, and its reverse output printed in "reverse_TERTseq.fasta"</em>: </strong></span></p> | ||
− | <p><br /> | + | <p>---------------------------------------------------------------------------------------------------------------<br /> |
#!/usr/bin/perl<br /> | #!/usr/bin/perl<br /> | ||
use strict;<br /> | use strict;<br /> | ||
Line 11: | Line 11: | ||
<strong>$file = reverse $file;<br /> | <strong>$file = reverse $file;<br /> | ||
print OUT "$file";</strong><br /> | print OUT "$file";</strong><br /> | ||
− | }<br /> | + | }</p> |
+ | |||
+ | <p>----------------------------------------------------------------------------------------------------------------<br /> | ||
</p> | </p> | ||
Latest revision as of 20:19, 21 May 2017
My input file is TERT protein sequence, and its reverse output printed in "reverse_TERTseq.fasta":
---------------------------------------------------------------------------------------------------------------
- !/usr/bin/perl
use strict;
use warnings;
open(FILE, "<sequence.fasta") or die "Can't open the file: $_\n";
open(OUT, ">>reverse_TERTseq.fasta") or die "Can't open the filse: $_\n";
while (my $file = <FILE>){
$file = reverse $file;
print OUT "$file";
}
----------------------------------------------------------------------------------------------------------------
In another folder by name "sequence.fasta", I have saved TERT amino acid sequence:
>NP_937983.2 telomerase reverse transcriptase isoform 1 [Homo sapiens]
MPRAPRCRAVRSLLRSHYREVLPLATFVRRLGPQGWRLVQRGDPAAFRALVAQCLVCVPWDARPPPAAPS
FRQVSCLKELVARVLQRLCERGAKNVLAFGFALLDGARGGPPEAFTTSVRSYLPNTVTDALRGSGAWGLL
LRRVGDDVLVHLLARCALFVLVAPSCAYQVCGPPLYQLGAATQARPPPHASGPRRRLGCERAWNHSVREA
GVPLGLPAPGARRRGGSASRSLPLPKRPRRGAAPEPERTPVGQGSWAHPGRT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