User Tools

Site Tools


ont_sequencing_data_analysis

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ont_sequencing_data_analysis [2018/09/06 14:25] – [Official genome assembly, consensus, and polishing tools] hyjeongont_sequencing_data_analysis [2021/03/17 13:09] (current) – external edit 127.0.0.1
Line 3: Line 3:
   * MinION Mk1B (product code MIN-101B)   * MinION Mk1B (product code MIN-101B)
   * Flow cell: Spot-On Flow cell MkI (product code FLO-MIN106 R9)   * Flow cell: Spot-On Flow cell MkI (product code FLO-MIN106 R9)
-  * 구동용 컴퓨터: Xeon E5520 @2.27, 16 GB memory, Ubuntu 14.04.5 LTS+  * 구동용 컴퓨터 I: Xeon E5520 @2.27, 16 GB memory, Ubuntu 14.04.5 LTS. (uname -a 명령 시 4.4.0-134-generic #160~14.04.1-Ubuntu). USB 3.0 인터페이스 카드는 Via 805를 사용한 ipTIME PX300 Plus) MinKNOW v2.0.0으로 잘 동작. 
 +  * 구동용 컴퓨터 II: microbe server(Xeon E5-2640 x 2, SuperMicro X9DRI-F)에 같은 OS와 카드를 설치하였으나 인식이 되지 않음. /etc/default/grub 파일에서 GRUB_CMDLINE_LINUX를 다음과 같이 변경하고 sudo update-grub을 한 뒤 재부팅을 하면 된다고 하였으나([[https://bugzilla.redhat.com/show_bug.cgi?id=1376455|참고 1]] [[https://askubuntu.com/questions/812372/usb-3-0-express-card|참고 2]]) 여전히 여기에 꽂힌 USB 장비를 읽지 못함. 그러나 USB 3.0 카드를 다른 위치에 꽂으니 정상 작동함. 세상에 이럴 수가... 
 + 
 +  GRUB_CMDLINE_LINUX="iommu=soft" 
 +  GRUB_CMDLINE_LINUX_DEFAULT="quiet splash pciehp.pciehp_force=1" 
 + 
 +EPI2ME에서는 더 이상 basecall을 진행하지 않으므로 Albacore를 설치하여 local basecalling을 하라는 고객 센터의 알림이 있었다. 단, MinKNOW 설정 창의 Basecalling(Live or None 중에 선택)에서 나타나는 Live basecalling은 Albacore를 뜻하는 것이 아니라 1D  sequencing protocol을 위해 내장된 것이다. 파이썬 2.7과 3.5(Albacore)를 번갈아 이용해야 하므로 pyenv를 활용하는 것을 권장한다. 혹은 anaconda도 좋다. 
 +===== 새로 시작하기 ===== 
 +이 글은 2019년 5월 2일부터 작성하기 시작한다. 다음 섹션(처음에 해야 할 것) 이후의 글은 더 이상 유효하지 않다. MinKNOW를 이용하면 albacore를 별도로 설치하지 않아도 basecalling이 진행되고, 새로운 pomoxis에서는 wrapper script가 많은 것을 알아서 진행한다. 
 +==== Best long read mapper? ==== 
 +한동안 BWA-mem이 널리 쓰여 왔으나, 이제는 pomoxis에 포함되어 있는 minimap2가 최선인 것으로 보인다([[https://lh3.github.io/2018/04/02/minimap2-and-the-future-of-bwa|참고 글]]
  
-EPI2ME에서는 더 이상 basecall을 진행하지 않으므로 Albacore를 설치하여 local basecalling을 하라는 고객 센터의 알림이 있었다. 단, MinKNOW 설정 창의 Basecalling(Live or None 중에 선택)에서 나타나는 Live basecalling은 Albacore를 뜻하는 것이 아니라 1D  sequencing protocol을 위해 내장된 것이다. 파이썬 2.7과 3.5(Albacore)를 번갈아 이용해야 하므로 pyenv를 활용하는 것을 권장한다. 
 ===== 처음에 해야 할 것 ===== ===== 처음에 해야 할 것 =====
 ==== 프로그램 설치 ==== ==== 프로그램 설치 ====
Line 24: Line 33:
 ===== Official genome assembly, consensus, and polishing tools ===== ===== Official genome assembly, consensus, and polishing tools =====
 2017년 7월 30일 Nanopore Community를 통한 공지([[https://community.nanoporetech.com/posts/genome-assembly-consensus|링크]]) 2017년 7월 30일 Nanopore Community를 통한 공지([[https://community.nanoporetech.com/posts/genome-assembly-consensus|링크]])
-  * **Pomoxis**[[https://github.com/nanoporetech/pomoxis|링크]] is a suit of tools for working with nanopore data. [[https://github.com/lh3/minimap2|minimap2]], [[https://github.com/lh3/miniasm|miniasm]] and [[https://github.com/isovic/racon|Racon]]. Proxis는 다른 assembler보다 빠르며, consensus quality는 다른 community tool과 같은 수준이거나 더 좋다. Canu assembly 뒤 Racon으로 assembly quality를 향상시킬 수 있다고 한다. 전체를 실행하는 방법에 대해서는 [[https://faculty.washington.edu/sr320/?p=13602|Genome Assembly - minimap/minisam/racon Overview]] 웹문서를 참조하라. +  * **Pomoxis**[[https://github.com/nanoporetech/pomoxis|링크]] is a suit of tools for working with nanopore data. [[https://github.com/lh3/minimap2|minimap2]], [[https://github.com/lh3/miniasm|miniasm]] and [[https://github.com/isovic/racon|Racon]]. Proxis는 다른 assembler보다 빠르며, consensus quality는 다른 community tool과 같은 수준이거나 더 좋다. Canu assembly 뒤 Racon으로 assembly quality를 향상시킬 수 있다고 한다. 전체를 실행하는 방법에 대해서는 [[http://blog.genoglobe.com/2018/09/nanopore-sequencing-de-novo-assembly.html|[정해영의 블로그] Nanopore sequencing 결과물의 조립(de novo assembly)]] 또는 [[https://faculty.washington.edu/sr320/?p=13602|Genome Assembly - minimap/minisam/racon Overview]] 웹문서를 참조하라. 
-  * **Medaka** presents a framewalk for error correcting sequencing data. Proxis de novo assembly 후 polishing step으로 사용하며, 50x의 .bam alignment file이 필요하다.+  * **Medaka** [[https://github.com/nanoporetech/medaka|링크]] presents a framewalk for error correcting sequencing data. Proxis de novo assembly 후 polishing step으로 사용하며, 50x의 .bam alignment file이 필요하다.
  
  
Line 33: Line 42:
 만약 ONT cloud에서 basecall을 했다면(즉 Metrichor를 이용했다면) 업로드된 fast5 파일은 처리를 거쳐서 pass와 fail 디렉토리로 나뉘어 다운로드된다. pass에는 바코드에 의해 성공적으로 분리되고 사전에 정의된 threshold를 넘는 mean base quality score를 넘는 read들이 쌓인다. 만약 ONT cloud에서 basecall을 했다면(즉 Metrichor를 이용했다면) 업로드된 fast5 파일은 처리를 거쳐서 pass와 fail 디렉토리로 나뉘어 다운로드된다. pass에는 바코드에 의해 성공적으로 분리되고 사전에 정의된 threshold를 넘는 mean base quality score를 넘는 read들이 쌓인다.
 ===== QC using poretools ===== ===== QC using poretools =====
-[[https://poretools.readthedocs.io/en/latest/|portools]]를 사용하려면 basecall 정보가 담긴 fast5이 필요하므로, MinKNOW가 생성한 fast5 파일을 그대로 사용하면 안된다. 아래에서 설명한 바와 같이 Albacore를 사용하여 basecall을 한 fast5 파일을 먼저 만들도록 한다. 처음에는 이와 같은 사실을 몰라서 왜 첫 러닝한 fast5에 아무런 정보가 없는 것일까하고 무척 고민을 많이 하였다.+[[https://poretools.readthedocs.io/en/latest/|poretools]]를 사용하려면 basecall 정보가 담긴 fast5이 필요하므로, MinKNOW가 생성한 fast5 파일을 그대로 사용하면 안된다. 아래에서 설명한 바와 같이 Albacore를 사용하여 basecall을 한 fast5 파일을 먼저 만들도록 한다. 처음에는 이와 같은 사실을 몰라서 왜 첫 러닝한 fast5에 아무런 정보가 없는 것일까하고 무척 고민을 많이 하였다.
  
 poretools에서는 유용한 diagnostic plot을 만들어내는 기능이 있다. 그러나 십중팔구 다음과 같은 에러 메시지가 나올 가능성이 크다. 참고로 Tkinter는 파이썬 모듈, _tkinter는 C 모듈이다. poretools에서는 유용한 diagnostic plot을 만들어내는 기능이 있다. 그러나 십중팔구 다음과 같은 에러 메시지가 나올 가능성이 크다. 참고로 Tkinter는 파이썬 모듈, _tkinter는 C 모듈이다.
Line 77: Line 86:
   done   done
 ===== Mapping ===== ===== Mapping =====
-bwa 0.7.12-r1039, samtools 1.4.1 조건에서 다음을 실시하였다. BWA-MEM 'ont2d' 옵션은 버전 0.7.11부터 포함되었다.+bwa 0.7.12-r1039, samtools 1.4.1 조건에서 다음을 실시하였다. BWA-MEM 'ont2d' 옵션은 버전 0.7.11부터 포함되었다. samtools view의 옵션에서 -S는 입력이 SAM임을 명시하기 위함이다. 예전 버전의 samtools에서는 이를 꼭 지정해 주어야 하지만 요즘 버전은 자동으로 인식하므로 필요가 없다. 그러나 하위 호환성을 위해서 그대로 둔 것이다.
   $ bwa index reference.fasta   $ bwa index reference.fasta
-  $ bwa mem -x on2d reference.fasta sample2D.fasta | samtools view -bS - | samtools sort -o sample2D.sorted.bam+  $ bwa mem -x ont2d reference.fasta sample2D.fasta | samtools view -bS - | samtools sort -o sample2D.sorted.bam
   $ samtools index sample2D.sorted.bam   $ samtools index sample2D.sorted.bam
   $ samtools stats sample2D.sorted.bam > sample2D.stats.txt   $ samtools stats sample2D.sorted.bam > sample2D.stats.txt
Line 93: Line 102:
   * What was the average length of the reads?   * What was the average length of the reads?
  
-===== Assembly의 교정(Racon 사용) ===== +===== Assembly의 교정 ===== 
-Racon is intended as a standalone consensus module to correct raw contigs generated by rapid assembly methods which do not include a consensus step. Mapping file이 필요하다. Canu로 만든 assembly를 교정하는 사례는 음과 같.+==== Racon ==== 
 + 
 +[[https://github.com/isovic/racon|Racon]] is intended as a standalone consensus module to correct raw contigs generated by rapid assembly methods which do not include a consensus step. Racon의 실행에는 MHAP/PAF/SAM format의 overlap 정보가 필요하다. 이것은 반드시 염기서열 수준의 alignment가 필요함을 의미하는 것은 아니다. 
 + 
 +  $ racon [options ...] <sequences> <overlaps> <target sequences> 
 + 
 +Mapping file이 필요하다. Canu로 만든 assembly를 교정하는 사례를 생각해 보자. overlap 정보를 어떻게 만들 것인가? 
 +  - bwa를 사용? 그렇면 raw read 혹은 corrected (trimmed) reads? 
 +  - minimap2를 사용? 그렇면 raw read 혹은 corrected (trimmed) reads?
  
   $ bwa index CANU.unitigs.fasta   $ bwa index CANU.unitigs.fasta
-  $ bwa mem -x ont2 -t 16 CANU.unitigs.fasta ...+  $ bwa mem -x ont2 -t 16 CANU.unitigs.fasta ... (작성 예정) 
 +   
 +==== Medaka ==== 
 +https://github.com/nanoporetech/medaka https://nanoporetech.github.io/medaka/ 
 + 
 +python 3.5 환경이 필요하므로, conda py35 environment로 전환하여 설치하였다. 
 + 
 +  $ cd /data/apps/medaka/ # 설치한 뒤 
 +  $ source venv/bin/activate
 ===== NanoOK ===== ===== NanoOK =====
 [[https://documentation.tgac.ac.uk/display/NANOOK/NanoOK|NanoOK]](나눜이라고 읽는다)이란 ONT sequencing read의 전처리, 매핑, post-analysis 및 종합적인 QC를 실시하는 도구이다. 설치에 의존성이 필요하므로 Docker 이미지를 쓰는 것이 편리하다. [[https://documentation.tgac.ac.uk/display/NANOOK/NanoOK|NanoOK]](나눜이라고 읽는다)이란 ONT sequencing read의 전처리, 매핑, post-analysis 및 종합적인 QC를 실시하는 도구이다. 설치에 의존성이 필요하므로 Docker 이미지를 쓰는 것이 편리하다.
ont_sequencing_data_analysis.1536211510.txt.gz · Last modified: 2021/03/17 13:09 (external edit)