Hello supriyoch_2008,

The changes proposed by u65 are a good start, but in addition I’ve had to (1) change:

use Bio::CUA; # perl module

to:

use Bio::CUA::CUB::Calculator; use Bio::CUA::SeqIO;

(2) create an empty file tai.out; (3) put the coding sequence in a file cds.dat and change:

my $io = Bio::CUA::SeqIO->new($cds);

to:

my $io = Bio::CUA::SeqIO->new(-file => 'cds.dat');

(4) change three occurrences of printf to sprintf:

my $tai_val = sprintf "%10s: %.7f\n", $seq->id, $tai; my $CAI_val = sprintf "%10s: %.7f\n", $seq->id, $CAI; my $encp_val = sprintf "%10s: %.7f\n", $seq->id, $encp;

But I’m still not getting meaningful output. :-( You need to specify for the PerlMonks exactly what output you expect to get. Also, you will need to address the following warnings:

------------- WARNING Bio::CUA::CUB::Calculator ------------- MSG: CAI values for codons were not provided for this analyzer, so can + not calculate CAI for sequences ------------------------------------------------------------- ... ------------- WARNING Bio::CUA::CUB::Calculator ------------- MSG: No default base composition for seq '', so no GC-corrected ENC -------------------------------------------------------------

But I note that the documentation for Bio::CUA::SeqIO says that it is:

a package to parse sequence file if module Bio::SeqIO is unavailable in the system.

So perhaps you would be better off experimenting with the Bio::SeqIO module?

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,


In reply to Re: How can I get the values of codon usage using the Bio::CUA module? by Athanasius
in thread How can I get the values of codon usage using the Bio::CUA module? by supriyoch_2008

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.