Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

comment on

( [id://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

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-04-24 17:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found