-
Notifications
You must be signed in to change notification settings - Fork 0
Topic 4 assignment
davidaray edited this page Oct 20, 2024
·
2 revisions
Update the gc_content.py script to include the following functionalities:
-
Use argparse to take in three values:
-
--gc_threshold: A GC content threshold. -
--length_threshold: A length threshold. -
--input_fasta: The name of the input FASTA file. - Do this using a function. Return the input values.
-
-
Incorporate a
GC_contentfunction to calculate the GC content of sequences. Return the GC content. - Incorporate a new function that calculates the length of each sequence. Return the length.
- Evaluate the GC content and length of each sequence.
-
Sort sequences into three new files:
- A file containing sequences with GC content and length lower than your GC and length thresholds.
- A file containing sequences with GC content and length higher than your GC and length thresholds.
- A file that contains sequences that do not match either of the two categories above.
Hints:
Be careful in your use of float, int, and str.
Consider using elif. https://www.w3schools.com/python/gloss_python_elif.asp