Re: new for reading file containing multiple records

2006-01-06 Thread Xavier Noria
On Jan 6, 2006, at 4:12, chen li wrote: Hi all, I have a big file (2.7G) containing multiple records in this format: gi|618748|dbj|D21618.1| MUS74F01 mouse embryonal carcinoma cell line F9 Mus mus culus cDNA clone 74F01, mRNA sequence GCTGCCTCGACGATCTTCGCTTGCNTCCTCGCTCGCTGTCCCGTTGTCCTAGCCCGCC

Re: new for reading file containing multiple records

2006-01-06 Thread chen li
Hi Xicheng, Thanks. I search the list before I post the question but I can't find similar topics. Could you please tell me some ealier posts? Also I try to use your code to read a very small file containing only these two records. Here is what I got: This is record 1. This is sequence: This is re

Re: new for reading file containing multiple records

2006-01-06 Thread chen li
> Word wrapping possibly mangled the example records, > could you please > upload a handful of them in a file somewhere? > > -- fxn Hi, I am just a newbie. What is word wrapping? Is it a perl module or something else? Thanks, Li

Re: new for reading file containing multiple records

2006-01-06 Thread John Doe
chen li am Freitag, 6. Januar 2006 11.27: > Hi Xicheng, Hi Chen > Thanks. I search the list before I post the question > but I can't find similar topics. Could you please tell > me some ealier posts? Also I try to use your code to > read a very small file containing only these two > records. Here

arguments in closure

2006-01-06 Thread root
Hello, about closure I read the Perl literacy course lecture #9 Closures Shlomo Yona http://cs.haifa.ac.il/~shlomo/ The explanations are clear but in this example: (it's an excerpt of an example of Shlomo) #!/usr/bin/perl use warnings; use strict; my $sumform = make_binary('$_[0] + $_[

Re: arguments in closure

2006-01-06 Thread John Doe
root am Freitag, 6. Januar 2006 13.15: > Hello, > about closure I read the > > Perl literacy course > > lecture #9 Closures > > Shlomo Yona http://cs.haifa.ac.il/~shlomo/ > > > The explanations are clear but in this example: > (it's an excerpt of an example of Shlomo) > > #!/usr/bin/perl > use war

Re: new for reading file containing multiple records

2006-01-06 Thread Shawn Corey
chen li wrote: Each record starts with ">". I want to read each record once at a time.I hear about a special variable call $/ might do the job but not sure how to use it. I wonder if anyone could help me out. See `perldoc perlvar` and search for INPUT_RECORD_SEPARATOR. Here is a simple script

How to improve speed of returning value from calling method on an array of objects?

2006-01-06 Thread Sai Tong
Hi, I have an array of many objects and I want to call a method on each of these objects and the save the returned values into an array: my @return_values; foreach my $retrievedObject (@array_of_objects) { push (@return_values , $retrievedObject->method ); } The problem is this code runs too sl

Re: How to improve speed of returning value from calling method on an array of objects?

