It isn't clear what you are using here to determine the intron lengths. What was initially "posted" was output from cufflinks, which has your gene/transcript information and FPKM scores for each. Your newly posted script reads in a fasta file and determines the sequence length for each entry in the fasta file. Easy enough. The introns aren't marked in a fasta file, so I'm guessing that you'll use transcript information from the refFlat file from the UCSC genome browser or ensembl, etc. If you wanted to know the length of all exons combined for a given transcript (and ignoring any splicing variants, etc.) then you'll want to use the refFlat.txt file that can be downloaded from UCSC. It's easy to parse, and you can use the table browser to help figure out what values are in what columns (it notes where each exon begins and ends, for instance). You can import the data into a hash with the gene symbol or the accession number as a key and then calculate the exon/intron lengths for only the transcripts that you are interested in.

In the future, I'd try to post a bit more information and be careful to format it better on the site. People here are willing to help, but are less likely to do so if it annoys them. I can look at what you posted and see exactly what you are doing because I work with this type of data all day long; others may not but still have invaluable input in writing your scripts properly, so try to help them get on board. Good luck!

Bioinformatics

In reply to Re^3: intron length by bioinformatics
in thread intron length by MBobur

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.