hello! becuase you mentioned about "CDS", "original", so I guess you want parser information from a genbank format file, right? (e.g. https://www.ncbi.nlm.nih.gov/nuccore/M85050.1) as cavac say, if you do not offer file format, other people can't understand what do you want to do, and then understand wether the code work good. so I can't offer how to make your code work correctly, too.

there are some part of your maybe need change, I just try to give some advice:)

@cds = (@cds, $content[$start]); print @cds;

before this paragraph, @cd did not defined in anywher, so this will make script stop work, and because it assigned by itself, I can't understand purpose of this statements, so I don't know how to modify it, but I sure it won't work now.

for ($start;$start <= $index_max; $start++) { @origin = (@origin, $content[$start]); shift (@origin); #Delete ORIGIN row; print @origin; for @origin {

this part have same problem, what is @origin?

#This chromosome have tags. Identify CDS ones. my @features =$mySeq ->all_seqfeatures(); foreach $feature (@features) { my @tag = $CDS; my @feat = $join; foreach $tag ( $feat->all tags() ); print "Feature region has tag", $tag, "CDS", join(‘ ‘,$feat->each tag value($tag)), "\n"; }

I guess you defined subroutines in other site, so I don't what can they do, ;-;.

open(my $file, '<', $file_name) or die "Sorry, we can't open your $fil +; open (WRITE, ">>concatenare.txt");

you used two style of open() in this code, first is better, please use it every times.

you can use  while(my $line = <$fh>){...}, this will read one line of file in each times. so you don't need read all content into a array, and don't need to find the last index before. if you actually treat a very big file, it will reduce ram occupied by program.

p.s. yes, Bioperl can resolve most of problem.


In reply to Re: Stuck in Perl.. Partial code, but it needs more improvement.. Any suggestions, please? by glycine
in thread Stuck in Perl.. Partial code, but it needs more improvement.. Any suggestions, please? by cosmin

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.