diff --git a/README.md b/README.md index 95e1963..6813a6e 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,12 @@ Materials for the course run by the Graduate School of Life Sciences, University - Course website: http://pycam.github.io/ - Booking website: http://www.training.cam.ac.uk/ +## Links for next course running on 28th & 29th Jun 2018 at E-learning Suite, School of Clin. Med. + +- [A Course Etherpad (a type of electronic whiteboard)](https://etherpad.net/p/28062018_Python_intro_course) +- [Please give us feedback on this course](https://www.surveymonkey.co.uk/r/PythonUC) +- [Details and booking](http://www.training.cam.ac.uk/event/2589506) + If you wish to run the course on your personal computer, here are the steps to follow to get up and running. diff --git a/data/SP1.fq b/data/SP1.fq new file mode 100644 index 0000000..0a921c4 --- /dev/null +++ b/data/SP1.fq @@ -0,0 +1,1000 @@ +@cluster_2:UMI_ATTCCG +TTTCCGGGGCACATAATCTTCAGCCGGGCGC ++ +9C;=;=<9@4868>9:67AA<9>65<=>591 +@cluster_8:UMI_CTTTGA +TATCCTTGCAATACTCTCCGAACGGGAGAGC ++ +1/04.72,(003,-2-22+00-12./.-.4- +@cluster_12:UMI_GGTCAA +GCAGTTTAAGATCATTTTATTGAAGAGCAAG ++ +?7?AEEC@>=1?A?EEEB9ECB?==:B.A?A +@cluster_21:UMI_AGAACA +GGCATTGCAAAATTTATTACACCCCCAGATC ++ +>=2.660/?:36AD;0<14703640334-// +@cluster_29:UMI_GCAGGA +CCCCCTTAAATAGCTGTTTATTTGGCCCCAG ++ +8;;;>DC@DAC=B?C@9?B?CDCB@><90;?150 +@cluster_36:UMI_AACAGA +TCCCCCCCCCAAATCGGAAAAACACACCCCC ++ +5?:5;<02:@977=:<0=9>@5>7>;>*3,- +@cluster_37:UMI_GAGGAG +GTCTTTGTACAAAATTTTATTAAAGGTCTTT ++ +?B?DEC@A=?ADDAEEEC?EC@D6A@@>DE4 +@cluster_39:UMI_GAACCG +CCTTCCATCACCAGATCGGAAAAACACACGC ++ +00>7;8@5<192?/8;0;;>=3=/3239713 +@cluster_43:UMI_GGATTG +GAGTTATAATCCAATCTTTATTTAAAAATCT ++ +>=AEC?C@;??0A>?0DEB9EEB@DDC1?=6 +@cluster_53:UMI_GTGGGG +GGAAAATGAAAATGTTGGATGAGAACAATTA ++ +<>=CCA@A8>?=86AB@>0?76<993=@=7. +@cluster_55:UMI_CTAATG +AGACAAAAGGATTTATTTGGAAATTTCCAAA ++ +===>7DD?A>;EEC?EECB>?DAEEB?AAC3 +@cluster_58:UMI_GTTTTG +AAAGCAATCCACAGAAGGGCATTTCTACCGA ++ +@D?B:AA??=;>?=@?A=@:@EEB?A=@<@< +@cluster_62:UMI_CCTTGC +GAGTTGCGACAATACTCTCCCCCGAGACCCA ++ +9/96C1954/12?=7=?5::94,40125442 +@cluster_63:UMI_TTTCCC +GCAACCATACTCCCCCCGGAACCCAAAGACT ++ +@:A@@A@C=@;@?@C=?:=<<<:===@?=83 +@cluster_82:UMI_TTTTTG +GCTTATGTTTTATAAAAATAAGTTGCCCCAG ++ +75;6>>>>DEC7?6CC>A=9=>@C1<<9>12 +@cluster_83:UMI_CCAGTC +CTCCCACAGTTCTGCGCCAGAGCGGAAGAGC ++ +=:?*>4>;>66;C:612661<2322141=:- +@cluster_87:UMI_TGACAC +GGTTGAGCACAGGGTACTTTATTGATGGTAC ++ +=@E@B=B::;;A=?A=9DEB9ECB8?B@@97 +@cluster_88:UMI_TGCCGA +TCACTACCTCCCCGGGTCGGGAGTGGGGTAT ++ +/@=>@=@,75<:593=7 +@cluster_90:UMI_ACGGGG +TTTTTTTGTGAAGGAGTCTTTCCCCCCAGAC ++ +CEEEEDB96203:8+01.3353/897?.+,0 +@cluster_93:UMI_ATTGTA +TCCTCACTATCTGATTCCTCCCCAGATCGGA ++ +;9=BA=?@@AB::A??A@?DEC?ECB@D?A>=C?A;9 +@cluster_98:UMI_CTTTGG +AGTTCCCCCCCCTATATCGAAAAACACACCC ++ ++670.98;.+460.1533=09;3481/14*3 +@cluster_99:UMI_CAACAA +TTTGTTTTTTTTTTTTCCACCCCCACATGGA ++ +?==A@?C:?C@A=EC7>;;<<7 +@cluster_107:UMI_TCCATG +ATCGGAAGAGCACACGTCTGAACTCCAGTCA ++ +?<=9;59:6<@?>C<99=D79@?3@/>7A7;B3.8C?@>.4C5><;;9A23 +@cluster_126:UMI_CATGAA +CCCCCCCAGATCGGAAAAGCACACGCCTGAA ++ +?.:8<;??=6?==>?:6><0;165B35;66: +@cluster_130:UMI_GTAGGG +GGTAGAGATAGGGTCTTGCTATGTAGCCCAG ++ +4@:<=8=;B69;@9<9=:?87@:B:8.293; +@cluster_131:UMI_AGTGTA +GTGAGCACAGGGTACTTTATTGATGGTACAT ++ +;AB=B::>4:<@57=654187B;B:=4;9?9 +@cluster_134:UMI_TAGTGA +TGTTAGACAAAATAAATGTATTTTTTCACTC ++ +1/32++,2668/1/5/<14/69A=@62*-40 +@cluster_137:UMI_ACGGAC +GCAAATATAAACAGGTTTATCTATTCTGTCT ++ +9)75?C?:@6=36:6D@DDD?53==@;85 +@cluster_148:UMI_GCCTGG +CATACCCCCCCCAGATCGGAAAAACACACGC ++ +9@C=@47;;9?C;D3><:=?32 +@cluster_149:UMI_CGGCGC +GCCACTATATCTCAAGCATTAAAATACATGT ++ +3=7,.0>6287<2@47/4=5/;<62,38:18 +@cluster_152:UMI_TCGAAA +GCTGTCTAGTCATCCTCGTCGGTCTTCTGCT ++ +B?C@B?A=ABA@??>D=@B==@B?DB?C:?D +@cluster_153:UMI_TACAAA +TTTTTTTTACACTTTATAACACACTTTTTAT ++ +EEEEEEE3995.6E848@?>=;=3:EEE3/9 +@cluster_159:UMI_CGGGGG +GTCTGCACAGATAAATCTTTCTTCTCATTAC ++ +4:7<+*-/0.,3@B300=;41=3=20=9;-2 +@cluster_162:UMI_AACGGG +CCACAACATTCCATTTATACACAGAACTAAA ++ +>A=?A@?@EB?A@EEC?C=?=??=@@?A@D4 +@cluster_164:UMI_GCTGAG +TATTTTTTTTTTTTTTTTTTTTTTTTGTGTG ++ +??E7EEECEEDEEEECEEEEEEEED20101* +@cluster_165:UMI_AGTCGC +TTGGCTCTTTTTCGTTTATTGCATGCCCCCC ++ +CC:?B>2::B082,9*/ +@cluster_169:UMI_TGAGCC +AAAAATGCCTGGAAATCACTTGCTAGTTACA ++ +ADCB>CB>@DA?A9?DB:?A=AEC=>3 +@cluster_172:UMI_GTTTCC +GGCTTTGCAACCATACTCCCCCCGGAACCCA ++ +=@?DEC::A@@A@C=?D?<<<<==>@@@:>9.6140DC5@68EC70=65E3 +@cluster_186:UMI_GGGTAG +CCTTTCCTTTCCCCCAGATCGGAAGAGCACA ++ +>>DEB?>DEB?8<@?:=B:=== +@cluster_189:UMI_GCCTTG +TTGGTATATAAACTATTTATTAACAGACAAG ++ +ECB@C?C?C@D??@?EEC9EC@@>?==>A=B +@cluster_190:UMI_GGCGGA +CAAATCAATAGGTCTTTTATTGCATCATTTA ++ +?AA??AAAC=?@B?DEDB>EC::@?A@EEC= +@cluster_197:UMI_AGGATG +GGCATATGAAAATTTATTACTACAGTGTTTT ++ +=@:@C?BB@DDAEEC?@C=?A=??AA@DEE= +@cluster_207:UMI_TGAACA +GTTTCCCCCCCCAAATCGGAAAAACACACCC ++ +;=B:9/193993=>?:88=694;555767+, +@cluster_211:UMI_ACTGGC +CCCCCCCCAAATCGGAAAAACACACCCCTAA ++ +<<<<<<@DDC??=?=@<;>@@? +@cluster_215:UMI_TCAAAC +TCCCCCCCAAATCGGAAAAACACACCCCTAA ++ +3?<<<<@DDD@?=?=@<<>A<= +@cluster_216:UMI_TATTCC +GCTTTGCAACCATACTCCCCCCAAGATCGGA ++ +<>D87:-A9@::>;;9?;;<<@14;2;/=.9 +@cluster_217:UMI_CTCGGC +CTAAACTTTTATTGAAAAAAAAACCGAGGAG ++ +>A@D@?DEEC?ECB@DDDDDDD?@=@=A>=B +@cluster_218:UMI_TGCTCC +CCCCCCCAAAATCGGAAAAACACACCCCTAA ++ +;;;<<;1/7>=?2=;@DDB?C@EEB?DEEEB?<@?==B58 +@cluster_229:UMI_CAAGTA +GAGGTTTGCAGCTATTTTATTTACAAGTATA ++ +==A@EEC::?B?A?EEEC?EEC=?A?AB?C= +@cluster_232:UMI_TGTTCC +TCCCCCCCCCAAATCGGAAAAACACACCCCC ++ +D?<<<<<<@DDD@?=?=@:<5+ +@cluster_238:UMI_AGGTTG +GCTTCCTACTTTTCAGGTTTAAATTTATCTT ++ +@?DB?>@=?DEEB@?A@CEC@DAEEC???DB +@cluster_241:UMI_CTCTCA +CAACTTTCCCTTACCCCAGATCGGAAGAGCA ++ +?A@?DEB?<>DC=@<@?==B:< +@cluster_248:UMI_TTTTTG +TAGGAAAAAATGGTTTTGGACATGGGATGAA ++ +8=A>2DDDBABA@9@:BB=>7BA7; +@cluster_252:UMI_CAAAAG +TACCTTTGAGACAGAGTCTCGCTCTGTCACC ++ +B=@>DECB==:=;==AB?D=B?D?C@BA=@; +@cluster_253:UMI_GCGCTC +TCGTCACTACCTCCCCGGGTCGGGAGTGGGG ++ +D=@BA=?A<@>D?<<===@B===>=?>B1:2 +@cluster_254:UMI_TGTGCC +TAATGTGCTACTTTTAATTTATTAAAATCCC ++ +A@AB@A:?A=?DEEC@AEEC?E;@DDA??<< +@cluster_256:UMI_AGACAG +CCGTGATCCTTTTTCAGTGCTTCTACAATGC ++ +>=@ABDEEEBA?AA:?DB?A=?AAB:> +@cluster_258:UMI_TGCGGC +GTTTGTTTTTTTTTTTTTCCCAGATCGGAAG ++ +>BEC;EEEEEEEEDEEC48-543197=>?.2 +@cluster_265:UMI_AATTTG +TACCCCACCCAAATCGGAATAACACACCCAC ++ +@5?0<;7;845773245>:1<38,1-6*8,/ +@cluster_272:UMI_ACTCGA +AACTTGACACCTTTAAAATAGCATTAAACAG ++ +D72D>?<==1=4EC3DD24/4.@8C1D0/48 +@cluster_273:UMI_TCGAAA +GGTTTTCCTTTTTATTTAATCAAAGACTGGT ++ +A@EEEB?>DEEEC?EEC@A?AAD?=+?CB@8 +@cluster_281:UMI_CCGATA +TAGTCTTAGCATTTACTTTCCCCCCAGATCG ++ +B=A>?DC=B:@EE@=>DEB?<;<<@?=<=8B +@cluster_286:UMI_CGGTGC +AACAATGATCAATTTTAAGAAATGGGTACAT ++ +A@>AABB@/ +@cluster_287:UMI_GGATGC +GGACATAATAATAACAATTGAATGTCTGCAC ++ +=>=?@C@AC@AC@@?AAECB@AB@B?C:::?:AAB@?==>@DDC??66:?8;>@2 +@cluster_290:UMI_TTCCCC +ACTTTTGAGACAGGGTCTTGCTCTTGCTATG ++ +=?DEECB===?>A=@B?DC:?D?DC:?A?B: +@cluster_293:UMI_CGCACC +ATCACTTCTATCAAAGATTGCTCTATTATCT ++ +@?A=?DB?A??;AD?=9:D +@cluster_295:UMI_TCGGGG +CTTGGTACATGATTTTATAGCAAGCACATTT ++ +?DCB@C=?@BB1=5B=37)2 +@cluster_298:UMI_TTGACA +GTCAAATATTTATTGAATGGTGGAAAACCAT ++ +/AAADAC>EEC?ECB@ABB@=B>@DD@@=?: +@cluster_299:UMI_ATCGCC +GCCCCCCCCCAAATCGGAAAAACACACCCCC ++ +?>;;;;<;;?@AA>==>@CCC=;<>7;095+ +@cluster_301:UMI_GCGGGC +GGCTTTGGGAAGCCCCGCGGGGGACCGGCAC ++ +6@>;E4B=-:.1<<;,4429==>,/6-?)24 +@cluster_302:UMI_TCGGCC +TTGCTACTACCACCAAGATCCCCAGACCGGA ++ +?>3=5,-25<74766=,34<;:20,/254.2 +@cluster_303:UMI_AGTCAA +GTCAAAAGAAAAGCGTTTATTTAAAAAAATC ++ +0100CD0745B.2/04DC3C462;DDD6A=1 +@cluster_309:UMI_TTTCAA +ATAGTTTAATGTATTTTAATAGCAAACTTAC ++ +AC=ADEC@AB@C>EEEC@=C;B:@C9>DB=? +@cluster_310:UMI_TAAACC +CTTATCATTTTAATCGATTTTAATGATTATT ++ +=DC??A@EEEC@A?=@31=A:C?C@A??@?>A>5 +@cluster_321:UMI_AGAGGA +TTGACGACCGCGCCATGCTGTAATATACAAC ++ +8?9:10+/2:240/.1)59/1/3599-/000 +@cluster_323:UMI_CAGAGC +CCCTTTTTCCCCCAGATCGGAAAAACACACC ++ +<<8DEEEA?<<<6?=. +@cluster_330:UMI_TACCGC +GAGATGGAGTCTTCTCTCAGATCGGAAGAGC ++ +>0=-AA<::1-5?75:3473454.576-:90 +@cluster_337:UMI_TTCCCG +CCTTCCTATTTATTGCCCAGATCGGAAGAGC ++ +1986:DEEEEEEEEEEEEEEEEEEEEEEEEEEEEB +@cluster_344:UMI_GAGGTG +CTTTTCCTCCGCTGCCCAGATCGGAAGAGCA ++ +?DEEB?>D?=B?C:>@?==B:: +@cluster_347:UMI_ATCAAC +GACTGAACTAAGTGGTTTTTTTATTAGAGAA ++ +>=?CB@@>A@>AAB85EEDEEC?EB<==9?5 +@cluster_349:UMI_CTATGA +CAGCTTTGCAACCATACTCCCCCCGGAACCC ++ +??B?DEC::A@@A@C=?D?<<<<==>@@@;0 +@cluster_351:UMI_TGTTAG +CTGACTAATATGCCCCAGATCGGAAAAGCAC ++ +?CB=?A@AC?B:><@DA?B:=7 +@cluster_357:UMI_CGCTCA +GAGATTTTAATTAATTTTTATAAAATCTGAG ++ +===A==@D@??=@AC=AB?DEC=?DEEC=?C: +@cluster_362:UMI_TTATAA +CTTCTTTCCTGTTTTTTTTAAAATCCTTCTT ++ +?DB?DEB?>C@>BDD>CEC@DDA??>DB?=6 +@cluster_367:UMI_GAGGTG +CCCCCCCCCAAATCGGAAAAACACACCCCTA ++ +><<<<<<@DDD@?=?=@<;>A= +@cluster_368:UMI_GGGCGA +TAGGTTTTTCAGTGTATTGCTTTGAGGACCC ++ +;=A@CBEE@A?A@>@?E=9>6:B>661=@,1 +@cluster_373:UMI_ACTGCA +CAACTATTTAAAAACGTAAAAACTATTCTTA ++ +=A??A?EEC@DDD??@C@DDD??A9EB?6:5 +@cluster_375:UMI_ATCCGG +CCCCCTCCCCAAATCGGAAAAACACACCCCT ++ +=;<;=D?;;:A?@<==>@C?C9>;?:@0862 +@cluster_376:UMI_AAGCAC +TCTTTGTACAAAATTTTATTAAAGGTCTTTA ++ +9:CDC@<<EEE8:E2@D7A@2>DD:5 +@cluster_381:UMI_GGAACA +GAGACGGAGTCTCGCTCTGTTGCCCCCAGAT ++ +;===?=>=AB?D=B?B?>@DC:><<>DEECB@D@@AADAC?EEC@AC?EEEB? +@cluster_388:UMI_GCGGGC +TCTTCCTCTTCTTTCTCCCCAGATCGGAAGA ++ +C?DB?>D?DB?DEB?D?<@?== +@cluster_389:UMI_AATTCC +TTGCAACCATACTCCCCCCGGAACCCCCCAG ++ +CC:7A?5=3B:?>?<<<;;0.0995;;;721 +@cluster_390:UMI_CGGTGG +AGACAGAATTTCGCTCCTGTAGCCCCCCAGA ++ +=<<:?=@C?=C?77;<7;926?2: +@cluster_391:UMI_TCTATA +GTTCATTTTGCCATGACTAAGCCACTATAAA ++ +AEBA@EEEC6>A@BB=?A@?B>A=?A?C@D? +@cluster_399:UMI_CAAACA +CTTTCTCCAGTTGTTCCCAGATCGGAAGAGC ++ +9DE@?C?A?AEC@EDEEC?EC:9A@?9 +@cluster_406:UMI_AACGGC +AGATGGAGTCTCGCTCTGTCGCCCAGGCTGG ++ +?==AB?D=B?D?C@B=B>=?CB@>A=??==B?@EE;AB?DC:?D?C@EC:> +@cluster_428:UMI_GGACCG +CCTTTTCCTTTCTCTTTTTTTTCTTTAGTGT ++ +>>DEEB?>DEB?D?DEEEEEEB?DEC=AA@? +@cluster_434:UMI_CGTCAC +GACAGTCTCACTTGGTCACCCCCCAGATCGG ++ +@=??AB?DA=?DCB@BA=@<<<.47==A@C=?D9:;;<==>7?<;@9 +@cluster_438:UMI_CCGTAA +AAAGTTCAGCTTTTTATTGAACATGTTATAA ++ +DD?AEBA?B?DEEEC?ECB@@?@B@EC?C@@ +@cluster_441:UMI_GCATAG +GCTCTAGAGGGGGTAGAGGGGGTGCTATAGG ++ +@?D?A===A===@C===A===@A:?A?C=A@ +@cluster_444:UMI_ATAGAA +TGGTACCCCCCCAAATCGGAAAAACACACCC ++ +BB@?=@<<<<;AAAA?==>@DDD??=?=@<; +@cluster_448:UMI_GAGAAC +GGAAATAAAAGCACAACTATATTTGGGCACC ++ +=>@DAC@AD?>9C?EECB=@:=@; +@cluster_454:UMI_GAATGG +ATTTCATAATTCTCCTTTATTAGGCACAGGT ++ +;EEBA>C6?E??D?>DEB:C<?A=1 +@cluster_455:UMI_GTGAGC +CCTTTCTTCTCTCCCCAGATCGGAAAAGCAC ++ +<>DEB?DB?D?D?<@C=?B9=@ +@cluster_456:UMI_ACTGTG +GCTAGCTTTCTATTTGTAAACTTTGTGTCGG ++ +>?A=B?BEB?@?EEC@C@D@?DEC@A2A==@ +@cluster_460:UMI_TCTCAC +GCTTTTCTTTCTTTCTCTATTCTTTCTTCCC ++ +1-34461:992967.3./-410983.51-*) +@cluster_464:UMI_CCCGTG +CCCCCCCCCAAATCGGAAAAACACACCCCTA ++ +><;:<<<;AA>2>=71@DCA=7797@86;@6 +@cluster_467:UMI_AATCTG +GTTGGTTAAATCTTTACTCACAGTAATTTAC ++ +@ECB@EC?CA??DEC=?DA=??AC@AEEC=@ +@cluster_470:UMI_GCTTTC +CTGAGACGAAGTCTCACTCTGTCGCCCAGGC ++ +>CB===?@@?AB?DA=?D?C@B=B>DCB>=@A@C@DAEEEEC?ECB@:?A@9= +@cluster_475:UMI_TGTCGA +GTACCCCCCCCAAATCGGAAAAACACACCCC ++ +1>:@<<<<<11AD?75=3@DDD?><<:@<64 +@cluster_478:UMI_TGAGTA +CTTTGTACAAAATTTTATTAAAGGTCTTTAG ++ +?DEC@C=?ADDAEEEC?EC@D>A@B?DEC=B +@cluster_485:UMI_CATTCC +CAGCTTTGCAACCATACTCCCCCCCCAGATC ++ +A?B?DEC::A@@A@C=?D?<<<<<===??==AEEB=B?D?DC@BA=@@D;?B:=?=?@2?CB@? +@cluster_493:UMI_TTATTG +GGCCAACTGAATGTAATCTAGTTTATTCAAC ++ +=@>AA@?CB@AB@C@A??A=AEEC?EBAA@@ +@cluster_496:UMI_GTATCA +ACGAATGAGGCAATTTATTAACCCAGCATGG ++ +@?@@ABB=A@:AAEEC?EC@@@<>?A@8 +@cluster_510:UMI_TCGTGC +GCAACACGTTTATTGAGAGGCAGTTGTGCTC ++ +=:A@?=?@ECC?ECB===:::>AEC@A:?D> +@cluster_513:UMI_TCGCTC +CACTGTTAAAAACATTTATTCTGATACATTC ++ +A=?C@EB@DDD@?@EEC?EB?CB +@cluster_521:UMI_TCCATA +TGTCCAGCTGCTCCTGATCGGAATACAGCAC ++ +1/22@36;C-03--2674,1-/424122),/ +@cluster_523:UMI_TGCCTG +TTGCAGATTTCCTTCATCAAATTAAAACAGT ++ +4B::?=.DDB9?A? +@cluster_524:UMI_AGGGAC +TTTTTTTTTTTTTTTTTTTTTTTTCTCCAGC ++ +CEEEEEEEEEEEEEEEEEEEEEE415=97;- +@cluster_525:UMI_AGGGGC +GTTCGTTCAAGTGCACTTTCCAGTACACTTA ++ +@EB=@EBAA?AA::=?DEB?A?AC=?=?DC< +@cluster_530:UMI_GACACA +GGTGCATATGCATAAGTGGAGCCCAGAGGGC ++ +>@A::@C?B::@C@?A?B>=B>;A?==:1:> +@cluster_533:UMI_GGGGTC +GGTACCCCCCCCCAGATCGGAAAAACACACC ++ +:@C=@<<<<;;;A?:<>=<9;C@A?:=:=@1 +@cluster_535:UMI_CCGCTA +CTCAGCACCCATTGTAAATTATTTGTGGATG ++ +9DA?B8=?.DE4855<396;1;1 +@cluster_542:UMI_CCGACA +TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT ++ +EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEB +@cluster_545:UMI_ACGATC +CTTGCTTCAGTTTTATTTGTACAAATATCAC ++ +79A6?66@;A;EE52EE41?=:A56B<.547 +@cluster_559:UMI_TCAACG +CCGGCACTAAGTCAAGTTCTTTACTTCCCCA ++ +>==@:=?A@?ABAA?AEB?DEC=?DB?<:@;?=>8>9453;/ +@cluster_564:UMI_TTCGCA +TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT ++ +EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEB +@cluster_566:UMI_CGCATA +GACGGATGAGTCTTTTAATAGAAAAACACAC ++ +==?=>=?;7 +@cluster_569:UMI_GGCTCC +GCAGAACACTTCTTTATTATAGCAACATATA ++ +B:?=@@?=?DB?DEC?EC?C=B:A@?@C?B= +@cluster_572:UMI_AAGACC +GCAACCATACTCCCCCAGATCGGAAAAGCAC ++ +B:A@@A@C=?D?<<@D6?B:=@ +@cluster_578:UMI_GGGCTA +GGTACAGACAGGATCTCACTATGTTGCCCAG ++ +A@C=??==??A>A?@2><<59=E?@=<64=>/DCD2>=>@;@? +@cluster_588:UMI_ACATGG +AGTTAGAGTCTCAGTCACCCAGGCTGGAATA ++ +=AE?===A@=D@4AA@=?855A@>;B<@;=5 +@cluster_591:UMI_CAGGGC +CCCGGTCTAATGTTGCTTTTATTATTTTGAA ++ +<<==@B?A@AB@EC:?DEEC?EC?EEECB@@ +@cluster_592:UMI_GCCGTC +TGTGTCTCTCTGTCCCCAGATCGGAAGAGCA ++ +C?@7B?@?C1@;<;598?883846@?0792@ +@cluster_597:UMI_TTTTGG +GCGTAGGGGTTTTAGGTAAATGTCCTTTGAA ++ +9?@C8A==@7AEC,:/C6EB1:> +@cluster_602:UMI_CTCTCA +GGTTTCCGCCCCCCAGATCGGAAGAGCACAC ++ +A@DEB<;:>695:@?=>C:>;@;8 +@cluster_607:UMI_TCCGAC +GATTAATGAAAACATTCTTGGCAAATGCTTT ++ +@@DB?DCB;:ADAB::>?6 +@cluster_613:UMI_CCCGTC +TGTTATATTTCACATCATTTTTTCCAGACAT ++ +C3BC/C?EB22-<76>651@DA6E2.?377>-0?:>B/; +@cluster_619:UMI_TGTGAC +CCAGATCGGAAGAGCACACGTCTGAACTCCA ++ +@?=C><@?7=@8 +@cluster_622:UMI_TGGCTG +GAGACAGAGTATTGCTGTGTCGCCCCCCAGA ++ +====??==AC?EC:?=@A@B=B><<;@< +@cluster_632:UMI_TGGCAA +GAGATGGAGTCCCCAGATCGGAAGAGCACAC ++ +====AB?<@?9=B:=?=@ +@cluster_634:UMI_AGATCA +GTTTTTTTTTTTTCTCTCCTAACACCCCAGA ++ +?EEEEEEEEEEEB?D?D?>@@@?=@<DE>@DC5A:?DEC?E;B>@3EC>EEE:0 +@cluster_648:UMI_CCTATG +TTTTTTCCCCCCAAGATCGGAAAAACACACC ++ +EEEEEB?<<<DA@?AA@C====@DDD??=>=@:<5* +@cluster_672:UMI_GGACGA +ATTTTGTCTTTTGTTTTCATTTTTTCTTGCT ++ +AEEDB@A?DEEC@BEEBA;EEEEEB?DC:?D +@cluster_674:UMI_CGTTTC +AGACAAGTTCTCGCTCTGTCACCCAGGCTGG ++ +?==?A?AEB?D=B?D?C@BA=@DEC?ECB@DAB@DB +@cluster_676:UMI_AGGTAG +TGGCATTTTTAATTTAGGTTTGTTTTATTTA ++ +AB@:@EEEEC@AEEC=A@EEC@EEEC?EEC= +@cluster_677:UMI_CCTGGA +GCACCCCCTCCCAGATCGGAAAAACACACCC ++ +B:=@<<<>D?@DDD>?=?=@:> +@cluster_680:UMI_CCGCTA +TCTGATCTGACATTATTTCTATATTTTTAGA ++ +??CB@A/ +@cluster_687:UMI_ACGAAC +GACACTACTCTCCCACATCGCGAGAGAGCAC ++ +67/-01:5<::?:@5120+6531.8--2-68 +@cluster_689:UMI_CCTTCA +AAAGAAGTAAGCCTTTATTTCCTTGTTTTGC ++ +DD?=@?AC@?B>>DEC?EEB?>DC@EEEC:; +@cluster_690:UMI_ATTTAG +GTTTTTTTTTTTTTTTTTTTTTTTTTTTCTG ++ +1EEEEEEEEEEEEEEEEEEEEEEEEEEB?:) +@cluster_692:UMI_GCGTCC +GAGGTGAAGTTTCACTTTGTCCCCAGATCGA ++ +@=@@:?<3@D=A@27DDC7>?<;A?14;2<, +@cluster_693:UMI_CGGCCA +CTTTTGAGGCTTTTTCGTTGCCAGCAAGGGC ++ +?DEECB=A@?DEEEB=@EC:>A?B:A?A=@< +@cluster_699:UMI_TGTTTC +CTTTCTTTCTTTCTTTTGTTTCTTTCTTGCT ++ +>DEB?DEB?DEB?DEEC@EEB?DEB?DC:?D +@cluster_700:UMI_ATCGAA +GCAGTTTTTACATTTATTTAAACAGAAAACG ++ +B:?AEEEEC=>@EEB?EEC@4>>?=@DD??B +@cluster_706:UMI_CCACGG +GCCCTTCTGCTCCCCCAGATCGGAAGAGCAC ++ +@><>DB?C:?D?<<@?1=B:=@ +@cluster_711:UMI_CTCCGA +ATTAATGAAAACATTCTTGGCAAATGCTTTC ++ +=EC@ABB6DD@??=B?DCB@:@DAB5?<@ +@cluster_715:UMI_CTGTCG +TTTTGGGGCCCCCCCCAGATCGGAAAAGCAC ++ +EEEA1<<@>;<<<<C@=B869 +@cluster_716:UMI_GGGGTC +CCCCCCCCAAAATCGAAAAAACACACCCCTA ++ +<<<<<<;<1C?0.4@/DDA:;>3>8=;626< +@cluster_717:UMI_CAGCCC +TCAGCTTTGCAACCATACTCCCCCCGGAACC ++ +DA?B?DEC:8A?@A@C=?D?<<<<;=>@@@; +@cluster_719:UMI_GAGAAA +GGGAGTAGTGTCTTTATTCATTAAAGCCTGA ++ +A=>=AC=AA@B?DEC?EBA@EC@D?B>>CB= +@cluster_721:UMI_TTGTTC +GAGACGGAGACTCACTCTGTCGCCCCCCAGA ++ +3===>:><=<8AA683<;5912.<<;;>3./ +@cluster_722:UMI_TCCATA +GTTTTTTTTTTTTTTTTCAGTAAGCACAGGT ++ +AEEEEEEEEEEEEEEEBA?@:@?B:=??A@4 +@cluster_727:UMI_TTTACC +TTCTGAGCCTAAATGCCCTCAAAGCCCGTCC ++ +DB?CB=B-=?@DA@7>;>B8AD8?>;7:2@;;6 +@cluster_731:UMI_GTCACA +TTGCTTCACTGACTTAACTCAAATTTCTTAA ++ +EC:?DBA;?CB=?=B@@?DAADAEEB?AC@? +@cluster_732:UMI_AGGAAG +CCCCCCCCCAAATCGGAAAAACACACCCCTA ++ +6<<<<<<@DAD?>@0 +@cluster_742:UMI_GAGACC +TGAGTGGGAGTCTCGCTCTGTACCCCAGGTG ++ +21,005-;,252605262746,/2231;54/ +@cluster_756:UMI_TCGATA +CTTTGTTTCAAGTTTTAATCAAAGCTTGTAT ++ +?DEC@EEBAA?AEEEC@A?AAD?B?DC@C?? +@cluster_757:UMI_TTGCAA +TCTTTGCACACTTATATTTTTTTTTGTGTTT ++ +?4?<<6:+?:16@3707EEE=?B?DC@AEBA=?DEC?EEEEB?<CB>AB?C:ABAAABB@><@EA +@cluster_778:UMI_TTGGGC +ATTTAACATGAGGAAACCCCAGATCGGAAGA ++ +@EEA@?>@BB;A>@D<@;:64=8?==>@?<6 +@cluster_780:UMI_GTTGCA +GGAGTTCCTAACCCAACAGTAATATCATTAG ++ +7.-072.0/7//33377781/46-/1371-< +@cluster_787:UMI_GCAGTC +TGATAGCATTGCGAGACGCTGGAGCCGGAGC ++ +CB<@>==>6A9 +@cluster_792:UMI_CGGCAC +TGTCACCATCCTTCTTTTCTTCTTCCTCATC ++ +@6>6,430:45?=;CDD:7A:7DA<9<7:70 +@cluster_794:UMI_GCATCC +CCCCCCCAGATCGGAAAAGCACACGCCTGAA ++ +;;9<<===@D;?B:=<=?B:>C><8 +@cluster_796:UMI_ATTTGA +TAGTCAGCTATTTAATTAGGTTCTTAAGACA ++ +@=ABA?B?A?EEC@AEC=A@EB?DC@?==?8 +@cluster_799:UMI_CGTGCA +GCTCGTCTTTCTCCCCCAGATCGGAACAGTA ++ +=.B10486=:2989;58/-4=255::.=684 +@cluster_805:UMI_CGTGGG +GTACTGCTCAAGCGCTGTCTATATCTCTCTA ++ +04904,.12:08/2/>16/74@4213<8.0. +@cluster_807:UMI_GATATG +TTTTTCCACACGTAAAATTTATAAACATTTA ++ +83EEA3:620725;DD5CAB:53C3=/472- +@cluster_809:UMI_CTTTTA +CACAAGGAATATCATTTTATTACTGTAATCA ++ +?=?A?A>@AC??A@EEEC?EC=?C@C@A?A= +@cluster_810:UMI_TCTCGC +GAAGAGCACACGTCTGAACTCCAGTCACCGT ++ +9?<9;@23538<88>@348<396;;365/=4 +@cluster_814:UMI_GGGCTG +TTCTAGGTCCAATGGTAGTTTTTATTCCCCA ++ +DB?A=A@B?AAABB@@=A>DDEC?EB?;;@; +@cluster_816:UMI_ATGTAG +TGAGACAACATCTCACTCTGTTACCCCCCAA ++ +AA===>A?:@>?C@=?C?C@BC3/;<;@?>?B:?AB?DCB@AB@EC=B,< +@cluster_823:UMI_TTTTTA +CCATTATAATAGCCATCTTTATTTGTAAAAA ++ +?A@EC?C@AC=B>A@??DEC?EEC@C@DDD: +@cluster_824:UMI_GAGTCC +AGCTTTGCAACCATACTCCCCCCGGAACCCA ++ +?B?DEC::A@@A@C=?D?<<<<==>@@@<@= +@cluster_828:UMI_CTCGTA +GCCCCCCCCCAAATCGGAAAAACACACCCCC ++ +B><<<<<<@DDD?>=>=@;<<3 +@cluster_834:UMI_TTAAGG +AGGGTGGGGGATCACATTTATTGTATTGAGG ++ +=A=@AB===>4?A=??EEB?EB@C?ECB=A? diff --git a/docs/python_better_prog.pptx b/docs/python_better_prog.pptx new file mode 100644 index 0000000..20d1466 Binary files /dev/null and b/docs/python_better_prog.pptx differ diff --git a/docs/python_debugging.pptx b/docs/python_debugging.pptx new file mode 100644 index 0000000..b7944a1 Binary files /dev/null and b/docs/python_debugging.pptx differ diff --git a/docs/python_getting_help.pptx b/docs/python_getting_help.pptx new file mode 100644 index 0000000..cf27dac Binary files /dev/null and b/docs/python_getting_help.pptx differ diff --git a/docs/welcome_to_python_course.pdf b/docs/welcome_to_python_course.pdf new file mode 100644 index 0000000..5302ad8 Binary files /dev/null and b/docs/welcome_to_python_course.pdf differ diff --git a/etherpad.md b/etherpad.md new file mode 100644 index 0000000..76da6a4 --- /dev/null +++ b/etherpad.md @@ -0,0 +1,45 @@ +Welcome to etherpad.net Pad! + +This pad text is synchronised as you type, so that everyone viewing this page sees the same text. +This allows you to collaborate seamlessly on documents! +Images can be integrated either via drag and drop or copy and paste. + +**Please ensure that you have signed the sign-in sheet (If you did it yesterday you're good :-)** + + +# CRUK-CI Introduction to Python Course + +- This pad is at https://etherpad.net/p/28062018_Python_intro_course and https://tinyurl.com/crukpython +- The course on Github is at https://github.com/pycam/python-basic/tree/crukci + + +# Instructions to start the course on the computer in front of you + +- Start Jupyter locally (Start Jupyter locally (using the icon on the Desktop called 'Python Basic Course Setup' after setting up CHrome or Firefox as your default browser) +- Firefox should open into http://localhost:8888 running Jupyter and displaying the course notebooks +- Click on 'python_basic_1_intro.ipynb' to open the introduction (url: http://localhost:8888/notebooks/python_basic_1_intro.ipynb) +- Open Windows Explorer and navigator to the course materials in C:/python-basic +- Open Git bash, the terminal we will be using today +- Open Atom, the text editor we will be using today + + +# Your feedback +Please give us feedback on this course https://www.surveymonkey.co.uk/r/PythonUC + +# Extra information + +- Markdown cheatsheet http://stationinthemetro.com/wp-content/uploads/2013/04/Markdown_Cheat_Sheet_v1-1.pdf +- The most common start codon is AUG. +- In the standard genetic code, there are three different stop codons: + - in RNA: + - UAG ("amber") + - UAA ("ochre") + - UGA ("opal") + - in DNA: + - TAG ("amber") + - TAA ("ochre") + - TGA ("opal" or "umber") + + +# Your questions +Please feel free to enter any questions here - we will try to answer them ASAP diff --git a/img/better-prog.png b/img/better-prog.png new file mode 100644 index 0000000..8cdc01a Binary files /dev/null and b/img/better-prog.png differ diff --git a/img/final.png b/img/final.png new file mode 100644 index 0000000..0fa76e4 Binary files /dev/null and b/img/final.png differ diff --git a/img/git-logo.png b/img/git-logo.png new file mode 100644 index 0000000..3ad9dfb Binary files /dev/null and b/img/git-logo.png differ diff --git a/img/github-logo.png b/img/github-logo.png new file mode 100644 index 0000000..7ae120a Binary files /dev/null and b/img/github-logo.png differ diff --git a/img/gitlab-logo.png b/img/gitlab-logo.png new file mode 100644 index 0000000..d0765c5 Binary files /dev/null and b/img/gitlab-logo.png differ diff --git a/img/mars.jpg b/img/mars.jpg new file mode 100644 index 0000000..9b539bf Binary files /dev/null and b/img/mars.jpg differ diff --git a/img/pypi-logo.svg b/img/pypi-logo.svg new file mode 100644 index 0000000..e53853c --- /dev/null +++ b/img/pypi-logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/img/python-tutor.png b/img/python-tutor.png new file mode 100644 index 0000000..f96bb58 Binary files /dev/null and b/img/python-tutor.png differ diff --git a/img/research_before_writing.png b/img/research_before_writing.png new file mode 100644 index 0000000..f34a71b Binary files /dev/null and b/img/research_before_writing.png differ diff --git a/img/svn-logo.png b/img/svn-logo.png new file mode 100644 index 0000000..dcbaf1a Binary files /dev/null and b/img/svn-logo.png differ diff --git a/live/python_basic_1_2_live.ipynb b/live/python_basic_1_2_live.ipynb index 3688060..aa7bd97 100644 --- a/live/python_basic_1_2_live.ipynb +++ b/live/python_basic_1_2_live.ipynb @@ -9,6 +9,17 @@ "- Printing things and using variables in python 3" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "# jupyter notebook: last line printed only" + ] + }, { "cell_type": "code", "execution_count": null, @@ -59,6 +70,17 @@ "print('hi', my_name, sep=',')" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "print('42'+'2')" + ] + }, { "cell_type": "code", "execution_count": null, diff --git a/live/python_basic_2_2_live.ipynb b/live/python_basic_2_2_live.ipynb index fa84848..dfdbb47 100644 --- a/live/python_basic_2_2_live.ipynb +++ b/live/python_basic_2_2_live.ipynb @@ -18,10 +18,10 @@ "outputs": [], "source": [ "# code blocks\n", - "if condition:\n", - " # do this\n", - "else\n", - " # do that" + "if condition_is_true:\n", + " # this block will be ran\n", + "else:\n", + " # this one instead" ] }, { @@ -91,7 +91,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "my_numbers = list(range(1, 10))\n", @@ -118,7 +120,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "# example with dictionary\n", @@ -130,7 +134,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "print(r)\n", @@ -212,7 +218,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "# solution with range\n", @@ -223,7 +231,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "# regular expression for checking all occurances within a string\n", @@ -236,12 +246,21 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "help(re.finditer)" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Skipping and breaking loops" + ] + }, { "cell_type": "code", "execution_count": null, @@ -255,7 +274,7 @@ "total = 0\n", "for v in values:\n", " if v < 0:\n", - " continue # Skip this iteration\n", + " continue # Skip this iteration\n", " total += v\n", "print(total)" ] @@ -272,7 +291,7 @@ "sequence = ['CAG','CAA', 'TAC','CAA']\n", "for codon in sequence:\n", " if codon == 'TAC':\n", - " break # Quit looping at this point\n", + " break # Quit looping at this point\n", " else:\n", " print(codon)" ] @@ -285,7 +304,15 @@ }, "outputs": [], "source": [ - "# do not delete while looping" + "# do not delete while looping!" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### More looping\n", + "- range(), enumerate() and filtering" ] }, { @@ -303,7 +330,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "squares = []\n", @@ -317,7 +346,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "# using list comprehension\n", @@ -377,10 +408,20 @@ "sum(city_pops.values())" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Formating string\n", + "- format()" + ] + }, { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "# string formating: '{}' is a place holder for all values given to the format() function\n", @@ -404,7 +445,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "seq = 'AAAAAAAATTTTTTCCCCCGGGG'\n", diff --git a/python_basic_1_1.ipynb b/python_basic_1_1.ipynb index f9c6192..24f744d 100644 --- a/python_basic_1_1.ipynb +++ b/python_basic_1_1.ipynb @@ -39,6 +39,7 @@ "cell_type": "code", "execution_count": null, "metadata": { + "collapsed": true, "slideshow": { "slide_type": "fragment" } @@ -52,6 +53,7 @@ "cell_type": "code", "execution_count": null, "metadata": { + "collapsed": true, "slideshow": { "slide_type": "fragment" } @@ -65,6 +67,7 @@ "cell_type": "code", "execution_count": null, "metadata": { + "collapsed": true, "slideshow": { "slide_type": "fragment" } @@ -89,6 +92,7 @@ "cell_type": "code", "execution_count": null, "metadata": { + "collapsed": true, "slideshow": { "slide_type": "fragment" } @@ -146,7 +150,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "x = 3\n", @@ -163,7 +169,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "x = 2 + 2\n", @@ -182,7 +190,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "serine = \"TCA\"\n", @@ -201,7 +211,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "3 + 4" @@ -210,7 +222,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "x = 5\n", @@ -227,7 +241,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "x = 5\n", @@ -245,7 +261,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "y" @@ -261,7 +279,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "y = y + 1\n", @@ -278,7 +298,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "y += 1\n", diff --git a/python_basic_1_3.ipynb b/python_basic_1_3.ipynb index 407ae37..620e0a1 100644 --- a/python_basic_1_3.ipynb +++ b/python_basic_1_3.ipynb @@ -35,10 +35,12 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ - "a = (123, 54, 92) # tuple of 4 integers\n", + "a = (123, 54, 92) # tuple of 3 integers\n", "b = () # empty tuple\n", "c = (\"Ala\",) # tuple of a single string (note the trailing \",\")\n", "d = (2, 3, False, \"Arg\", None) # a tuple of mixed types\n", @@ -59,7 +61,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "x = 1.2\n", @@ -80,7 +84,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "t = 2, 3, 4 # tuple packing\n", @@ -108,7 +114,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "a = [1, 3, 9]\n", @@ -130,7 +138,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "matrix = [[1, 0], [0, 2]]\n", @@ -147,7 +157,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "a = (1, 4, 9, 16) # A tuple of numbers\n", @@ -186,7 +198,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "t = (123, 54, 92, 87, 33)\n", @@ -212,7 +226,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "t = (123, 54, 92, 87, 33)\n", @@ -233,7 +249,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "t = (123, 54, 92, 87, 33)\n", @@ -254,7 +272,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "t = (123, 54, 92, 87, 33)\n", @@ -274,7 +294,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "x = [123, 54, 92, 87, 33]\n", @@ -293,7 +315,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "t = (123, 54, 92, 87, 33)\n", @@ -311,7 +335,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "x = [123, 54, 92, 87, 33]\n", @@ -329,7 +355,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "x = [123, 54, 92, 87, 33]\n", @@ -347,7 +375,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "x = [123, 54, 92, 87, 33]\n", @@ -365,7 +395,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "x = [123, 54, 92, 87, 33]\n", @@ -384,7 +416,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "a = [1,2,3]\n", @@ -405,7 +439,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "a = [1, 2, 3]\n", @@ -424,7 +460,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "a = [1, 2, 3, 4, 5, 6]\n", @@ -442,7 +480,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "a = [1, 3, 5, 4, 2]\n", @@ -462,7 +502,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "a = [2, 5, 7, 1]\n", @@ -494,7 +536,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "help(len)" @@ -503,7 +547,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "help(list)" @@ -512,7 +558,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "help(list.insert)" @@ -521,7 +569,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "help(list.count)" @@ -551,7 +601,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "text = \"ATGTCATTTGT\"\n", @@ -573,7 +625,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "text = \"ATGTCATTTGT\"\n", @@ -594,7 +648,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "dna = \"ATGTCACCGTTT\"\n", @@ -617,7 +673,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "s = \" Chromosome Start End \"\n", @@ -643,7 +701,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "seq = \"ATG TCA CCG GGC\"\n", @@ -664,7 +724,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "seq = \"ATG TCA CCG GGC\"\n", @@ -685,7 +747,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "s = \"chr\"\n", @@ -703,7 +767,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "help(str.split)\n", diff --git a/python_basic_1_intro.ipynb b/python_basic_1_intro.ipynb index 954dbb3..1342756 100644 --- a/python_basic_1_intro.ipynb +++ b/python_basic_1_intro.ipynb @@ -27,7 +27,7 @@ "source": [ "## Today's Presenters\n", "- Anne\n", - "- Cristian" + "- Mark" ] }, { @@ -105,7 +105,7 @@ "\n", "- There is a course webpage with links to the materials, example solutions to the exercises etc.:\n", " - http://pycam.github.io\n", - "- All course materiel is available on GitHub in our [python-basic repo](https://github.com/pycam/python-basic)\n", + "- All course materiels are available on GitHub in our [python-basic repo](https://github.com/pycam/python-basic)\n", "- We’d like you to follow along with the example code as we go through the material, and attempt the exercises to practice what you’ve learned\n", "- Questions are welcome at any point!\n", "- If you have specific projects/problems you like to use Python for we are happy to (try to) help during the exercises\n" @@ -254,6 +254,69 @@ " - Easy to use tools for parallel computing." ] }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## Environments that help you code\n", + "\n", + "- **Text editors** e.g. Atom https://atom.io/\n", + "- **IDEs** e.g. IDLE\n", + "Integrated Development Environments combine editing, debugging (fixing programs – discussed\u000b", + "later), help files and features like code completion e.g. PyCharm https://www.jetbrains.com/pycharm/\n", + "- **Jupyter notebooks** - different strengths to IDEs" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "- **Jupyter notebooks** - different strengths to IDEs\n", + " - Code can be deployed to the web for people to download and use\n", + " - Can be annotated and added to in order to document the code and your thoughts\n", + " - These are useful e.g. if you publish a workflow as supplementary material in a paper\n", + " - Can access command-line shell programs from within notebook e.g. *samtools* and include their output in your notebook" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## Use versioning tools\n", + "These are tools that handle revisions of material (not just programs)\n", + "\n", + "| | | | |\n", + "| - | - | - | - |\n", + "| | | | | " + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "- [Subversion](https://subversion.apache.org/)\n", + "- [Git](https://git-scm.com/)/[GitHub](https://github.com/)/[GitLab](https://about.gitlab.com/): You effectively create save points and can ‘roll back’ to an earlier version. Useful when by adding new code you accidentally break your program!\n", + " - [TechBlog: Git: The reproducibility tool scientists love to hate](http://blogs.nature.com/naturejobs/2018/06/11/git-the-reproducibility-tool-scientists-love-to-hate/)\n", + "- Can handle several authors and track who made what changes\n", + "- Repositories (repos) are good way of making your software available on the WWW " + ] + }, { "cell_type": "markdown", "metadata": { diff --git a/python_basic_2_1.ipynb b/python_basic_2_1.ipynb index 5442975..1bf6c44 100644 --- a/python_basic_2_1.ipynb +++ b/python_basic_2_1.ipynb @@ -33,7 +33,7 @@ "\n", "- By performing repetitive loops through the same block of code, where each time through the loop different values may be used for the variables.\n", "\n", - "- Through the use of functions (subroutines) where the program’s execution jumps from a particular line of code to an entirely different spot, even in a different file or module, to do a task before (usually) jumping back again. Functions are covered in the next session, so we will not discuss them yet.\n", + "- Through the use of functions (subroutines) where the program’s execution jumps from a particular line of code to an entirely different spot, even in a different file or module, to do a task before (usually) jumping back again. Functions are covered in the next one day course 'Working with Python: functions and modules', so we will not discuss them here.\n", "\n", "- By checking if an error or exception occurs, i.e. something illegal has happened, and executing different blocks of code accordingly" ] @@ -228,7 +228,7 @@ "|`!=` |\t non equality |\t1 != 2 # True |\n", "| `<` |\t less than |\t1 < 2 # True |\n", "| `<=` |\t equal or less than |\t2 <= 2 # True |\n", - "| `>` |\t greater then |\t1 > 2 # False |\n", + "| `>` |\t greater than |\t1 > 2 # False |\n", "| `>=` |\t equal or greater than |\t1 >= 1 # True |\n", "\n", "It is notable that comparison operations can be combined, for example to check if a value is within a range." @@ -269,7 +269,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "a = 500\n", @@ -290,7 +292,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "x = [123, 54, 92, 87, 33]\n", @@ -308,7 +312,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "# Let's change x\n", @@ -337,12 +343,21 @@ "| `\"\"` |\tempty string |\n", "| `()` |\tempty tuple |\n", "| `[]` |\tempty list |\n", - "| `{}` |\tempty dictonary |\n", + "| `{}` |\tempty dictionary |\n", "| `set()` |\tempty set |\n", "\n", "And everything else is deemed to be True in a conditional context." ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + }, { "cell_type": "code", "execution_count": null, diff --git a/python_basic_2_3.ipynb b/python_basic_2_3.ipynb index 2d4bd34..54893fe 100644 --- a/python_basic_2_3.ipynb +++ b/python_basic_2_3.ipynb @@ -66,7 +66,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "path = \"data/datafile.txt\"\n", @@ -85,7 +87,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "open( \"data/myfile.txt\", \"r\" ) # open for reading, default" @@ -94,7 +98,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "open( \"data/myfile.txt\", \"w\" ) # open for writing (existing files will be overwritten)" @@ -103,7 +109,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "open( \"data/myfile.txt\", \"a\" ) # open for appending" @@ -126,7 +134,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "fileObj.close()" @@ -171,7 +181,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "fileObj = open( \"data/datafile.txt\" )\n", @@ -197,7 +209,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "# one line at a time\n", @@ -219,7 +233,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "# all lines\n", @@ -242,7 +258,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "# as an iterable\n", @@ -271,7 +289,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "# fileObj will be closed when leaving the block\n", @@ -315,7 +335,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "read_counts = {\n", diff --git a/python_basic_2_intro.ipynb b/python_basic_2_intro.ipynb index af16b6c..3947a77 100644 --- a/python_basic_2_intro.ipynb +++ b/python_basic_2_intro.ipynb @@ -8,11 +8,11 @@ } }, "source": [ - "# An introduction to solving biological problems with Python\n", + "# An introduction to solving biological problems with Python - day two\n", "\n", "- Our course webpage: http://pycam.github.io\n", "- Python website: https://www.python.org/ \n", - "- [Python 3 Standard Library](https://docs.python.org/3/library/index.html])" + "- Python docs: [Python 3 Standard Library](https://docs.python.org/3/library/index.html)" ] }, { @@ -23,7 +23,7 @@ } }, "source": [ - "## Learning objectives\n", + "## Learning objectives - day two\n", "\n", "- **Recall** what we've learned so far on variables, common data types and collections\n", "- **Propose and create** solutions using these concepts in an exercise\n", @@ -317,6 +317,188 @@ "print(\"ATG TCA CCG GGC\".split())" ] }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "# Research before writing\n", + "Or how to avoid writing code that's already been written\n", + "
" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "- In the same way that before carrying out an experiment you would review the available literature, it is sensible to research if there are resources that will make it easier for you to write your program.\n", + "\n", + "\n", + "- Python has **MANY** function libraries (called modules) which can be easily installed using the **pip** command and then you can import them into your code. Look at [https://pypi.org](https://pypi.org) for a searchable index.\n", + "\n", + "
\n", + "\n", + "- Look on https://github.com for examples of code from authors tackling similar problems. Useful place to learn programming tricks (Can find good and bad code on display here).\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "**Read the Documentation**\n", + "\n", + "- Python has extensive online documentation at https://docs.python.org/. This is for Python 3.x. There are pages for Python 2.x as well.\n", + "- There is an extensive tutorial at: https://docs.python.org/3/tutorial/index.html\n", + "\n", + "**Online Fora**\n", + "\n", + "Useful for searching but if you wish to post a query please follow the sites ‘Netiquette’ and check that the question hasn’t been asked before.\n", + "- https://stackoverflow.com – mostly programming but not just Python\n", + "- https://www.biostars.org - Bioinformatics Q&A with some programming questions\n", + "- http://seqanswers.com - Similar to Biostars\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "** Measure twice, cut once**\n", + "\n", + "Don’t rush to code. Plan & describe what your program will do and what it needs (Specification).\n", + "\n", + "- Can just write a few paragraphs of text into a `README.md` file\n", + "- Or draw a flowchart e.g. https://www.draw.io/ \n", + "\n", + "
" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "- Try to anticipate user responses (PEBKAC – Problem Exists Between Keyboard And Chair) and handle resulting errors\n", + "- When writing anything beyond trivial programs try a bottom up approach i.e. write and test components before including them in your main program\n", + "- Learn to use **pip** and you will then be able to use a vast library of python modules – this will save you writing code that re-invents the wheel" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## What to do when the program doesn’t work?\n", + "Zen and the art of debugging\n", + "\n", + "**We ALL make mistakes when we code...**\n", + "\n", + "[Nov. 10, 1999: Metric Math Mistake Muffed Mars Meteorology Mission](https://www.wired.com/2010/11/1110mars-climate-observer-report/): A disaster investigation board reports that NASA's Mars Climate Orbiter burned up in the Martian atmosphere because engineers failed to convert units from English to metric. The $125 million satellite was supposed to be the first weather observer on another world. But as it approached the red planet to slip into a stable orbit Sept. 23, the orbiter vanished. Scientists realized quickly it was gone for good. \n", + "\n", + "| | |\n", + "| - | - |\n", + "| | 1 Pound (force) = 4.44822 Newtons |" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "**We ALL make mistakes when we code...**\n", + "\n", + "- Try things like printing (or logging) out contents variables – does the output match what we expected?\n", + " - Can get very tedious when a lot of variables & data structures are involved\n", + "- Use writing values to a text file\n", + " - Can output many variables – still somewhat tedious to inspect\n", + "- Track which bits of code are being executed and in what order by printing messages\n", + " - Better but can get messy and doesn’t scale well" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "**We ALL make mistakes when we code...**\n", + "\n", + "- Using a debugger tool (Read [*'How To Use the Python Debugger'*](https://www.digitalocean.com/community/tutorials/how-to-use-the-python-debugger))\n", + " - Many programming languages have tools like this\n", + " - They basically ‘step’ through your code stopping at ‘breakpoints’ and displaying \u000b", + "a dump of the values of the variables\n", + " - They can take time to learn to use and to get the best out of them\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "**We ALL make mistakes when we code...**\n", + "\n", + "- Other tools like the Online Python tutor http://pythontutor.com/visualize.html#mode=edit\n", + " - This is a web-based tool that visualizes what is going on in your program\n", + " - Not suited for large or complex programs so e.g. test modules in it #betterprogramming" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "**We ALL make mistakes when we code...**\n", + "
" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "**Ways of testing your code**\n", + "\n", + "- Try to write test functions that call your code with test data and defined output `=` a pass\n", + "- If you alter code to ‘improve’ it, then run the tests. If they do not pass then you’ve broken something!\n", + "- Often useful if there is another package that does calculations e.g. ANOVA in R that you can run in parallel with your code – do you get the same/similar results with the same data? \n", + "- Get another programmer to review your code (Many eyes principle). If nothing else it will be a test of your documentation and code comments (You did do that didn’t you?)." + ] + }, { "cell_type": "markdown", "metadata": {