Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Hi, I made a simple perl script to determine the codon usage frequencies f +or each amino acid based on data in a text file. So far it works to d +etermine the frequencies, but I have to input codon usage for each am +ino acid manually... I am trying to get it to automatically extract t +he data that I need. I want to extract the interger value for each codon and store it like +so: (example my $UUU = 291490; my $UCU = 244291; etc etc etc). I am f +airly new to programming and am having a hard time getting the data e +xtracted and stored properly. The text file is saved to my desktop and formatted like so: Vitis vinifera [gbpln]: 24140 CDS's (11557387 codons) fields: [triplet] [frequency: per thousand] ([number]) UUU 25.2(291490) UCU 21.1(244291) UAU 17.9(206846) UGU 10.8(125132) UUC 18.6(215288) UCC 12.6(145986) UAC 10.5(121432) UGC 8.2( 94398) UUA 13.5(156031) UCA 18.7(215994) UAA 0.6( 6828) UGA 0.9( 10455) UUG 25.1(289607) UCG 5.6( 64626) UAG 0.6( 6815) UGG 15.6(180435) CUU 22.1(255515) CCU 18.7(216148) CAU 17.9(206688) CGU 6.0( 69669) CUC 13.5(156457) CCC 9.1(105200) CAC 9.1(105740) CGC 4.7( 53766) CUA 11.2(128918) CCA 18.3(211478) CAA 22.2(256139) CGA 6.6( 76515) CUG 12.2(141100) CCG 5.2( 60461) CAG 15.9(184009) CGG 5.2( 59827) AUU 26.1(301597) ACU 17.7(204752) AAU 26.1(301492) AGU 14.1(162715) AUC 15.7(181341) ACC 11.0(127287) AAC 14.6(168187) AGC 10.3(118518) AUA 13.7(158431) ACA 15.5(179134) AAA 29.2(337782) AGA 18.6(214862) AUG 26.1(301968) ACG 4.3( 49960) AAG 33.6(388634) AGG 16.0(185039) GUU 23.3(268788) GCU 23.1(267133) GAU 34.9(403518) GGU 16.8(194580) GUC 10.9(126346) GCC 13.4(155209) GAC 16.1(186142) GGC 10.9(126426) GUA 10.4(120284) GCA 19.8(229251) GAA 32.4(374017) GGA 20.1(231880) GUG 19.6(226898) GCG 5.1( 58533) GAG 32.4(374052) GGG 14.7(169347) Coding GC 44.24% 1st letter GC 50.18% 2nd letter GC 39.88% 3rd letter +GC 42.65% THANKS for any help, Derrick

In reply to Extracting Data from .txt file by drhicks

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and the sunlight beams...

    How do I use this? | Other CB clients
    Other Users?
    Others examining the Monastery: (5)
    As of 2017-02-23 21:20 GMT
    Find Nodes?
      Voting Booth?
      Before electricity was invented, what was the Electric Eel called?

      Results (351 votes). Check out past polls.