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 |
||
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>20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)[[User:S|S]] 20:18, 21 May 2017 (KST)<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>20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)~<br /> | ||
</p> | </p> | ||
Revision as of 20:18, 21 May 2017
My input file is TERT protein sequence, and its reverse output printed in "reverse_TERTseq.fasta":
20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)S 20:18, 21 May 2017 (KST)
- !/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";
}
20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)20:18, 21 May 2017 (KST)~
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
GVPLGLPAPGARRRGGSASRSLPLPKRPRRGAAPEPERTPVGQGSWAHPGRTRGPSDRGFCVVSPARPAE
EATSLEGALSGTRHSHPSVGRQHHAGPPSTSRPPRPWDTPCPPVYAETKHFLYSSGDKEQLRPSFLLSSL
RPSLTGARRLVETIFLGSRPWMPGTPRRLPRLPQRYWQMRPLFLELLGNHAQCPYGVLLKTHCPLRAAVT
PAAGVCAREKPQGSVAAPEEEDTDPRRLVQLLRQHSSPWQVYGFVRACLRRLVPPGLWGSRHNERRFLRN
TKKFISLGKHAKLSLQELTWKMSVRDCAWLRRSPGVGCVPAAEHRLREEILAKFLHWLMSVYVVELLRSF
FYVTETTFQKNRLFFYRKSVWSKLQSIGIRQHLKRVQLRELSEAEVRQHREARPALL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