Hello everyone, I am super new to perl and after I was slowly starting to get the hang of it, I got sick. And since then I have been on a health break for around four months. You can imagine that I am now once again completely lost when it comes to scripting. I need to pick up my work again now, but I am honestly lost and a bit overwhelmed...if not even scared about how and where I should even start. I tried reading through some tutorials, but sadly those only worsened my anxiety with scripting.

All I am able to provide is a pseudo-code...or some sort of it, that I wrote down in order to see what my new script needs to do. However my first struggle is already fitting the regular expression in the first step. I do NOT expect anyone to write me down a script now, as I would love to be able to work on it myself. But I believe I do require some pushes into the right direction, some advice on how to tackle this script. Thank you very much in advance.

1. Create a header with all the IDs - open/create file - start header file with "Source tRNA" - get ID via regex UNI_DATE_ID_ENDING_#NO - add ID to file - close file 2. Create new files -Titles: 5p-tR-halves 5p-tRFs p-tR-halves 3p-CCA-tRFs 3p-tRFs tRF-1 tRNA-leader misc-tRFs - add first column to each file: MT-TA MT-TC MT-TD MT-TE ... 3. - print the according columns from each mergerpt file from each folder + into the new file - column assignment: 5p-tR-halves - 1 5p-tRFs - 2 p-tR-halves - 3 3p-CCA-tRFs - 4 3p-tRFs - 5 tRF-1 - 6 tRNA-leader - 7 misc-tRFs - 8 4. Add the ID header to each file

I have multiple folders and they all contain a file with the same name ("merge") which I am working with. The file roughly looks like that:

MT-TA 5.36272153463324 21.4508861385329 8.04408230194985 3 +4.857689975116 0 0 0 13.4068038365831 MT-TC 24.1322469058496 160.881646038997 48.2644938116991 3 +7.5390507424327 45.5831330443825 0 0 104.573069925348 MT-TD 10.7254430692665 10.7254430692665 0 2.68136076731662 + 0 176.969810642897 1.34068038365831 445.105887374559

The goal is to have new files which all have the 1st/2nd...column from these merge files. So the first new file should contain just the 2nd column (because the first is the source name) from all "merge" files; the next just the 3rd column from all files, the next just the 4th...and so on.

Any help and advice on how I can start working on, or where I can turn to, to find what I need to write this script is much appreciated. ~Panda


In reply to General Help/Advice Needed by PandaRaey

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.