0
Hello, I’m new to the forum and I’m still learning how to use the interface. If I posted in the wrong place or something like that, I’m sorry. I created an account to ask a question about a problem that’s bothering me a lot. I’m making a program in python 3 that takes a Fasta file and makes a list of the "extensions" of genomic sequences. The problem is that in one part of the code, more precisely in that function, I can’t get the other for begin to give the result (in this case, the id of the largest number, i.e., the largest extension in the genomic sequence). The first for stays in an eternal looping and I don’t know how to get him out of it.
def identifiers():
lista = []
for record in SeqIO.parse(fasta, "fasta"):
lista.append(len(record))
for record in SeqIO.parse(fasta, "fasta"):
if len(record) == lista_sort[-1]:
print(record.id)
Does anyone know how to solve this?
Matheus, also put the contents of the variable
fasta
and what is the expected result with the code.– RFL
I couldn’t upload the file. Is there any way to do this on the site itself?
– Matheus Bento de Souza