2006-01-06 Thread Adriano Ferreira
On 1/6/06, Sai Tong <[EMAIL PROTECTED]> wrote: > I have an array of many objects and I want to call a method on > each of these objects and the save the returned values into an array: > my @return_values; > foreach my $retrievedObject (@array_of_objects) { > push (@return_values , $retrievedObject

Re: arguments in closure

2006-01-06 Thread JupiterHost.Net
sub make_binary { my $vars = shift; return eval "sub { $vars; }"; } I understand the mechanism of the closure, but I don't figure out how the anonymous subroutine puts the two arguments in $_[0] and in $_[1] ? Its evaling a string and $vars is being interpolated so the eval, in that e

Re: new for reading file containing multiple records

2006-01-06 Thread Tom Phoenix
On 1/5/06, chen li <[EMAIL PROTECTED]> wrote: > Each record starts with ">". I want to read each > record once at a time.I hear about a special variable > call $/ might do the job but not sure how to use it. The perlvar manpage documents $/ and all of Perl's other special variables. In particular,

Re: how do I avoiding zombie processes without interfering with " die if system(ls) " type calls

2006-01-06 Thread Tom Phoenix
On 1/5/06, Rahul <[EMAIL PROTECTED]> wrote: > if (fork() == 0){ Because your process table can become full and temporarily prevent forking new processes, you should check the return value of fork whenever you're making more than N processes. The value of N depends upon a number of factors, so I

Re: How to improve speed of returning value from calling method on an array of objects?

2006-01-06 Thread Tom Phoenix
On 1/6/06, Sai Tong <[EMAIL PROTECTED]> wrote: > The problem is this code runs too slowly for a large array of objects. > Its seems that it might be a little too slow to "push" each > returned value into @return_values . Can anyone suggest the best way to > improve the speed of putting the returne

Help With signals.

2006-01-06 Thread Leif Ericksen
I am trying to set up a routine to trap signals so that I can pass it to a sub that will act on the signals and it does not seem to be functioning as I would think. SAMPLE: I will admit some of the code was taken from the camel book. :) I do have use strict on. my $name = "\n"; my $i = 0; def

Re: Help With signals.

2006-01-06 Thread Wiggins d'Anconia
Leif Ericksen wrote: > I am trying to set up a routine to trap signals so that I can pass it to > a sub that will act on the signals and it does not seem to be > functioning as I would think. > > SAMPLE: > I will admit some of the code was taken from the camel book. :) I do > have use strict on

Re: Help With signals.

2006-01-06 Thread Leif Ericksen
Actually not quite what you thought on the output... $ ./myt.pl ZERO:0 => SIG{'ZERO'} = &sigcat HUP:1=> SIG{'HUP'} = &sigcat INT:2=> SIG{'INT'} = &sigcat QUIT:3 => SIG{'QUIT'} = &sigcat ILL:4=> SIG{'ILL'} = &sigcat TRAP:5 => SIG{'TRAP'} = &sigcat ABRT:6 => SIG{'ABRT'} = &sigcat

Re: Help With signals.

2006-01-06 Thread Wiggins d'Anconia
Please bottom post... Leif Ericksen wrote: > Actually not quite what you thought on the output... > $ ./myt.pl > ZERO:0 => SIG{'ZERO'} = &sigcat > HUP:1=> SIG{'HUP'} = &sigcat > INT:2=> SIG{'INT'} = &sigcat > QUIT:3 => SIG{'QUIT'} = &sigcat > ILL:4=> SIG{'ILL'} = &sigcat > TRAP:5

Re: Help With signals.

2006-01-06 Thread Leif Ericksen
On Fri, 2006-01-06 at 15:58 -0700, Wiggins d'Anconia wrote: > Please bottom post... > > Leif Ericksen wrote: > > Actually not quite what you thought on the output... > > $ ./myt.pl > > ZERO:0 => SIG{'ZERO'} = &sigcat > > HUP:1=> SIG{'HUP'} = &sigcat > > INT:2=> SIG{'INT'} = &sigcat > > Q

Re: Help With signals.

2006-01-06 Thread John Doe
Leif Ericksen am Samstag, 7. Januar 2006 00.12: > On Fri, 2006-01-06 at 15:58 -0700, Wiggins d'Anconia wrote: > > Please bottom post... > > > > Leif Ericksen wrote: > > > Actually not quite what you thought on the output... > > > $ ./myt.pl > > > ZERO:0 => SIG{'ZERO'} = &sigcat > > > HUP:1=>

Re: new for reading file containing multiple records

2006-01-06 Thread chen li
Hi Shawn, I use the your code to do the job: #!/usr/bin/perl use strict; use warnings; use Data::Dumper; my $filename='sequence.fasta'; open (DATA,$filename) or die; {local $/ = '>'; while( ){ print Dumper \$_; } } exit; And I get the following output: $VAR1 = \'>'; $VAR1 =

Re: new for reading file containing multiple records

2006-01-06 Thread Wijaya Edward
Hi, I would suggest you use the built-in BioPerl method for reading fasta (or other) format, for example: sub get_sequence_from_fasta { #designed for getting sequences into array from a file (fasta format), #input: file name use Bio::SeqIO; my $file = shift; my @seqs= ();

Need some help and direction

2006-01-06 Thread Daniel Gladstone
I thought this would be easy but I can not get it to work - can someone please help me: Problem: I have a file of 7.5 million records that are pipe delimted, the first field is a record number. I want to search for around 10 records with a specific record number and if they meet that condition

Re: Need some help and direction

2006-01-06 Thread JupiterHost.Net
Daniel Gladstone wrote: I thought this would be easy but I can not get it to work - can someone please help me: Problem: I have a file of 7.5 million records that are pipe delimted, the first field is a record number. I want to search for around 10 records with a specific record number and

Re: Help With signals. Got it working Thanks.

2006-01-06 Thread Leif Ericksen
This is the person that gave me the direction I needed to get my signals working.. (Sorry for the top post here... I wanted the most important part out first..) For the actual FULL code that I am working with at present see the bottom of the message. On Sat, 2006-01-07 at 01:14 +0100, John Doe w