PYTHON ASSIGNMENT:
Import data from CSV file (attached), store in a appropriate data structure and modify parts of those data.
Requirements:
1. Shall use Python 3 to create your script.
2. Shall import all data from a CSV file named “mixture_data.csv” found in the same folder as your script.
3. Shall store all data in a nested data structure. Each mixture has 24 loci; each locus has available number of named peaks and associated peak heights. The data structure that stores the top level of data must be named “mixture_data”.
4. Shall write a function named “apply_threshold” that modifies the “mixture_data” object by removing all peaks with peak height
5. Shall write a function named “print_data” that clearlyprints your mixture data to the console.
6. Shall provide one .py file with your script, which will be submitted via Blackboard. The script must operate on a CSV file named “mixture_data.csv” found within whatever folder a user has placed the script.
7. Extra credit: your “print_data” function will print out peaks in descending order of peak height for each locus.
Output should be like this:
Mixture name: sample_1
Locus name: TPOX
Peaks: 10 (42), 11 (391), 13 (55)
Locus name: TH01
Peaks: 9 (118), 13 (122)
Locus name: D10
Peaks: 8 (449)
Locus name: D12
Peaks: 14 (820), 16 (792)
Locus name: D8
Peaks: 3 (391), 5 (118), 7 (244), 8 (94)
Mixture name: sample_2
Locus name: TPOX
Peaks: 11 (209), 12 (224)
…and so on.
sample_name,locus_name,peak_name,peak_height sample_1_2noc,TPOX,10,7 sample_1_2noc,TPOX,11,231 sample_1_2noc,TPOX,12,884 sample_1_2noc,TPOX,14,43 sample_1_2noc,TPOX,15,921 sample_1_2noc,TPOX,16,211 sample_1_2noc,TH01,9,402 sample_1_2noc,TH01,11,608 sample_1_2noc,TH01,12,22 sample_1_2noc,TH01,13,413 sample_1_2noc,D10,12,22 sample_1_2noc,D10,14,712 sample_1_2noc,D10,17,699 sample_1_2noc,D10,18,556 sample_1_2noc,D10,20,571 sample_1_2noc,D12,4,1298 sample_1_2noc,D12,7,1180 sample_1_2noc,D12,9,722 sample_1_2noc,D12,12,11 sample_1_2noc,D8,3,8 sample_1_2noc,D8,4,229 sample_1_2noc,D8,6,237 sample_1_2noc,D8,7,2 sample_1_2noc,D8,9,1389 sample_1_2noc,D8,10,1448 sample_2_1noc,TPOX,10,338 sample_2_1noc,TPOX,14,391 sample_2_1noc,TPOX,15,9 sample_2_1noc,TPOX,16,11 sample_2_1noc,TH01,9,515 sample_2_1noc,TH01,12,594 sample_2_1noc,D10,12,220 sample_2_1noc,D10,16,242 sample_2_1noc,D10,18,4 sample_2_1noc,D12,8,349 sample_2_1noc,D12,9,321 sample_2_1noc,D8,3,8 sample_2_1noc,D8,5,13 sample_2_1noc,D8,6,192 sample_2_1noc,D8,7,2 sample_2_1noc,D8,9,7