Re: Need help with a program

2010-02-03 Thread Nobody
On Tue, 02 Feb 2010 15:07:05 -0800, Aahz wrote: >>If you have a problem and you think that regular expressions are the >>solution then now you have two problems. Regex is really overkill for >>the OP's problem and it certainly doesn't improve readability. > > If you're going to use a quote, it w

Re: Need help with a program

2010-02-02 Thread Aahz
In article , D'Arcy J.M. Cain wrote: > >If you have a problem and you think that regular expressions are the >solution then now you have two problems. Regex is really overkill for >the OP's problem and it certainly doesn't improve readability. If you're going to use a quote, it works better if y

Re: Need help with a program

2010-01-29 Thread nn
Johann Spies wrote: > On Thu, Jan 28, 2010 at 07:07:04AM -0800, evilweasel wrote: > > Hi folks, > > > > I am a newbie to python, and I would be grateful if someone could > > point out the mistake in my program. Basically, I have a huge text > > file similar to the format below: > > > > AGACTC

Re: Need help with a program

2010-01-29 Thread D'Arcy J.M. Cain
On Fri, 29 Jan 2010 11:23:54 +0200 Johann Spies wrote: > I know this is a python list but if you really want to get the job > done quickly this is one method without writing python code: > [...] > $ grep -v 0 /tmp/y > tmp/z There's plenty of ways to do it without writing Python. C, C++, Perl, Fo

Re: Need help with a program

2010-01-29 Thread Johann Spies
On Fri, Jan 29, 2010 at 10:04:33AM +, Steven D'Aprano wrote: > > I know this is a python list but if you really want to get the job done > > quickly this is one method without writing python code: > > > > $ cat /tmp/y > > AGACTCGAGTGCGCGGA 0 > > AGATAAGCTAATTAAGCTACTGG 0 > >

Re: Need help with a program

2010-01-29 Thread Steven D'Aprano
On Fri, 29 Jan 2010 11:23:54 +0200, Johann Spies wrote: > On Thu, Jan 28, 2010 at 07:07:04AM -0800, evilweasel wrote: >> Hi folks, >> >> I am a newbie to python, and I would be grateful if someone could point >> out the mistake in my program. Basically, I have a huge text file >> similar to the f

Re: Need help with a program

2010-01-29 Thread Johann Spies
On Thu, Jan 28, 2010 at 07:07:04AM -0800, evilweasel wrote: > Hi folks, > > I am a newbie to python, and I would be grateful if someone could > point out the mistake in my program. Basically, I have a huge text > file similar to the format below: > > AGACTCGAGTGCGCGGA 0 > AGATAAGCTAATTAAG

Re: Need help with a program

2010-01-28 Thread Arnaud Delobelle
nn writes: > After posting I was thinking I should have posted a more > straightforward version like the one you wrote. Now there is! It > probably is more efficient too. I just have a tendency to think in > terms of pipes: "pipe this junk in here, then in here, get output". > Probably damage from

Re: Need help with a program

