This box searches only this space. The box at the upper right searches the entire iPlant wiki.

Skip to end of metadata
Go to start of metadata

I've got a question on my python script:

So this file takes in a fasta file and stores the the seqID into a list and the sequence into a list.  My main question is why do I need to .append once more outside the loop on line 30 to ensure that the last nucleotide sequence is added to the list.  The last seqID is placed its list but not the last sequence.


  • No labels

1 Comment

  1. So, one of my programmer friends helped me out with it.  But if anyone wants to know what is going on here's an explanation.

    Apparently, when going through the loop the first time data is an empty string so it stops at line 19 sense it is a false statement.  Therefore, the seqID portion of the loop is ahead of the nucleotide portion.  To fix this I can get rid of the second nuc_list.append(data) outside the loop by placing lines 27 and 28, which store a value in data, after the line.strip() line.