-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Binning DNA sequences
Write a program which creates nine new folders – one for sequences between 100 and 199 bases long, one for sequences between 200 and 299 bases long, etc.
Write out each DNA sequence in the input files to a separate file in the appropriate folder.
They gave a few dna files, all file names with the file extension .dna, with each containing sequences of variable length.
I basically followed the example to the 't' and eventually even matched my variable names to theirs. The only part I initially got stuck on was line 37. I don't understand why it has to be repeated (it's a replica of line 13).
I struggled for a long time to figure out why the code was just creating the folders and then printing out what it should to STDIN, but it wasn't moving the files to the created directories.
Anyway, I liked this exercise, because it's useful for sorting files, based on certain criteria and automatically creating the folders and their names, based on their content.