PyPyã¨ã¹ãã³ã³ã¨ãã¤ãªã¤ã³ãã©ããã£ã¯ã¹ (PyPy advent calender 12æ¥ç®)
PyPy Advent Calendar 12æ¥ç®ã§ãã
ã¿ã¤ãã«éãã®ãã¨ãå¾ç¶ãªãã¾ã¾ã«æ¸ãã¾ãã
ã¹ãã³ã³ã¢ã¼ããã¯ãã£ç¡ç¥ã®ã©ç´ 人ã§ãã
ãã¤ãªã¤ã³ãã©ããã£ã¯ã¹ããã£ã¦ãã¤ããã§ãã
PyPyãã©ããããã®ãã¯ããã¾ã§ã®PyPy Advent Calendarçè
ã®æ¹ã
ã®è¨äºããèªã¿ãã ããã
PyPyã¨ã¹ãã³ã³
ãã®ç¯ã§ä½ãè¨ãããã®ã¨ããã¨
PyPy(ã¿ããã®)ãã¹ãã³ã³ã§ä½¿ããã¨ããã§ãããããããæå³ã§ãPyPyé¢ç½ããã§ããã
ã£ã¦ãã¨ã§ãã
京ãæåã«ãªãã¾ããããå®è³ªäº¬ããµãã¼ããã¦ããè¨èªã¯Cã¨Fortranã¨è¨ã£ã¦ããã®ã§ã¯ãªãã§ããããã
ã¢ã¼ããã¯ãã£ã¨ãPythonèªä½ã®ãµãã¼ãã¨ãã¯ã¨ãããããã£é£ã°ãã¦ããªãPyPy(Python)ã¿ããã®ã使ããã¨ãããªã¨æããã¨ããã¨
toolchainã§æ¥½ããã
ã¨ãããã¨ã«å°½ãã¾ãã
Pythonã§æ¸ãã¦æ¥½ã§ããããã«ãªããã¨ãã³ã¼ãã®è¤éãã軽æ¸ãããã¨
ã¯é常ã«æå³ã®ãã(ãã¹ãã®äººãå©ãã?)ãã¨ã®ããã«æãã¾ããããã®ãã¼ã¿ã®ã¡ã¢ãªä¸ã®é
ç½®ã®ä»æ¹ãæå¤ã¨ã¹ãã³ã³ã«åã£ããããªãã®ããªã¼ãªã©ã¨å¦æ³ãã¦ãã¾ãã
ã¨ããããã§PyPyã®ãããªä»çµã¿ãã¹ãã³ã³ã§ãæ´»ç¨ãããã¨é¢ç½ãããããã¾ãããã
ãã誰ãèãã¦ããã§ãããã
ããã£ã¨ã°ã°ã£ãæãã ã¨NCARã£ã¦ã¨ãããããããã¨ãããã¨ãã¦ãããã§ãããã£ã¦æãã§ããã
PyPyã¨ãã¤ãªã¤ã³ãã©ããã£ã¯ã¹
ããã§ã¯ã¹ãã³ã³ç°å¢ã§ãã¼ã«ãã§ã¼ã³ãå®æ¼ãã¦ã¿ãã¾ãããã
ãªãã¦ãã¨ã§ãããããªãã®ã§ãçµå±ããã¼ãMacMiniã§ãæ¢åã©ã¤ãã©ãªã®ã¹ãã¼ãåè² ããããªã©!ãã£ã¦æå³ããã®ããªçãªãã¨ããã§ãã¾ããã§ããã
使ã£ãã®ã¯BioPythonã§ãã
Bitbucketã®wikiã®ãPyPyã®ã¡ã¸ã£ã¼ãªPythonã©ã¤ãã©ãªã®compatibilityãã®ãã¼ã¸ã§BioPythonã¯ãããã¼ã¯ã¤ãã¦ã¾ãããããã¯numpy使ã£ã¦ãã¨ãã使ããªããããããªã£ã¦ãã ãã§ãã以å¤ã®é¨åã¯èªåã試ããéãã§ã¯å
¨é¨ä½¿ãã¾ããã
ã¡ãªã¿ã«èªåã¯æ®éã«BioPython使ã£ã¦ãæã§ãnumpy使ã£ã¦ãã®ä½¿ã£ããã¨ãªãã§ãã
- numpyãã ããªãã§installæã«ã¯pypy setup.py buildããã£ã¨ã°ãã¦pypy setup.py installã£ã¦ããã°ä½¿ãã¾ãã
- reportlabã¯ä½¿ããã½ã(å¾è¿°ãã¾ããåå°½ãã¦ç¢ºèªãã¦ã¾ãã)
- MySQLdbã¯éè¦æ§ä½ãã¨å¤æãç¡è¦
ã§æåã®ã¹ãã¼ãå·®ã確èªã§ããBioPython tutorialä¸ã®ä¾(Uniprotã®ãã¼ã¿ã®ãã¼ã¹ããª)ã§è¨±ãã¦ãã ããã
from Bio import SeqIO uniprot = SeqIO.index("uniprot_sprot.dat", "swiss") handle = open("selected.dat", "w") for acc in ["P33487", "P19801", "P13689", "Q8JZQ5", "Q9TRC7"]: handle.write(uniprot.get_raw(acc)) handle.close()
macmini:bin kozo2$ time python uniprottime.py real 1m42.344s user 1m21.054s sys 0m5.537s macmini:bin kozo2$ time ./pypy uniprottime-pypy.py real 0m53.986s user 0m36.852s sys 0m4.819s
ã¨ããããããã¼ããã¼ã®ããã ãããçæå¾ã§ããã©ä»å¾ãPyPy使ã£ã¦ã¿ããã¨æãã¾ãã(uniprottime-pypy.pyã£ã¦ã®ãå¦çå
容ã¯åãã§ã)
reportlab使ã£ã¦ãGenomeDiagramé¨åãPyPyã§ã§ãããã©ãã試ãã¦ã¾ãæ¸ãã¾ã(å¤åãããã¨æã)ã
ãã¨networkxã試ãã¦ã¿ããã§ããtutorialçãªä¾ã¯å
¨é¨PyPyã§ããã¾ããã
numpypyã¯ã¾ã ã¾ã ããããã£ã½ãã§ããã
ã¨ããããã¯ã¹ãã¼ãéããªã£ããã¼ãã ãã§ãã
fastqã®ãã¼ã¹ã¨ãã¯ãã®ã¹ãã¼ãå·®ãããããã£ãããããã§ãããã
ãã£ã¨æåã®ç¯ã¿ãããªã¨ãããã£ã¦ããã¨ãããªçãªæãã§ãã
ããããªãã
è¬è¾
id:moriyoshi ã«ãã¡ãã¬ã¹ã§æãã¦ããã£ã¦PyPyã«èå³æã¡ã¾ãããPyPyãããããã§ããããããã
æåã®ç¯ã®å
容 id:moriyoshi ã®è¨èª¬ãã¯ã£ã¦ã¾ãã