Hello Monks I'm new here as you can see. I'm a student in bioinformatics and I'm starting to learn Perl hopping that one day I will become a monk :D . So the problem at hand I need to take sequences from a tabular txt document the format of the sequences is this (24 11 AAAGAAAGCTGAAGACTAAAGAAA) the first number is the number of the sequence the second number is the number i need it says how many times should the sequence be copied. I dont know how to make it I mean I have a base code but its full of holes . Here is a short example of what i need the code to do :
1 2 tt # the first two are the sequence from the doc
2 3 aa
1 tt -> 1-1
tt
2 tt -> 1-2
tt
3 aa -> 2-1
aa #and so on
I will give you my code (but i dont think it will help :/ )
#!/usr/bin/perl\
open FH "<", "filename.txt" or die $!;
open FHWRITE, ">>results.txt" or die $!;
$seq1 = #dont know how for the $ to take the value of the first seq1
$countnumb = split (' ',); # dont know how to take the second number f
+or count number but i think its whit split
$count =0;
while ($count ne $countnumb)
{
print "$seq1";
$count++;
}
# i dont know when this finishes how to make it go for the second seq
need help :D
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.