Skip to content

ex 0#9

Open
anna31D wants to merge 16 commits intonathanielpolley:masterfrom
anna31D:master
Open

ex 0#9
anna31D wants to merge 16 commits intonathanielpolley:masterfrom
anna31D:master

Conversation

@anna31D
Copy link

@anna31D anna31D commented Sep 20, 2023

test

@nathanielpolley
Copy link
Owner

Hi Anna. It is nice to meet you and I agree with you fully on your motivation. Not only does computer science open yourself to new opportunities, but it provides a new means of thinking through problems objectively in a world where too many things are guided by emotion alone.

Just one suggestion, the "import this" line was supposed to produce a poem to be copied over to the submit file above the text output from your prompts. However, as everything shows that your PyCharm can run the code correctly, and you are connected to GitHub, I can give you the full points.

Score: 0.5/0.5

Copy link
Owner

@nathanielpolley nathanielpolley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Anna. Everything is good about your intermediate assignment so far. The one thing you have left to add is the ability to "handle incorrect user input gracefully". For this, you will need to think through the cases that the user might type something in incorrectly and encapsulate an exception into an if/else statement which terminates the code if there is incorrect formatting. There are three main instances of incorrect user input here, and I would like you to think of what they are and implement the appropriate conditionals for them. Then, I will provide you with a final grade.

Copy link
Owner

@nathanielpolley nathanielpolley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For your advanced assignment, everything runs as it should. However, I would like for you to refactor it again with The Zen of Python in mind: "Simple is better than complex". There is a native function for strings that "counts" how many occurrences of a character there are. This is done using vectorization, which is a lot nicer on the memory than iterating through the entire string, which can become demanding on the CPU if you are dealing with large datasets of millions of DNA reads. Implement this change while preserving the great work you have already done with the try/catch output you have created for something that is not a DNA sequence. I will give you full points then. Best of luck.

Nathaniel

@anna31D
Copy link
Author

anna31D commented Oct 5, 2023

only the comit cf85d2f is correct (i don't know why the other ones are like that....)

Copy link
Owner

@nathanielpolley nathanielpolley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Complete: assignment 0 intermediate
Pending: assignment 0 advanced

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very excellent work here. My only recommendation would be to validate if the user entered a string that could be converted to an int as soon as it is read in. However, everything that I asked has been implemented taking into account the if/else statements that I wanted people to learn from this, so I will award you the full points.

Score: 1.5/1.5

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this, instead of using a for loop, you can simply use the .count() string method to count the number of characters in a string. See below:

https://stackoverflow.com/questions/1155617/count-the-number-of-occurrences-of-a-character-in-a-string

Then you can use the values from this to perform the necessary calculations after validating that the user only input an ATC or G.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very excellent implementing the correct changes to this.

Score: 2/2

Copy link
Owner

@nathanielpolley nathanielpolley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Completed: assignment beginner 0, assignment intermediate 0, assignment advanced 0
Pending: None

Score: 4/4

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very excellent implementing the correct changes to this.

Score: 2/2

Copy link
Owner

@nathanielpolley nathanielpolley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Complete: assignment 0 beginner, assignment 0 intermediate, assignment 0 advanced

Total score: 4/4

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obviously, everything works on both your GitHub and PyCharm, so I will mark this and all of the other assignment 0 objectives as complete.

Score: 0.5/0.5

Copy link
Owner

@nathanielpolley nathanielpolley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Completed: assignment_0_beginner, assignment_0_intermediate, assignment_0_advanced, assignment_1_intermediate, assignment_2_advanced

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brilliant mastery of all of the topics to date! Although I am very impressed with the detailed code for each possible amino acid, BioPython does offer the methods such as .translate( ) to be able to perform these automatically. Nonetheless, someone did have to code all of these methods in BioPython at the machine level. Are you sure you don't want to do this for a living?

Take care!

Score: 2/2

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent handling of dictionaries, for/while loops, and break statements.

Score: 1.5/1.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants