From 7b5e58a767e34fbac5f726ec586b1d523fbe512a Mon Sep 17 00:00:00 2001 From: Bianca Laker <frommer@cebitec.uni-bielefeld.de> Date: Fri, 21 Jun 2024 11:54:21 +0200 Subject: [PATCH] Update 12 files - /Exercises/Kopie_von_Python_course_2023_exercises_enumerate.ipynb - /Exercises/Python_course_2021_exercises_A.ipynb - /Exercises/Python_course_2021_exercises_D_part1.ipynb - /Exercises/Python_course_2023_exercises_B_loops.ipynb - /Exercises/Python_course_2023_exercises_B_part1.ipynb - /Exercises/Python_course_2023_exercises_C.ipynb - /Exercises/Python_course_2023_exercises_D_part2.ipynb - /Exercises/Python_course_2023_exercises_E.ipynb - /Exercises/Python_course_2023_exercises_F.ipynb - /Exercises/gap_exercise1_basics.ipynb - /Exercises/gap_exercise2_functions.ipynb - /Exercises/gap_exercise3_if_else.ipynb --- ...thon_course_2023_exercises_enumerate.ipynb | 1 - .../Python_course_2021_exercises_A.ipynb | 1 - ...Python_course_2021_exercises_D_part1.ipynb | 184 ------------ ...Python_course_2023_exercises_B_loops.ipynb | 1 - ...Python_course_2023_exercises_B_part1.ipynb | 201 ------------- .../Python_course_2023_exercises_C.ipynb | 1 - ...Python_course_2023_exercises_D_part2.ipynb | 49 ---- .../Python_course_2023_exercises_E.ipynb | 1 - .../Python_course_2023_exercises_F.ipynb | 1 - Exercises/gap_exercise1_basics.ipynb | 275 ------------------ Exercises/gap_exercise2_functions.ipynb | 1 - Exercises/gap_exercise3_if_else.ipynb | 1 - 12 files changed, 717 deletions(-) delete mode 100644 Exercises/Kopie_von_Python_course_2023_exercises_enumerate.ipynb delete mode 100644 Exercises/Python_course_2021_exercises_A.ipynb delete mode 100644 Exercises/Python_course_2021_exercises_D_part1.ipynb delete mode 100644 Exercises/Python_course_2023_exercises_B_loops.ipynb delete mode 100644 Exercises/Python_course_2023_exercises_B_part1.ipynb delete mode 100644 Exercises/Python_course_2023_exercises_C.ipynb delete mode 100644 Exercises/Python_course_2023_exercises_D_part2.ipynb delete mode 100644 Exercises/Python_course_2023_exercises_E.ipynb delete mode 100644 Exercises/Python_course_2023_exercises_F.ipynb delete mode 100644 Exercises/gap_exercise1_basics.ipynb delete mode 100644 Exercises/gap_exercise2_functions.ipynb delete mode 100644 Exercises/gap_exercise3_if_else.ipynb diff --git a/Exercises/Kopie_von_Python_course_2023_exercises_enumerate.ipynb b/Exercises/Kopie_von_Python_course_2023_exercises_enumerate.ipynb deleted file mode 100644 index 471a235..0000000 --- a/Exercises/Kopie_von_Python_course_2023_exercises_enumerate.ipynb +++ /dev/null @@ -1 +0,0 @@ -{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"provenance":[]},"kernelspec":{"name":"python3","display_name":"Python 3"}},"cells":[{"cell_type":"markdown","metadata":{"id":"9vv0rpCuGI-0"},"source":["# Python course 2023 - Exercises B\n","\n"]},{"cell_type":"markdown","metadata":{"id":"SL5Jk3GHIMLx"},"source":["## Part3 - range & enumerate"]},{"cell_type":"markdown","metadata":{"id":"A65Z5AeQIQrQ"},"source":["\n","\n","---\n","3.1) Write a script to print 50x \"here\" and the current value of the control variable!\n"]},{"cell_type":"code","metadata":{"id":"kwRdBZ5lIaWb"},"source":[],"execution_count":null,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"EXYM3E55Iaf4"},"source":["\n","\n","---\n","3.2) Write a script to walk through the species list and to print the character from the species where the index corresponds to the current control variable value!\n"]},{"cell_type":"code","source":[],"metadata":{"id":"nfCuF_1Drs5E"},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":["---\n","#Bonus tasks"],"metadata":{"id":"QRV4yKmJREPD"}},{"cell_type":"markdown","source":[""],"metadata":{"id":"viFn6bijRJvL"}},{"cell_type":"code","metadata":{"id":"xf1tPln-Im6w"},"source":[],"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":[""],"metadata":{"id":"B7QuZhYZRRDB"}},{"cell_type":"code","source":[],"metadata":{"id":"HBH3oFg0RRUM"},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":[""],"metadata":{"id":"z3kIlOvgRRdm"}},{"cell_type":"code","source":[],"metadata":{"id":"ROvaoUIaRRon"},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":[""],"metadata":{"id":"7y2BoakwRRze"}},{"cell_type":"code","source":[],"metadata":{"id":"s4SRZoueRR6C"},"execution_count":null,"outputs":[]}]} \ No newline at end of file diff --git a/Exercises/Python_course_2021_exercises_A.ipynb b/Exercises/Python_course_2021_exercises_A.ipynb deleted file mode 100644 index 5860d02..0000000 --- a/Exercises/Python_course_2021_exercises_A.ipynb +++ /dev/null @@ -1 +0,0 @@ -{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"name":"Python_course_2021_exercises_A.ipynb","provenance":[],"collapsed_sections":[],"authorship_tag":"ABX9TyOtXoTh9bpM3+wk3vCpa80j"},"kernelspec":{"name":"python3","display_name":"Python 3"}},"cells":[{"cell_type":"markdown","metadata":{"id":"D9wuSivclqKR"},"source":["# Python course 2021 - Exercises A"]},{"cell_type":"markdown","metadata":{"id":"8nq-mSErlstG"},"source":["## Part1 - Variables"]},{"cell_type":"markdown","metadata":{"id":"Dc_9QuyRmFB0"},"source":["\r\n","\r\n","---\r\n","\r\n","\r\n","1.1) Save 3.14159265359 in a variable of type float!"]},{"cell_type":"code","metadata":{"id":"t0cbYO8ymZZZ"},"source":[""],"execution_count":null,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"8GnX41irmahZ"},"source":["\r\n","\r\n","---\r\n","\r\n","1.2) Convert variable from float to integer!\r\n","\r\n","\r\n","\r\n"]},{"cell_type":"code","metadata":{"id":"IF5LB4a1mrIq"},"source":[""],"execution_count":null,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"Wpg5yXPMmx9S"},"source":["\r\n","\r\n","---\r\n","\r\n","1.3) Convert variable back! What happens?"]},{"cell_type":"code","metadata":{"id":"MKBxedZxm4Zz"},"source":[""],"execution_count":null,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"tadPKecSm4rq"},"source":["\r\n","\r\n","---\r\n","1.4) Convert variable type to string!\r\n"]},{"cell_type":"code","metadata":{"id":"1iqoYMyKm47q"},"source":[""],"execution_count":null,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"wpSIghwHm5Ej"},"source":["\r\n","\r\n","---\r\n","\r\n","1.5) Save 'Python' in a string variable!"]},{"cell_type":"code","metadata":{"id":"N7XlJWFbnGAz"},"source":[""],"execution_count":null,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"fBL218wOnGLa"},"source":["\r\n","\r\n","---\r\n","1.6) Convert variable type to float! What happens?\r\n"]},{"cell_type":"code","metadata":{"id":"jWenjrpGnLMi"},"source":[""],"execution_count":null,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"FB_ZFKiNnLVj"},"source":["\r\n","\r\n","---\r\n","\r\n","\r\n","1.7) What is a pitfall in regards to division when working with int/float?"]},{"cell_type":"markdown","metadata":{"id":"I4ZTk_1wnVYq"},"source":["---type your answer here (double click)---"]},{"cell_type":"markdown","metadata":{"id":"O5qjeyUhniCs"},"source":["## Part2 - Functions"]},{"cell_type":"markdown","metadata":{"id":"luO5CdEcnxrz"},"source":["Primer: 'ATGCCATGCATTCGACTACG'"]},{"cell_type":"markdown","metadata":{"id":"91zd9CgHn4f8"},"source":["\r\n","\r\n","---\r\n","\r\n","\r\n","2.1) Calculate length of primer and print it!"]},{"cell_type":"code","metadata":{"id":"k3FggWgun-cW","executionInfo":{"status":"ok","timestamp":1611064497629,"user_tz":-60,"elapsed":575,"user":{"displayName":"Katharina Sielemann","photoUrl":"","userId":"00960067943696917992"}}},"source":[""],"execution_count":1,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"vilS9kFun-o6"},"source":["\r\n","\r\n","---\r\n","\r\n","2.2) Get number of 'G's and print it!"]},{"cell_type":"code","metadata":{"id":"qTtPu44JoFWb"},"source":[""],"execution_count":null,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"RhxbY3ReoFeE"},"source":["\r\n","\r\n","---\r\n","2.3) Write a function to analyze the nucleotide composition of a primer and print it!\r\n"]},{"cell_type":"code","metadata":{"id":"hPT9ciehoNvl"},"source":[""],"execution_count":null,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"nxYFsZTfoN5y"},"source":["\r\n","\r\n","---\r\n","2.4) Is it a suitable primer? Why (not)?\r\n"]},{"cell_type":"markdown","metadata":{"id":"YNfwCwHxoT6S"},"source":["---type your answer here (double click)---"]}]} \ No newline at end of file diff --git a/Exercises/Python_course_2021_exercises_D_part1.ipynb b/Exercises/Python_course_2021_exercises_D_part1.ipynb deleted file mode 100644 index a39a3fc..0000000 --- a/Exercises/Python_course_2021_exercises_D_part1.ipynb +++ /dev/null @@ -1,184 +0,0 @@ -{ - "nbformat": 4, - "nbformat_minor": 0, - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "name": "python3", - "display_name": "Python 3" - } - }, - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "id": "xqfYLmi0LWEl" - }, - "source": [ - "# Python course 2023 - Exercises D" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "LRZcpmP8LaR_" - }, - "source": [ - "## Part1 - writing files" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "NDIaKYRcLfz1" - }, - "source": [ - "\n", - "\n", - "---\n", - "1.1) Read the file AtCol0_Exons.fasta and write all headers (starting with '>') into a new file!\n", - "\n" - ] - }, - { - "cell_type": "code", - "metadata": { - "id": "aO4lTjReLsDC" - }, - "source": [], - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "ddWzYDHlLsMN" - }, - "source": [ - "\n", - "\n", - "---\n", - "1.2) Read the file AtCol0_Exons.fasta and write the following:\n", - "* Line if it is a header\n", - "* Length of line if it is a sequence line\n" - ] - }, - { - "cell_type": "code", - "metadata": { - "id": "HAaoquFmL4jV" - }, - "source": [], - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "yvanoP6kL4rn" - }, - "source": [ - "\n", - "\n", - "---\n", - "1.3) Calculate the number of sequences, the cumulative length and the average length in a new file! Are they matching the values of the original file?\n" - ] - }, - { - "cell_type": "code", - "metadata": { - "id": "N5lQi7dyMEXf" - }, - "source": [], - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "L4KLtwRJMEgM" - }, - "source": [ - "\n", - "\n", - "---\n", - "1.4) Write sequences into a new file if their length is a multiple of 10!\n" - ] - }, - { - "cell_type": "code", - "metadata": { - "id": "_87Mx4EUMKw9" - }, - "source": [], - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "markdown", - "source": [ - "---\n", - "#Bonus tasks" - ], - "metadata": { - "id": "4o6oA4DP7uwk" - } - }, - { - "cell_type": "markdown", - "source": [ - "" - ], - "metadata": { - "id": "_6LzcB_k7st0" - } - }, - { - "cell_type": "code", - "source": [], - "metadata": { - "id": "PFLIHF017uDk" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "markdown", - "source": [ - "" - ], - "metadata": { - "id": "EZ4-T_6N-8cT" - } - }, - { - "cell_type": "code", - "source": [], - "metadata": { - "id": "t8CVqUIh-8kK" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "markdown", - "source": [ - "" - ], - "metadata": { - "id": "KWBePnj6_AkU" - } - }, - { - "cell_type": "code", - "source": [], - "metadata": { - "id": "_0AujN32_ArL" - }, - "execution_count": null, - "outputs": [] - } - ] -} \ No newline at end of file diff --git a/Exercises/Python_course_2023_exercises_B_loops.ipynb b/Exercises/Python_course_2023_exercises_B_loops.ipynb deleted file mode 100644 index 902223b..0000000 --- a/Exercises/Python_course_2023_exercises_B_loops.ipynb +++ /dev/null @@ -1 +0,0 @@ -{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"provenance":[]},"kernelspec":{"name":"python3","display_name":"Python 3"}},"cells":[{"cell_type":"markdown","metadata":{"id":"9vv0rpCuGI-0"},"source":["# Python course 2023 - Exercises B\n","\n"]},{"cell_type":"markdown","metadata":{"id":"69vKvpfXG1O0"},"source":["## Part2 - loops"]},{"cell_type":"markdown","metadata":{"id":"WmbSBvCGG6Fc"},"source":["\n","\n","---\n","2.1) Write a function counting to 100 and printing all numbers which can be divided by 4 without any residue!\n","\n","* Info: 10%2 #modulo division in Python\n"]},{"cell_type":"code","metadata":{"id":"N7JQLOS4HYIc"},"source":[],"execution_count":null,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"G3ocU6nnHYTp"},"source":["\n","\n","---\n","2.2) Write a function counting down from 1000 to 0 and printing all numbers!\n"]},{"cell_type":"code","metadata":{"id":"Zr_WTneeHgo4"},"source":[],"execution_count":null,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"F_k9KW4gHgwg"},"source":["\n","\n","---\n","2.3) Generate a list of species names! Write a function printing all species names starting with \"E\"!\n"]},{"cell_type":"code","metadata":{"id":"daVLjj-aHo_C"},"source":[],"execution_count":null,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"vC_BZDXZHpJA"},"source":["\n","\n","---\n","2.4) Expand this function to limit the printing to species names which are additionally shorter than 10 characters!\n"]},{"cell_type":"code","metadata":{"id":"BS1PycUwHydi"},"source":[],"execution_count":null,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"C0aWx374HykI"},"source":["\n","\n","---\n","2.5) Expand this function to limit the printing to species names which are additionally ending with \"a\".\n"]},{"cell_type":"code","metadata":{"id":"2dO2405CH8Ab"},"source":[],"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":["## Bonus Tasks"],"metadata":{"id":"yPaWe2M8BJED"}},{"cell_type":"markdown","source":[""],"metadata":{"id":"JoM_MDzSoUXF"}},{"cell_type":"code","source":[],"metadata":{"id":"0h2dsyL9oc-8"},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":[""],"metadata":{"id":"Bg_zLLp8BS7E"}},{"cell_type":"code","source":[],"metadata":{"id":"l-JCj49BBJLK"},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":[""],"metadata":{"id":"0-NJrMlIBJRK"}},{"cell_type":"code","source":[],"metadata":{"id":"xCUFlrt3BJWq"},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":[""],"metadata":{"id":"ojnBi6v_BJcL"}},{"cell_type":"code","source":[],"metadata":{"id":"xooDdNzEBJiS"},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":[""],"metadata":{"id":"Zl9UbZL6BJpD"}},{"cell_type":"code","source":[],"metadata":{"id":"zZ5U5KwTBsqK"},"execution_count":null,"outputs":[]}]} \ No newline at end of file diff --git a/Exercises/Python_course_2023_exercises_B_part1.ipynb b/Exercises/Python_course_2023_exercises_B_part1.ipynb deleted file mode 100644 index f512499..0000000 --- a/Exercises/Python_course_2023_exercises_B_part1.ipynb +++ /dev/null @@ -1,201 +0,0 @@ -{ - "nbformat": 4, - "nbformat_minor": 0, - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "name": "python3", - "display_name": "Python 3" - } - }, - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "id": "9vv0rpCuGI-0" - }, - "source": [ - "# Python course 2023 - Exercises B\n", - "\n" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "MmKoM-5LGKuq" - }, - "source": [ - "## Part1 - control structures" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "G7FusG7CGbta" - }, - "source": [ - "\n", - "\n", - "---\n", - "1.1) Write a script for guessing numbers!\n" - ] - }, - { - "cell_type": "code", - "metadata": { - "id": "scIcmdvJGjAe", - "colab": { - "base_uri": "https://localhost:8080/" - }, - "outputId": "488d171d-095f-403c-c47b-a743ea95cffb" - }, - "source": [ - "a = 3\n", - "b = input(\"Zahl eingeben: \")\n", - "\n", - "print(a + int(b))" - ], - "execution_count": null, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Zahl eingeben: 5\n", - "8\n" - ] - } - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "0q2YJKgCGjTT" - }, - "source": [ - "\n", - "\n", - "---\n", - "1.2) Add tips (smaller/larger) during the guessing process!\n" - ] - }, - { - "cell_type": "code", - "metadata": { - "id": "MATuLFxCGryV" - }, - "source": [], - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "markdown", - "source": [ - "\n", - "\n", - "---\n", - "BONUS TASK\n", - "1.3) Add additional tips (e.g. much smaller/ much larger) during the guessing process!" - ], - "metadata": { - "id": "OzCJMNL1_kYV" - } - }, - { - "cell_type": "code", - "source": [], - "metadata": { - "id": "mZhssDWR_kj6" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "markdown", - "source": [ - "# Repetition functions" - ], - "metadata": { - "id": "6zRrA2w--uwa" - } - }, - { - "cell_type": "markdown", - "source": [ - "---\n", - "" - ], - "metadata": { - "id": "_LHMfm_A-8ir" - } - }, - { - "cell_type": "code", - "source": [], - "metadata": { - "id": "FmdsEet_-7Tt" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "markdown", - "source": [ - "---\n", - "" - ], - "metadata": { - "id": "EXVyT2N__A-7" - } - }, - { - "cell_type": "code", - "source": [], - "metadata": { - "id": "lqnK6EMC_BQS" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "markdown", - "source": [ - "---\n", - "" - ], - "metadata": { - "id": "CnVBTJ60_B48" - } - }, - { - "cell_type": "code", - "source": [], - "metadata": { - "id": "kyrgOb8L_B_b" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "markdown", - "source": [ - "---\n", - "" - ], - "metadata": { - "id": "iVyw_qpT_CFL" - } - }, - { - "cell_type": "code", - "source": [], - "metadata": { - "id": "88TAQWrv_CK0" - }, - "execution_count": null, - "outputs": [] - } - ] -} \ No newline at end of file diff --git a/Exercises/Python_course_2023_exercises_C.ipynb b/Exercises/Python_course_2023_exercises_C.ipynb deleted file mode 100644 index 9407a30..0000000 --- a/Exercises/Python_course_2023_exercises_C.ipynb +++ /dev/null @@ -1 +0,0 @@ -{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"provenance":[]},"kernelspec":{"name":"python3","display_name":"Python 3"}},"cells":[{"cell_type":"markdown","metadata":{"id":"FyvebZ68I8BJ"},"source":["# Python course 2023 - Exercises C"]},{"cell_type":"markdown","metadata":{"id":"8PgJ1ymVJCIO"},"source":["## Part1 - file handling"]},{"cell_type":"markdown","metadata":{"id":"Ws7tJiEXJG8f"},"source":["\n","\n","---\n","1.1) Count number of sequences (number of headers) in AtCol0_Exons.fasta!\n"]},{"cell_type":"code","metadata":{"id":"JzgmMxR0JVxL","colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"status":"ok","timestamp":1693389015939,"user_tz":-120,"elapsed":29618,"user":{"displayName":"Hanna Schilbert","userId":"07980628394936741068"}},"outputId":"6171440b-1a73-4361-b76d-7bc9e547b8ef"},"source":["from google.colab import drive\n","drive.mount('/content/drive')"],"execution_count":1,"outputs":[{"output_type":"stream","name":"stdout","text":["Mounted at /content/drive\n"]}]},{"cell_type":"code","metadata":{"id":"oEJidIAEy8S5","executionInfo":{"status":"ok","timestamp":1693389207484,"user_tz":-120,"elapsed":1928,"user":{"displayName":"Hanna Schilbert","userId":"07980628394936741068"}}},"source":["datei = open(\"/content/drive/MyDrive/Python_Kurs_2022/Python_course_2021_data/AtCol0_Exons.fasta\", \"r\")\n","lines = datei.readlines()\n","datei.close()"],"execution_count":4,"outputs":[]},{"cell_type":"code","source":[],"metadata":{"id":"BivXzeSeKfje"},"execution_count":null,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"rFtHoz5UKujx"},"source":["\n","\n","---\n","1.2) Count number of sequence lines!\n"]},{"cell_type":"code","metadata":{"id":"AgMttuZlKyBg","executionInfo":{"status":"ok","timestamp":1693394043497,"user_tz":-120,"elapsed":304,"user":{"displayName":"Hanna Schilbert","userId":"07980628394936741068"}}},"source":[],"execution_count":5,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"YTH3rkjJKyNm"},"source":["\n","\n","---\n","1.3) Count number of characters in document! (How many per line?)\n"]},{"cell_type":"code","metadata":{"id":"6ECkHsa9K3-X"},"source":[],"execution_count":null,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"I9bkusUsK4HV"},"source":["\n","\n","---\n","1.4) How long are all contained sequences combined?\n"]},{"cell_type":"code","metadata":{"id":"XC4que0hK81W"},"source":[],"execution_count":null,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"5NnxagAWK9AP"},"source":["\n","\n","---\n","1.5) Calculate the average sequence length in this file!\n"]},{"cell_type":"code","metadata":{"id":"MZNV3sNqLB62"},"source":[],"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":["---\n","#Bonus tasks"],"metadata":{"id":"XUiTsblpKhoB"}},{"cell_type":"markdown","source":[""],"metadata":{"id":"3RiDSBshKsSn"}},{"cell_type":"code","source":[],"metadata":{"id":"C1c4doBCKh5m"},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":[""],"metadata":{"id":"RAc2gOq4KiBL"}},{"cell_type":"code","source":[],"metadata":{"id":"xD0AKVYZKiIa"},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":[""],"metadata":{"id":"ZolTetcNL-aj"}},{"cell_type":"code","source":[],"metadata":{"id":"GQFXWtleL-tp"},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":[""],"metadata":{"id":"4Dtg--cxL-17"}},{"cell_type":"code","source":[],"metadata":{"id":"U4OhFj6wL_BV"},"execution_count":null,"outputs":[]}]} \ No newline at end of file diff --git a/Exercises/Python_course_2023_exercises_D_part2.ipynb b/Exercises/Python_course_2023_exercises_D_part2.ipynb deleted file mode 100644 index c7eb021..0000000 --- a/Exercises/Python_course_2023_exercises_D_part2.ipynb +++ /dev/null @@ -1,49 +0,0 @@ -{ - "nbformat": 4, - "nbformat_minor": 0, - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "name": "python3", - "display_name": "Python 3" - } - }, - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "id": "oOKcgJ_eMTgE" - }, - "source": [ - "## Part2 - characters" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "MMM8BTO3MgXN" - }, - "source": [ - "\n", - "\n", - "---\n", - "2.1) Read the file AtCol0_Exons.fasta and write the following:\n", - "* Only Arabidopsis Gene Identifier (e.g. AT1G01010)\n", - "* Gene Identifier, exon name, exon length (tab-delimited)\n", - "\n", - "\n" - ] - }, - { - "cell_type": "code", - "metadata": { - "id": "oiHgx5jQMyNX" - }, - "source": [], - "execution_count": null, - "outputs": [] - } - ] -} \ No newline at end of file diff --git a/Exercises/Python_course_2023_exercises_E.ipynb b/Exercises/Python_course_2023_exercises_E.ipynb deleted file mode 100644 index 5530af2..0000000 --- a/Exercises/Python_course_2023_exercises_E.ipynb +++ /dev/null @@ -1 +0,0 @@ -{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"name":"Python_course_2021_exercises_E.ipynb","provenance":[],"collapsed_sections":[],"authorship_tag":"ABX9TyN8v5be18Xq9Ti6f0gcfKxW"},"kernelspec":{"name":"python3","display_name":"Python 3"}},"cells":[{"cell_type":"markdown","metadata":{"id":"pxY28jqUNT_M"},"source":["# Python course 2021 - Exercises E"]},{"cell_type":"markdown","metadata":{"id":"WGWSyndONVE2"},"source":["## Part1 - modules"]},{"cell_type":"markdown","metadata":{"id":"a1AOuxVxNYLV"},"source":["\n","\n","---\n","1.1) Write all AGIs of AtCol0_exons.fasta into a new file!\n"]},{"cell_type":"code","metadata":{"id":"8lRQbs47Ng1h","executionInfo":{"status":"ok","timestamp":1647801820916,"user_tz":420,"elapsed":5,"user":{"displayName":"Katharina Sielemann","photoUrl":"https://lh3.googleusercontent.com/a/default-user=s64","userId":"00960067943696917992"}}},"source":[""],"execution_count":null,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"kx5tqYs-Ng-z"},"source":["\n","\n","---\n","1.2) Some IDs occur multiple times. Add a filter step to reduce the results to unique IDs!\n"]},{"cell_type":"code","metadata":{"id":"_mh32ptqNq4a","executionInfo":{"status":"ok","timestamp":1647801820919,"user_tz":420,"elapsed":6,"user":{"displayName":"Katharina Sielemann","photoUrl":"https://lh3.googleusercontent.com/a/default-user=s64","userId":"00960067943696917992"}}},"source":[""],"execution_count":null,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"B03_0srPNrA8"},"source":["\n","\n","---\n","1.3) Calculate the frequency of each AGI and construct a histogram (matplotlib)!\n","```\n","plt.hist(<list_of_values>) #tip\n","```\n","\n","\n"]},{"cell_type":"code","metadata":{"id":"dx5WtRZeOFm5"},"source":[""],"execution_count":null,"outputs":[]}]} \ No newline at end of file diff --git a/Exercises/Python_course_2023_exercises_F.ipynb b/Exercises/Python_course_2023_exercises_F.ipynb deleted file mode 100644 index 056cc86..0000000 --- a/Exercises/Python_course_2023_exercises_F.ipynb +++ /dev/null @@ -1 +0,0 @@ -{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"name":"Python_course_2021_exercises_F.ipynb","provenance":[],"collapsed_sections":[],"authorship_tag":"ABX9TyMrKbpipzB2ofTkmux8rheE"},"kernelspec":{"name":"python3","display_name":"Python 3"}},"cells":[{"cell_type":"markdown","metadata":{"id":"C6hjQZrrO1lx"},"source":["# Python course 2021 - Exercises F"]},{"cell_type":"markdown","metadata":{"id":"RoMsf4tCO3CA"},"source":["## Part1 - DNA, RNA and peptide sequences"]},{"cell_type":"markdown","metadata":{"id":"3_wMYLkSPBrx"},"source":["\r\n","\r\n","---\r\n","1.1) Write a function to get the reverse complement (upper case letters) of a DNA sequence given in upper case letters!\r\n"]},{"cell_type":"code","metadata":{"id":"Uq70MpOBPMpe"},"source":[""],"execution_count":null,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"trElcFlcPMzg"},"source":["\r\n","\r\n","---\r\n","1.2) Write a function to convert a DNA sequence into a RNA sequence!\r\n"]},{"cell_type":"code","metadata":{"id":"ahMEGCWTPUAY"},"source":[""],"execution_count":null,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"EOMgpzlnPUJ6"},"source":["\r\n","\r\n","---\r\n","1.3) Write a function to translate a DNA sequence into amino acids (first frame only)!\r\n","* Tip: [wiki - codon tables](https://en.wikipedia.org/wiki/DNA_and_RNA_codon_tables)\r\n"]},{"cell_type":"code","metadata":{"id":"aFVhE4KEPrM4"},"source":[""],"execution_count":null,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"3-KHtLeePsQ4"},"source":["\r\n","\r\n","---\r\n","1.4) Write a function to translate DNA sequences in all 6 frames into peptide sequences! The longest peptide sequence per DNA sequence should be returned!\r\n"]},{"cell_type":"code","metadata":{"id":"s50AlgALP8I3","executionInfo":{"status":"ok","timestamp":1610969544596,"user_tz":-60,"elapsed":1163,"user":{"displayName":"Katharina Sielemann","photoUrl":"","userId":"00960067943696917992"}}},"source":[""],"execution_count":4,"outputs":[]}]} \ No newline at end of file diff --git a/Exercises/gap_exercise1_basics.ipynb b/Exercises/gap_exercise1_basics.ipynb deleted file mode 100644 index e0ade9b..0000000 --- a/Exercises/gap_exercise1_basics.ipynb +++ /dev/null @@ -1,275 +0,0 @@ -{ - "nbformat": 4, - "nbformat_minor": 0, - "metadata": { - "colab": { - "name": "gaps_exercises1.ipynb", - "provenance": [], - "collapsed_sections": [] - }, - "kernelspec": { - "name": "python3", - "display_name": "Python 3" - }, - "language_info": { - "name": "python" - } - }, - "cells": [ - { - "cell_type": "markdown", - "source": [ - "# Python course - Exercises Gap text" - ], - "metadata": { - "id": "kH0p2uT-sQ6y" - } - }, - { - "cell_type": "markdown", - "source": [ - "Correct the Code" - ], - "metadata": { - "id": "uW9SoYEyrlRL" - } - }, - { - "cell_type": "code", - "source": [ - "# What is missing here? Expected output: Hi!\n", - " ('Hi!')" - ], - "metadata": { - "id": "Qflb9AWfrykh" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "# Here are two mistakes. Can you find them?\n", - " Hi! I am a comment. How are you?\n", - "\n", - " print('Hello world!')" - ], - "metadata": { - "id": "eemU0jTksxu5" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "# Multi-line comments\n", - "\n", - "I want to be a\n", - "mutli line comment.\n", - "\"\"\" \n", - "print('Hello world!')" - ], - "metadata": { - "id": "2ysNg9wDtaZ9" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "# Expected output: 5\n", - "c = 5 \n", - "print( )" - ], - "metadata": { - "id": "Vexbuvx1u1NS" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "# How to print two strings as one. Expected output: Hello world\n", - "a = 'Hello'\n", - "b = 'world'\n", - "print( a b )" - ], - "metadata": { - "id": "cGTJ95-9wzLT" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "# Variable types\n", - "# Does the error output help you?\n", - "a = 'Hello'\n", - "b = 0 \n", - "print( a + b )" - ], - "metadata": { - "id": "6QiU3l2_xFnP" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "# What is missing?\n", - "a = 'Hello'\n", - "b = a\n", - "\n", - "if a == b:\n", - "print('Same!')" - ], - "metadata": { - "id": "_YtGF9xqzFoR" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "# Print the variable type\n", - "# Expected output: a is of type <class 'str'>\n", - "a = 'How are you?\n", - "print('a is of type', (a))" - ], - "metadata": { - "id": "wH0ifA4czyDV" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "# Variable names: What is allowed and what not?\n", - "_1th_string = \"Hello\"\n", - "second_string = 'world'\n", - "3rd_string = '!'\n", - "FOURTH_STRING = 'How'\n", - "FIFTH STRING = 'are'\n", - "_6th-string = 'you?'\n", - "\n", - "print(_1th_string, second_string, \n", - " 3rd_string, FOURTH_STRING,\n", - " FIFTH STRING, _6th-string\n", - " )" - ], - "metadata": { - "id": "Spcu5lGc0Uv9" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "# convert b into float\n", - "a = 2\n", - "b = (a)\n", - "print(b)" - ], - "metadata": { - "id": "_TcdURMh2yJZ" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "# How to access Lists?\n", - "my_list = [\"!\", \"Hello\", 'you', \"How\", '?', 1, 'are', 2, 3, \"world\"]\n", - "print(my_list)\n", - "print(my_list[ ]) # print '!'\n", - "print(my_list[ ]) # print 'Hello'\n", - "print(my_list[ ]) # print the last element of a list without the real index; here 'world'\n", - "### print 'Hello world! How are you?':\n", - "print(my_list[ ], my_list[ ] ,my_list[0] ,my_list[ ] ,my_list[ ] ,my_list[ ], my_list[4])" - ], - "metadata": { - "id": "5VripGXYxBf8" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "# Indices of Strings\n", - "a = 'Hello world!'\n", - "print(a[ ]) # only print !\n", - "print(a[ ]) # only print H\n", - "print(a[ ]) # only print 'world', without '!'" - ], - "metadata": { - "id": "V3VJP2gg1HLT" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "# Dictionaries\n", - "my_dict = { 'chr1' : 'gene1', 'chr2' : 'gene3' }\n", - "print(my_dict[ ]) # print gene1 of the dictionary" - ], - "metadata": { - "id": "6e6KYBcQ0qa3" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "# Dictionaries2; Find the mistake\n", - "my_dict = { 'chr1' : 'gene1', 'chr1' : 'gene3' }\n", - "print(my_dict[ ]) # print gene1 of the dictionary" - ], - "metadata": { - "id": "44dxJxK2bR2n" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "# Dictionaries3\n", - "my_dict = { 'chr1' : ['gene1', 'gene2'], 'chr2' : 'gene3' }\n", - "print(my_dict[ ][ ]) # print gene2 of the dictionary" - ], - "metadata": { - "id": "RdIWfnVsbpVF" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "# Booleans\n", - "a = 0\n", - "b = 1\n", - "print(bool( )) # print True; insert the right variable\n", - "print(bool( )) # print False; insert the right variable" - ], - "metadata": { - "id": "PrmB8FZD0-PQ" - }, - "execution_count": null, - "outputs": [] - } - ] -} diff --git a/Exercises/gap_exercise2_functions.ipynb b/Exercises/gap_exercise2_functions.ipynb deleted file mode 100644 index e2bd289..0000000 --- a/Exercises/gap_exercise2_functions.ipynb +++ /dev/null @@ -1 +0,0 @@ -{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"name":"gap_exercise2_functions.ipynb","provenance":[],"collapsed_sections":[],"authorship_tag":"ABX9TyPNmMiCfZgG80utvjFwmIDH"},"kernelspec":{"name":"python3","display_name":"Python 3"},"language_info":{"name":"python"}},"cells":[{"cell_type":"markdown","source":["# Python course - Exercises Gap text"],"metadata":{"id":"kH0p2uT-sQ6y"}},{"cell_type":"markdown","source":["Correct the Code"],"metadata":{"id":"uW9SoYEyrlRL"}},{"cell_type":"code","source":["# How are functions defined?\n"," my_function(b):\n"," print(b+10)\n","\n","a=5\n","my_function(a)"],"metadata":{"id":"uoscfCSCK980"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["# What is missing?\n"," concat_sequences( seq1, seq2, seq3 ):\n"," print(seq1 + seq2 + seq3)\n","\n","concat_sequences('ACGTC', 'GTCAA')"],"metadata":{"id":"VI2uTjtJMZ-L"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["# correct the code such that the function delivers b+10\n"," my_function(b):\n"," (b+10)\n","\n","result = my_function(5)\n","print( result)"],"metadata":{"id":"GN89HlxMJRAQ"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["# undefined number of arguments: what is needed?\n"," concat_sequences( seq ):\n"," print(seq[0] + seq[1] + seq[2])\n","\n","concat_sequences('ACGTC', 'GTCAA', 'TAGCTGC')"],"metadata":{"id":"UOsFUQSHKGXH"},"execution_count":null,"outputs":[]}]} \ No newline at end of file diff --git a/Exercises/gap_exercise3_if_else.ipynb b/Exercises/gap_exercise3_if_else.ipynb deleted file mode 100644 index 992801c..0000000 --- a/Exercises/gap_exercise3_if_else.ipynb +++ /dev/null @@ -1 +0,0 @@ -{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"name":"gap_exercise3_if_else.ipynb","provenance":[],"collapsed_sections":[],"authorship_tag":"ABX9TyNhlv7wY42fK2OkTGqTWan3"},"kernelspec":{"name":"python3","display_name":"Python 3"},"language_info":{"name":"python"}},"cells":[{"cell_type":"markdown","source":["# Python course - Exercises Gap text"],"metadata":{"id":"kH0p2uT-sQ6y"}},{"cell_type":"markdown","source":["Correct the Code"],"metadata":{"id":"uW9SoYEyrlRL"}},{"cell_type":"code","source":["# complete the statement for b larger than a\n","a = 5\n","b = 10\n","\n"," b a:\n"," print('b larger a')"],"metadata":{"id":"uoscfCSCK980"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["# complete the statements\n","a = 5\n","b = 10\n","c = 5\n","\n"," (a b) (a c):\n"," print('a smaller b, but a equals c')"],"metadata":{"id":"9DGKzqxWdABE"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["# complete the statements\n","a = 5\n","b = 10\n","c = 5\n","\n"," a c:\n"," print('a smaller or equal c')\n"," a b:\n"," print('a larger or equal b')"],"metadata":{"id":"3ipcaNRCdv9S"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["# complete the statements\n","a = 5\n","b = 10\n","c = 5\n","\n"," a c:\n"," print('a not c')\n"," a b:\n"," print('a equals b')\n","\n"," print('None of the above is true')"],"metadata":{"id":"w9QBlM8Hel_u"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["# complete the statements\n","a = 5\n","b = 10\n","c = 5\n","\n"," (a c) (b c):\n"," print('a not c OR b not c')\n"," \n"," print('None of the above is true')"],"metadata":{"id":"5KfDsRHLfW7k"},"execution_count":null,"outputs":[]}]} \ No newline at end of file -- GitLab