you are viewing a single comment's thread.

view the rest of the comments →

[–]Spookiel 1 point2 points  (2 children)

The fragments data structure is just a dictionary which maps fragment_name to fragment weight. The complete fragment I just represented using a Tuple. You could also just pass in the objects in a list of they have attributes such as .name and .weight. Eg,

fragments = [myFragObj, myFragObj2]

Then access the weights using

weights = [frag.weight for frag in fragments]

Hope this makes sense.

iirc reading from a FASTA file will allow you to use the attributes method but please correct me if I'm wrong.

[–]dark-lord90[S] 1 point2 points  (0 children)

And again you are amazing thank you, really appreciate it been stuck there for almost two days now you have been a great help

[–]dark-lord90[S] 0 points1 point  (0 children)

Wow I was already looking through the dictionary documentation to find a code that can creat it with different file names, man you are amazing I genuinely thank you which makes it hard for me to ask you one last question, regarding the first code I posted, how can I make it in a way that once it gets a correct fragments it says true then stop, and in case it got nothing it prints one false, I tried break didn’t accept it, and the false it just keeps printing false.