alvi has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: How to make a Counter
by toolic (Bishop) on May 26, 2011 at 20:42 UTC
    That's pretty hard to read. I recommend that you:
Re: How to make a Counter
by perlfan (Parson) on May 26, 2011 at 21:53 UTC
Re: How to make a Counter
by tospo (Hermit) on May 27, 2011 at 11:19 UTC

    Just a few hints because you are new here:

    • People on this forum are not all familiar with biological jargon, so you can't expect everybody to know what a geneID is or to recognise the file format you are posting. Try to describe your problems in a way that everybody will udnerstand ('I have a text file with the following format and I want to count how many times the following text occurs..')
    • As said above, put code tags around the bits of your post where formatting should be preserved as you paste it:
      < code >
      Some formatted text here
      </code>
    • Explore BioPerl and try to find the best module for your job by searching bioperl.org or join the bioperl mailing lists where you can ask people who know both Perl and biology.
    • In this case - and that is often the case - you might get away with a simply command line tool if you are on a UNIX based system (including Mac). For example: the 'grep' command can find a specific string in a file and, with the -c option, counts it for you, like so:
      $ grep -c Glyma05g00620.1 THE_NAME_OF_YOUR_FILE_HERE

Re: How to make a Counter
by CountZero (Bishop) on May 27, 2011 at 06:19 UTC
    And what have you tried?

    An example of your efforts to write something in Perl to solve the problem would be helpful and will create merit for you.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James