1 / 96

재현가능한 생물정보학 (서울대학교 생물정보학 협동과정 2019년 1학기 "생물정보학을 위한 IT기초")

uc11cuc6b8ub300ud559uad50 uc0ddubb3cuc815ubcf4ud559 ud611ub3d9uacfcuc815 2019ub144 1ud559uae30<br>"uc0ddubb3cuc815ubcf4ud559uc744 uc704ud55c ITuae30ucd08" 11uc8fcucc28 uac15uc758 uc2acub77cuc774ub4dc

hyeshik
Download Presentation

재현가능한 생물정보학 (서울대학교 생물정보학 협동과정 2019년 1학기 "생물정보학을 위한 IT기초")

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 생물정보학을 위한 IT기초 섹션 4 장혜식 서울대학교 생명과학부

  2. 앞으로 3주

  3. Tools for Reproducible Research 5월 16일 interactive environment, workflow automation, version control, containers, continuous integration POSIX Text Processing 5월 23일 shell commands, pipeline, FIFO, basic regular expression, basic awk programming, GNU textproc Technical Aspects of Aesthetics in Scientific Data Visualization typography, color models, color maps, color blindness 5월 30일

  4. Reproducible Research

  5. 재현가능한 계산 연구를 하려면 과정을 기록해야 한다. (처리과정, 개발과정, 가설과 데이터의 변화 과정 등..) 재현이 쉽게 만든다. (자동화, 문서화로 최소한의 노력으로 할 수 있도록) 변화가 쉽도록 만든다. (다른 파라미터나 데이터를 쉽게 도입할 수 있어야) 다시 쓸 수 있게 데이터를 보관한다. (“보관”만으로는 충분하지 않다)

  6. 과정의 기록 -실행 중간 log를 기록하고 보관한다. -명령행도 모두 기록한다. -개발 과정도 나중에 추적할 수 있도록 기록한다. -중간 파일들도 가능하면 보관한다. -실행에 영향을 미칠 것 같은 환경에 대해 기록한다. 유용한 도구 개발과정과 역사: git, subversion, github, gitlab, redmine 분석과 처리과정: Jupyter Notebook, JupyterLab, knitr, R Markdown 터미널 작업: script 환경: virtualenv, conda env, pip freeze, pip list 등..

  7. 재현하기 “엄청나게” 쉽게 만들기 재현이 어려운 경우 -수작업이 많이 들어간다. -파라미터나 랜덤 상태에 엄청나게 의존적이다. -의존성이 복잡하게 많다. -잠깐 임시로 고쳐놓고 따로 기록해 두지 않는다. -파일이 여기저기 흩어져 있다.

  8. 재현하기 “엄청나게” 쉽게 만들기 언제든지 전체를 다시 실행해서 같은 결과를 얻을 수 있어야 함.

  9. 재현하기 “엄청나게” 쉽게 만들기 언제든지 전체를 다시 실행해서 같은 결과를 얻을 수 있어야 함. 부담없이 계속 돌리려면 빠르거나 분산이 가능하고 자동화돼야 함.

  10. 재현하기 “엄청나게” 쉽게 만들기 언제든지 전체를 다시 실행해서 같은 결과를 얻을 수 있어야 함. 부담없이 계속 돌리려면 빠르거나 분산이 가능하고 자동화돼야 함. 유용한 도구 파이프라인: make, snakemake, nextflow, airflow, ruffus 등 문서화/시각화: Jupyter Notebook, JupyterLab, knitr, R Markdown 재현성 있는 환경: virtualenv, rbenv, conda, docker, singularity 무결성 유지: Jenkins CI, GitLab CI, Travis CI

  11. 변화하기 “엄청나게” 쉽게 만들기

  12. 변화하기 “엄청나게” 쉽게 만들기 파라미터는 소스에 넣지 말고 분리하자 (ini, json, etc)

  13. 변화하기 “엄청나게” 쉽게 만들기 파라미터는 소스에 넣지 말고 분리하자 (ini, json, etc) 재활용 가능한 파이프라인/노트북으로 만들자 인터넷에서 접근 가능한 도구로 만들자 (웹서버) 유용한 도구 환경설정 파일: json, yaml, ini 파이프라인: snakemake, nextflow, owl, cwl, airflow, Galaxy 웹서버/GUI: Galaxy, shiny, flask, bokeh, dash 환경: virtualenv, conda env, pip freeze, pip list 등..

  14. 다시 쓸 수 있게 데이터를 보관하자 -원본과 논문에 사용된 중간파일을 “잘” 백업한다. -나중에도 접근할 수 있는 파일 포맷을 선택한다. - 플랫폼 의존성이 있는지? - 아주 복잡한 내부 구조, 버전마다 바뀌는 포맷 - 많이 사용되지 않거나 비싼 소프트웨어에 특이적인 포맷 -Meta data를 반드시 “같이” 보관한다. -GEO, SRA, ArrayExpress, Zenodo, Dataverse 등에 잘 정리해서 올린다.

  15. 다시 쓸 수 있게 데이터를 보관하자 -원본과 논문에 사용된 중간파일을 “잘” 백업한다. -나중에도 접근할 수 있는 파일 포맷을 선택한다. - 플랫폼 의존성이 있는지? - 아주 복잡한 내부 구조, 버전마다 바뀌는 포맷 - 많이 사용되지 않거나 비싼 소프트웨어에 특이적인 포맷 유용한 도구 -Meta data를 반드시 “같이” 보관한다. 백업 자동화: rsnapshot, duplicity -GEO, SRA, ArrayExpress, Zenodo, Dataverse 등에 잘 범용 수치 데이터 포맷: hdf5, csv, txt 임시 수치 데이터 포맷: feather 정리해서 올린다. 비손실 압축: gzip, lzo, xz, zstd

  16. Version Control System

  17. Version Control System https://betterexplained.com/articles/intro-to-distributed-version-control-illustrated/

  18. Version Control System Delta Debugging https://betterexplained.com/articles/intro-to-distributed-version-control-illustrated/

  19. Distributed Version Control https://betterexplained.com/articles/intro-to-distributed-version-control-illustrated/

  20. GitHub

  21. GitLab

  22. https://learngitbranching.js.org

  23. Containers Virtual Environments

  24. 의존성 https://computation.llnl.gov/projects/spack-hpc-package-manager

  25. http://www.ramnationwide.com/proper-packaging-of-computers-and-other-electronic-devices/http://www.ramnationwide.com/proper-packaging-of-computers-and-other-electronic-devices/

  26. 컨테이너가 뭐야? 가상화 컨테이너 https://www.electronicdesign.com/dev-tools/what-s-difference-between-containers-and-virtual-machines

  27. 컨테이너, 가상화, 가상환경? 가상화 (hypervisor) 가상환경 컨테이너 (virtual environment) 대부분 OS 서비스, 일 부 에뮬레이션 또는 바 이패스 에뮬레이션 또는
 바이패스 하드웨어 OS 서비스 메모리 분리 공유 공유 커널 분리 공유 공유 분리 파일시스템 레이어로 분리 공유 (하드웨어 수준에서 가상화) 분리 (docker) 또는
 공유 (singularity) 분리
 네임스페이스 공유 (운영체제 수준에서 분리) 시스템
 라이브러리 분리 (conda) 또는
 공유 (virtualenv) 분리
 분리 (운영체제 수준에서 분리)

  28. 컨테이너 배포와 패키지 배포 소스코드다운로드 사이트 없어짐 의존성패키지설치 끊임없는 의존성 순환고리 컨테이너다운로드 호환성 깨짐 빌드/설치 너무 스트레 스를 받아서 잠깐 쉼 운영체제랑 안 맞음 실행 사용 뭔지 모를 에러 의존성 빠짐 런타임에만 발생하는 호환성 에러 “나는 되는데?”라고 원저자가 답장함

  29. Singularity: Scientific containers for mobility of compute Image permissions. The treatment of Singularity images as standard files simplifies man- agement and access controls to well known POSIX based file permission. If you either own a container image, or have read access to that container image, you can start a shell inside that image. If you wish to disable or limit access to a shared image, you simply change the permis- sion ACLs to that file. Security. Singularity does not provide a pathway for privilege escalation (which makes it truly applicable for multi-tenant shared scientific compute resources). This means that in the runtime environment, a user inside a Singularity container is the same user as outside the con- tainer. If a user wants to be root inside the container, they must first become root outside the container. Considering on most shared resources the user will not have root access means they will not have root access within their containers either. This simple concept thus defines the Singularity usage workflow. For more technical details, we direct the reader to our administrative documentation (http://singularity.lbl.gov). Singularity usage workflows The standard usage workflow for working with an image typically means the user develops it locally on his or her own resource (laptop, workstation, virtual machine, etc), optionally com- presses it, and moves it to another filesystem that has Singularity installed to run. If the user does not have root on that system, he or she will not be able to make any changes to the image once on that system. However, the user will be able to use the container and access the data and files outside the container as easily as he or she would on the original system or virtual machine where the image was developed. Images can serve as stand-alone programs, and can be executed like any other program on the host. The general workflow moves from development on an endpoint to a shared computational resource (Fig 1). One the left side, there is an endpoint that the user controls. This is typically a laptop, workstation, or server. In this space the user can create, modify, and update a container as needed. Once a container is created with the necessary applications, libraries and data inside, it can be easily shared to other hosts and executed without having root access. Making changes to the container again requires returning to the endpoint system with root, and re- Singularity Fig 1. Singularity usage workflow. The standard Singularity Usage Workflow involves a working endpoint (left) where the user has root, and a container can be created, modified and updated, and then transferred to a shared computational resource (right) to be executed at scale. https://doi.org/10.1371/journal.pone.0177459.g001 Kurtzer, Sochat and Bauer (2017) PLOS ONE PLOS ONE | https://doi.org/10.1371/journal.pone.0177459 May 11, 2017 11 / 20

  30. https://medium.freecodecamp.org/why-you-need-python-environments-and-https://medium.freecodecamp.org/why-you-need-python-environments-and- how-to-manage-them-with-conda-85f155f4353c

  31. Continuous Integration

  32. Incremental & full build

  33. Travis CI Jenkins CI Buildbot

  34. 빌드 환경 준비 자동 빌드, 에러 보고 자동 테스트, 릴리스

  35. JupyterLab (실습 세팅)

  36. Nanopore direct RNA sequencing 신호 보기 1. 왼쪽 바 에서 notebooks > nanopore-dRNA.ipynb 열기 2. 오른쪽에 열리면 메뉴 Run > Run All Cells 맨 아래까지 그림이 나오면 통과~

  37. 따라하기 1: 다른 범위로 옮겨서 보기 숫자를 이리 바꿔보면서 Shift-Enter

  38. 도전 1: 퓨린/피리미딘 비율 조절해보기

  39. 도전 2 평균적으로 가장 전류가 높은 kmer, 평균적으로 가장 전류가 낮은 kmer는? 도전 3 Migration 속도가 가장 일정하지 않은 kmer는?

  40. Workflow automation

  41. -i 25 -p 5 > YB ACGATA CAGAG GCGCCG > YB ….(())... (()).......(. 123.52 /bin/bash .csv YB, 12 ENO1, 24 GAPDH, 1 PKA2, 122 > EN GACACA GGGGGC TACACA >ENO ....((()))) ().....(()).. 243.42 the following day 2 weeks later .. Can you just quickly add another sequence! Let’s change the parameter p to 4! > AR GGGGCC CATAC ACACAA © Thomas Schwarzl, 2016

  42. -i 25 -p 4 > YB ACGATA CAGAG GCGCCG > YB ….(())... (()).......(. 123.52 /bin/bash .csv YB, 12 ENO1, 24 GAPDH, 1 PKA2, 122 > EN GACACA GGGGGC TACACA >ENO ....((()))) ().....(()).. 243.42 > AR GGGGCC CATAC ACACAA Logs > AR GGGGCC CATAC ACACAA Management with scripts (Bash, Perl, Python, .. ) © Thomas Schwarzl, 2016

  43. make(1)

  44. -i 25 -p 4 > YB ACGATA CAGAG GCGCCG GGGGGC TACACA TACACA TACACA TACACA TACACA TACACA TACACA TACACA > EN GACACA > EN GACACA GACACA GACACA GACACA GACACA GACACA GACACA /bin/bash .csv > EN GACACA GGGGGC TACACA GGGGGC GGGGGC GGGGGC GGGGGC GGGGGC GGGGGC GGGGGC > YB ….(())... (()).......(. 123.52 243.42 >ENO ....((()))) ().....(()).. ....((()))) ().....(()).. 243.42 243.42 > EN > EN > EN > EN YB, 12 ENO1, 24 GAPDH, 1 PKA2, 122 >ENO >ENO ....((()))) ().....(()).. ().....(()).. 243.42 >ENO ....((()))) ....((()))) ().....(()).. 243.42 243.42 >ENO >ENO ....((()))) ().....(()).. ().....(()).. 243.42 > EN > EN > EN GACACA GGGGGC TACACA GGGGGC TACACA >ENO ....((()))) ....((()))) ().....(()).. 243.42 243.42 >ENO >ENO ....((()))) ().....(()).. ().....(()).. 243.42 > EN GACACA >ENO ....((()))) Logs Cluster Management with scripts (Bash, Perl, Python, .. ) © EMBL, 2016

  45. GNU autotools Also: scons cmake jam qmake ant rake

More Related