Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/CARe_Python_Class_2023.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1,593 changes: 1,593 additions & 0 deletions projet_ia_cnn_ilias_simon.ipynb

Large diffs are not rendered by default.

30 changes: 29 additions & 1 deletion week_0/ex_0_advanced/ex_0_advanced_runfile.py
Copy link
Owner

Choose a reason for hiding this comment

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

Good work on accomplishing the objectives. There is, however, a more efficient way to "count" the number of occurrences in a string rather than having to iterate through each character and increment counter variables. Please refer to the link below, and you should be able to condense around 20 lines of this into only 4, a good practice with code "refactoring".

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

Copy link
Owner

Choose a reason for hiding this comment

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

Excellently done in incorporating "simple is better than complex", "flat is better than nested" into your code.

Score: 2/2

Original file line number Diff line number Diff line change
@@ -1 +1,29 @@
#YOUR CODE FOR EX_0 ADVANCED HERE
while True:
sequence = str(input("enter your DNA sequence: "))
sequence = sequence.upper()
valid = True
for i in sequence:
if i not in "ATGC":
print("please enter a valid DNA sequence (ATGC)")
valid = False
break
if valid:
break
sequence_length = int(len(sequence))
nA = sequence.count("A")
nT = sequence.count("T")
nG = sequence.count("G")
nC = sequence.count("C")
GC_content = nG + nC
GC = ((GC_content)/sequence_length)
print("sequence length =" +str(sequence_length))
print("number of A: " +str(nA))
print("number of T: " +str(nT))
print("number of G: " +str(nG))
print("number of C: " +str(nC))
print("number of GC= " +str(GC_content), end="")
print(" with a proportion of" + str(GC))
if GC > 0.5:
print(" Your sequence is rich in GC")
else:
print(" Your sequence is poor in GC")
7 changes: 4 additions & 3 deletions week_0/ex_0_beginner/ex_0_beginner_runfile.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import this

print("\n"+"TYPE YOUR RESPONSE TO PROMPT 1 HERE")

print("\n"+"TYPE YOUR RESPONSE TO PROMPT 2 HERE")
print("1- Hi, my name is ilias SIMON, i'm a M2 student following the CARe graduate program.")
print("I wish to persue my career in biology with a phd and i found out how much developing", end="")
print(" and coding was important for several life-changing applications in this field.")
print("2- never i guess x)")
4 changes: 3 additions & 1 deletion week_0/ex_0_beginner/ex_0_beginner_submit.txt
Copy link
Owner

Choose a reason for hiding this comment

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

Please be sure that the beginner_runfile was able to be run. The "import this" line should produce a poem before the answer to your prompts is output. This is for me to ensure that your PyCharm is able to interpret Python code as it should. Please copy and paste the entire output from the runfile appearing on the console into the submit.txt file and resubmit. Thank you in advance.

Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
Copy and paste output of ex_0_beginner_runfile.py below:
1- Hi, my name is ilias SIMON, i'm a M2 student following the CARe graduate program.
I wish to persue my career in biology with a phd and i found out how much developing and coding was important for several life-changing applications in this field.
2- never i guess x)
3 changes: 2 additions & 1 deletion week_0/ex_0_intermediate/ex_0_intermediate_instructions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ Intermediate Homework Assignments (1.5 points):
and final cell counts and the time elapsed.
- Prompt the user to input the initial count, final count, and time.
- Calculate and display the growth rate using the formula: Growth Rate = (ln(final count) - ln(initial count)) / time.
- Ensure that the program handles invalid input gracefully.
- Ensure that the program handles invalid input gracefully.

20 changes: 19 additions & 1 deletion week_0/ex_0_intermediate/ex_0_intermediate_runfile.py
Copy link
Owner

Choose a reason for hiding this comment

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

Great effort on this part. I do, however, have some recommendations. There is a simpler way to determine if a variable that the user inputs is an int variable type (think first lesson on the first day), rather than iterating through a list of ALL possible integer values. Additionally, once the user's integer input has been validated, there are two other logical conditions that must be satisfied, which we will talk about next class, but feel free to implement in the meantime.

I will provide a final grade once this code is both 1) simplified and 2) takes into account the remaining numerical conditions.

Best of luck, and feel free to ask any questions using this platform.

Copy link
Author

Choose a reason for hiding this comment

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

Thank you very much for this surprinsingly quick correction,
I've made the adjustement you've suggested, but i'm really not familiar with this software, are you able to see it ?
Once again, thank you and have a good day.

Copy link
Owner

Choose a reason for hiding this comment

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

Nicely done with testing if the input is numerical in a more straightforward manner. Now the only thing left to do is ensure that the numerical input is both positive (as negative log will result in an error) and that the end number of cells is always greater than the beginning, as this is a measurement of exponential growth and not decay.

Copy link
Owner

Choose a reason for hiding this comment

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

Excellently done.

Score: 1.5/1.5

Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
#YOUR CODE FOR EX_0 INTERMEDIATE HERE
print("this program will calculate the Microbial Growth Rate based on your parameters, follow the instructions.")
while True :
start= input("Enter the number of cells at the beginning: ")
end= input("Enter the number of cells at the end: ")
time= input("enter the time between start and end: ")
valid = True
lst = [start,end,time]
for i in lst:
if i.isdigit():
valid= True
else:
valid= False
if valid:
break
else:
print("please enter a numerical value")
import math
Growth_rate= (math.log(int(end))-math.log(int(start)))/int(time)
print("This population of cells have a GR of " + str(Growth_rate))
17 changes: 16 additions & 1 deletion week_1/ex_1_advanced/ex_1_advanced_runfile.py
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, you will need to load the lines of each file into a dictionary with the reference numbers as keys, iterate through the dictionaries, and determine if the entry is identical or not, and if not provide a list of the differences in the strings. You have a good start here with reading in the files.

Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
#YOUR CODE FOR EX_1 ADVANCED HERE
#YOUR CODE FOR EX_1 ADVANCED HERE
def str_sup(file_name, str_suppressed):
with open(file_name,'r', encoding='utf-8') as file:
content= file.read()
content= content.replace(str_suppressed,'')
with open(file_name,'w', encoding='utf-8') as file:
file.write(content)
return f"string {str_suppressed} was removed from {file_name}"

file_name1= "references_1.txt"
file_name2= "references_2.txt"
str_space= " "
ref1= str_sup(file_name1, str_space)
ref2= str_sup(file_name2,str_space)
print(ref1)
print(ref2)
Loading