Re: [Tutor] triple-nested for loop not working

2011-05-05 Thread Andre Engels
I have not checked the rest of your code, but: > for line in seqalign: >     for i in len(finalmotif_seqs):      # for item in finalmotif_seqs: >         for i in len(finalmotif_annot):     # for item in finalmotif_annot: I see two problems here: 1. You are using the same loop variable in both lo

Re: [Tutor] triple-nested for loop not working

2011-05-04 Thread ALAN GAULD
CC'd to list > Thanks for your suggestions. I now see I was using far too much unnecessary > code plus data structures (lists) that were useless. I modified the entire > program to the following lines based on suggestions from yourself and > other people on the mailing list: > import os, st

Re: [Tutor] triple-nested for loop not working

2011-05-04 Thread Alan Gauld
"Spyros Charonis" wrote motif_file = open('myfolder/pythonfiles/final motifs_11SGLOBULIN', 'r') align_file = open('myfolder/pythonfiles/11sglobulin.seqs', 'a+') finalmotif_seqs = [] finalmotif_length = [] # store length of each motif finalmotif_annot = [] finalmotifs = motif_file.readlin

Re: [Tutor] triple-nested for loop not working

2011-05-04 Thread bob gailer
On 5/4/2011 2:31 PM, Spyros Charonis wrote: Hello everyone, I have written a program, as part of a bioinformatics project, that extracts motif sequences (programmatically just strings of letters) from a database and writes them to a file. I have written another script to annotate the database

Re: [Tutor] triple-nested for loop not working

2011-05-04 Thread Prasad, Ramit
ad=jpmchase....@python.org] On Behalf Of Spyros Charonis Sent: Wednesday, May 04, 2011 1:31 PM To: tutor Subject: [Tutor] triple-nested for loop not working Hello everyone, I have written a program, as part of a bioinformatics project, that extracts motif sequences (programmatically just strings

Re: [Tutor] triple-nested for loop not working

2011-05-04 Thread Adam Lucas
On Wed, May 4, 2011 at 13:31, Spyros Charonis wrote: > Hello everyone, > > I have written a program, as part of a bioinformatics project, that > extracts motif sequences (programmatically just strings of letters) from a > database and writes them to a file. > I have written another script to anno

[Tutor] triple-nested for loop not working

2011-05-04 Thread Spyros Charonis
Hello everyone, I have written a program, as part of a bioinformatics project, that extracts motif sequences (programmatically just strings of letters) from a database and writes them to a file. I have written another script to annotate the database file (in plaintext ASCII format) by replacing ev