2010-01-28 Thread nn
Arnaud Delobelle wrote: > nn writes: > > > On Jan 28, 10:50 am, evilweasel wrote: > >> I will make my question a little more clearer. I have close to 60,000 > >> lines of the data similar to the one I posted. There are various > >> numbers next to the sequence (this is basically the number of t

Re: Need help with a program

2010-01-28 Thread MRAB
Steven Howe wrote: On 01/28/2010 09:49 AM, Jean-Michel Pichavant wrote: evilweasel wrote: I will make my question a little more clearer. I have close to 60,000 lines of the data similar to the one I posted. There are various numbers next to the sequence (this is basically the number of times th

Re: Need help with a program

2010-01-28 Thread Mensanator
On Jan 28, 12:28 pm, Steven Howe wrote: > On 01/28/2010 09:49 AM, Jean-Michel Pichavant wrote: > > > > > > > evilweasel wrote: > >> I will make my question a little more clearer. I have close to 60,000 > >> lines of the data similar to the one I posted. There are various > >> numbers next to the s

Re: Need help with a program

2010-01-28 Thread Steven Howe
On 01/28/2010 09:49 AM, Jean-Michel Pichavant wrote: evilweasel wrote: I will make my question a little more clearer. I have close to 60,000 lines of the data similar to the one I posted. There are various numbers next to the sequence (this is basically the number of times the sequence has been

Re: Need help with a program

2010-01-28 Thread Jean-Michel Pichavant
D'Arcy J.M. Cain wrote: On Thu, 28 Jan 2010 18:49:02 +0100 Jean-Michel Pichavant wrote: Using regexp may increase readability (if you are familiar with it). If you have a problem and you think that regular expressions are the solution then now you have two problems. Regex is really o

Re: Need help with a program

2010-01-28 Thread D'Arcy J.M. Cain
On Thu, 28 Jan 2010 18:49:02 +0100 Jean-Michel Pichavant wrote: > Using regexp may increase readability (if you are familiar with it). If you have a problem and you think that regular expressions are the solution then now you have two problems. Regex is really overkill for the OP's problem and

Re: Need help with a program

2010-01-28 Thread Jean-Michel Pichavant
evilweasel wrote: I will make my question a little more clearer. I have close to 60,000 lines of the data similar to the one I posted. There are various numbers next to the sequence (this is basically the number of times the sequence has been found in a particular sample). So, I would need to ign

Re: Need help with a program

2010-01-28 Thread John Posner
On 1/28/2010 10:50 AM, evilweasel wrote: I will make my question a little more clearer. I have close to 60,000 lines of the data similar to the one I posted. There are various numbers next to the sequence (this is basically the number of times the sequence has been found in a particular sample).

Re: Need help with a program

2010-01-28 Thread Arnaud Delobelle
nn writes: > On Jan 28, 10:50 am, evilweasel wrote: >> I will make my question a little more clearer. I have close to 60,000 >> lines of the data similar to the one I posted. There are various >> numbers next to the sequence (this is basically the number of times >> the sequence has been found i

Re: Need help with a program

2010-01-28 Thread nn
On Jan 28, 10:50 am, evilweasel wrote: > I will make my question a little more clearer. I have close to 60,000 > lines of the data similar to the one I posted. There are various > numbers next to the sequence (this is basically the number of times > the sequence has been found in a particular samp

Re: Need help with a program

2010-01-28 Thread evilweasel
I will make my question a little more clearer. I have close to 60,000 lines of the data similar to the one I posted. There are various numbers next to the sequence (this is basically the number of times the sequence has been found in a particular sample). So, I would need to ignore the ones contain

Re: Need help with a program

2010-01-28 Thread Krister Svanlund
On Thu, Jan 28, 2010 at 4:31 PM, Krister Svanlund wrote: > On Thu, Jan 28, 2010 at 4:28 PM, Krister Svanlund > wrote: >> On Thu, Jan 28, 2010 at 4:07 PM, evilweasel >> wrote: >>> Hi folks, >>> >>> I am a newbie to python, and I would be grateful if someone could >>> point out the mistake in my p

Re: Need help with a program

2010-01-28 Thread D'Arcy J.M. Cain
On Thu, 28 Jan 2010 07:07:04 -0800 (PST) evilweasel wrote: > I am a newbie to python, and I would be grateful if someone could Welcome. > point out the mistake in my program. Basically, I have a huge text > file similar to the format below: You don't say how it isn't working. As a first step y

Re: Need help with a program

2010-01-28 Thread Krister Svanlund
On Thu, Jan 28, 2010 at 4:28 PM, Krister Svanlund wrote: > On Thu, Jan 28, 2010 at 4:07 PM, evilweasel > wrote: >> Hi folks, >> >> I am a newbie to python, and I would be grateful if someone could >> point out the mistake in my program. Basically, I have a huge text >> file similar to the format

Re: Need help with a program

2010-01-28 Thread Krister Svanlund
On Thu, Jan 28, 2010 at 4:07 PM, evilweasel wrote: > Hi folks, > > I am a newbie to python, and I would be grateful if someone could > point out the mistake in my program. Basically, I have a huge text > file similar to the format below: > > AGACTCGAGTGCGCGGA   0 > AGATAAGCTAATTAAGCTACTGG

Re: Need help with a program

2010-01-28 Thread Mark Dickinson
On Jan 28, 3:07 pm, evilweasel wrote: > Hi folks, > > I am a newbie to python, and I would be grateful if someone could > point out the mistake in my program. > for j in range(0, b): >     if lister[j] == 0: At a guess, this line should be: if lister[j] == '0': ... -- Mark -- ht

Re: Need help with a program

2010-01-28 Thread Alf P. Steinbach
* evilweasel: Hi folks, I am a newbie to python, and I would be grateful if someone could point out the mistake in my program. Basically, I have a huge text file similar to the format below: AGACTCGAGTGCGCGGA 0 AGATAAGCTAATTAAGCTACTGG 0 AGATAAGCTAATTAAGCTACTGGGTT 1 A