Re: another parsing script :)

2011-05-15 Thread Dr.Ruud
On 2011-05-13 17:46, Nathalie Conte wrote: ATGGATAGATA\n I want to calculate the AT ratio of each base based on their position (3/4) for the 1st position, 3/4 on the second, (0/4) on the 3rd... perl -MData::Dumper -wle ' my %pos; my $s = $ARGV[0]; push @{ $pos{ substr $s, $_, 2 } }, $_

Re: another parsing script :)

2011-05-13 Thread John SJ Anderson
On Fri, May 13, 2011 at 11:46, Nathalie Conte wrote: > I have a file with sequences each sequence is 200 pb long and I have 30K > lines > > ATGGATAGATA\n > TTCGATTCATT\n > GCCTAGACAT\n > TTGCATAGACTA\n > I want to calculate the AT ratio of each  base based on their position >  (3/4) for the 1st po

Re: another parsing script :)

2011-05-13 Thread Rob Dixon
On 13/05/2011 16:46, Nathalie Conte wrote: I have a file with sequences each sequence is 200 pb long and I have 30K lines ATGGATAGATA\n TTCGATTCATT\n GCCTAGACAT\n TTGCATAGACTA\n Does your data look like this? With 10, 11, or 12 characters per line? I'm afraid I don't know what a pb is, are yo

Re: another parsing script :)

2011-05-13 Thread Luca Cappelletti
Hi Nathalie I'm absolute newbie in terms of Perl but take into account the use of PDL that will help you better manage vectors, matrix and number crunch calculations. cheers, Luca -- --- Luca Cappelletti http://developerinfodomestic.blogspot.com "...Together we stand, divided we

Re: another parsing script :)

2011-05-13 Thread rent0n
On 13/05/11 17:11, John Francini wrote: "200 pb" -- does pb mean petabytes? If so, those aren't going to fit in memory; you're going to have to read the file line by line, accumulating totals and ratios as you go. J -- John Francini No, I'm quite sure pb (bp?) stands for base pairs, or nucl

Re: another parsing script :)

2011-05-13 Thread John Francini
"200 pb" -- does pb mean petabytes? If so, those aren't going to fit in memory; you're going to have to read the file line by line, accumulating totals and ratios as you go. J -- John Francini "I have come to the conclusion that one useless man is called a disgrace; that two are called a law