I need some help pleaseeeee: the question is... Develop a Perl program that ask the user to type the name of a file in the working directory (containing one protein sequence in FASTA format) and prints the number of Phenylalanine aminoacids in the sequence. -It prints a message, prompting the user to insert the file name. -It reads the file name assigning it to one variable. -It opens for reading the file with that name. If the file is not existing it gives an error message. -A scalar variable that will contain the sequence is initialized to the empty string “”. -The program reads one after the other (with a while loop) the lines of the file assigning the read line to a variable. - If the line starts with “>” (it is the first line of a FASTA file) the line is not considered. Else all the white spaces are removed from the line and the line is postponed to the sequence. -When all the lines have been read the while loops terminates and the program continues closing the file. -Using the translate command, the program counts the number of F in the sequence, assigning it to a variable. -It prints the message: “The aminoacid sequence ” followed by the variable containing the read sequence “ contains “ followed by the variable with the number of F, followed by “Phenylalanine aminoacids” followed by new line.

This is the "protein file": >gi|403369491|gb|EJY84591.1| Transcriptional regulator, Sir2 family protein Oxytricha trifallax MMKQLIKHNKNTPLFNFLRVKFSSTAATIQTQQTVNKPIESKFKEEKLDNYHDIYEKSKRLAEQISQSKS FICFTGAGLSTSTGIPDYRSTSNTLAQTGAGAYELEISEEDKKSKTRQIRSQVQRAKPSISHMALHALME NGYLKHLISQNTDGLHLKSGIPYQNLTELHGNTTVEYCKSCSKIYFRDFRCRSSEDPYHHLTGRQCEDLK CGGELADEIVHFGESIPKDKLVEALTAASQSDLCLTMGTSLRVKPANQIPIQTIKNKGQLAIVNLQYTPF DEIAQIRMHSFTDQVLEIVCQELNIKIPEYQMKRRIHIIRNAETNEIVVYGSYGNHKNIKLSFMQRMEYI DNKNHVYLALDKEPFHIIPDYFNFQNINTDQEEVEFRIHFYGHNSEPYFQLTLPRQSILELQAGEHLICD ITFDYDKLEWK I wrote this but doesn't work:

#!/usr/bin/perl -w print "Please type the file name of the protein sequence data: "; $proteinfilename = <STDIN>; unless ( open (PROTEINFILE, $proteinfilename) ) { print "File \"$proteinfilename\" doesn\'t seem to exist!!\n"; } $protein = <PROTEINFILE> ; $empty = " " , (<PROTEINFILE>); while ( $protein = <PROTEINFILE> ) { if ( $protein =~ /^>/ ) { next $protein; } else { $protein =~ s/$empty//g ; $protein = join ($protein, @protein); print $protein; } }

Update: Thx


In reply to PROTEIN FILE help me pleaseee by serafinososi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.