bioinfo:microbial_varaint_calling
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
bioinfo:microbial_varaint_calling [2023/06/28 13:24] – removed - external edit (Unknown date) 127.0.0.1 | bioinfo:microbial_varaint_calling [2023/06/28 14:47] (current) – [Varifier] hyjeong | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Microbial variant calling ====== | ||
+ | BAM file을 정렬 및 인덱싱한 뒤 bcftools(SAMtools와 같이 설치됨)을 실행한다. BAM file은 sort가 먼저 되어 있어야 인덱싱이 가능하다. | ||
+ | $ samtools faidx GCF_000017985.1_ASM1798v1_genomic.fna | ||
+ | $ samtools index BL21_sorted.bam | ||
+ | $ bcftools mpileup -f GCF_000017985.1_ASM1798v1_genomic.fna BL21.bam | bcftools call --ploidy 1 -mv -Ob -o calls.bcf | ||
+ | |||
+ | BCF 파일의 필터링 기법은 [[https:// | ||
+ | |||
+ | $ bcftools view -i ' | ||
+ | $ bcftools filter -sLowQual -g3 -G10 -e' | ||
+ | | ||
+ | ===== Variant annotation ===== | ||
+ | 염기서열 변이가 실제로 유전자 산물의 기능에 어떠한 영향을 미치는지를 예측하려면 [[https:// | ||
+ | |||
+ | REL606.genome : REL606 | ||
+ | $ java -jar / | ||
+ | |||
+ | 위 단계에서 생성한 VCF 파일의 첫번째 필드에 보이는 서열 ID에서 버전 번호(.1)를 제거한다. REL606의 경우는 다음과 같이 한다. | ||
+ | |||
+ | $ sed -e ' | ||
+ | |||
+ | VCF 파일에 대한 annotation을 실시한다. | ||
+ | |||
+ | $ java -jar / | ||
+ | |||
+ | 현 디렉토리에 생기는 snpEff_genes.txt 및 snpEff_summary.html 파일도 참조한다. | ||
+ | |||
+ | ===== Picard와 GATK(Genome Analysis Tool Kit) ===== | ||
+ | [[https:// | ||
+ | |||
+ | |||
+ | ===== Snippy를 이용한 간편한 변이 탐색 ===== | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | 한 쌍의 fastq file을 이용하여 snippy를 실행하는 사례는 다음과 같다. | ||
+ | |||
+ | $ snippy --cpus 16 --outdir mysnps --ref REL606.gbk --R1 SRR2014531_1.fastq --R2 SRR2014531_2.fastq | ||
+ | |||
+ | mysnps/ | ||
+ | |||
+ | samtools faidx reference/ | ||
+ | | ||
+ | bwa index reference/ | ||
+ | | ||
+ | mkdir -p reference/ | ||
+ | | ||
+ | ln -sf reference/ | ||
+ | | ||
+ | ln -sf reference/ | ||
+ | | ||
+ | mkdir -p reference/ | ||
+ | | ||
+ | snpEff build -c reference/ | ||
+ | | ||
+ | bwa mem -Y -M -R ' | ||
+ | | ||
+ | samtools index snps.bam | ||
+ | | ||
+ | fasta_generate_regions.py reference/ | ||
+ | | ||
+ | freebayes-parallel reference/ | ||
+ | | ||
+ | bcftools view --include ' | ||
+ | | ||
+ | snpEff ann -noLog -noStats -no-downstream -no-upstream -no-utr -t -c reference/ | ||
+ | | ||
+ | snippy-vcf_to_tab --gff reference/ | ||
+ | | ||
+ | snippy-vcf_extract_subs snps.filt.vcf > snps.subs.vcf | ||
+ | | ||
+ | bcftools convert -Oz -o snps.vcf.gz snps.vcf | ||
+ | | ||
+ | bcftools index -f snps.vcf.gz | ||
+ | | ||
+ | bcftools consensus -f reference/ | ||
+ | | ||
+ | bcftools convert -Oz -o snps.subs.vcf.gz snps.subs.vcf | ||
+ | | ||
+ | bcftools index -f snps.subs.vcf.gz | ||
+ | | ||
+ | bcftools consensus -f reference/ | ||
+ | | ||
+ | rm -f snps.subs.vcf.gz snps.subs.vcf.gz.csi snps.subs.vcf.gz.tbi | ||
+ | |||
+ | 동일한 reference에 대하여 여러 쌍의 sequence read(single end read나 assembled contig도 무관)를 반복하여 분석한 뒤 core genome SNP alignment를 추출해야 하는 경우에는 snippy-multi를 이용하는 것이 편리하다. Tab-delimited file(‘input.tab’)에 샘플과 read file(혹은 contig sequence file) 정보를 수록한 뒤 snippy-multi를 실행하면 실행 가능한 스크립트가 생성된다. Input.tab 파일의 사례는 다음과 같다. 파일은 압축 여부에 상관없이 사용할 수 있다. | ||
+ | |||
+ | # input.tab = ID R1 [R2] | ||
+ | Isolate1 / | ||
+ | Isolate1b / | ||
+ | Isolate1c / | ||
+ | # single end reads supported too | ||
+ | Isolate2 / | ||
+ | Isolate2b / | ||
+ | # or already assembled contigs if you don't have reads | ||
+ | Isolate3 / | ||
+ | Isolate3b / | ||
+ | |||
+ | Input.tab 파일을 인수로 사용하여 snippy-multi를 실행하여 다음과 같이 실행용 스크립트 runme.sh를 만들고 이를 별도로 실행하면 된다. 아래의 실행 사례는 Genetic characterization and comparison of // | ||
+ | |||
+ | $ snippy-multi input.tab --ref reference.gbk | ||
+ | $ sh ./runme.sh | ||
+ | …(중간 생략)… | ||
+ | Generating core.full.aln | ||
+ | Creating TSV file: core.txt | ||
+ | Running: snp-sites -c -o core.aln core.full.aln | ||
+ | Have a suggestion? Tell me at http:// | ||
+ | Done. | ||
+ | $ cat core.txt # alignment/ | ||
+ | ID LENGTH ALIGNED UNALIGNED VARIANT HET MASKED LOWCOV | ||
+ | Af650 4155278 4047142 106918 223 68 0 1150 | ||
+ | Aichi2011 4155278 3438770 602285 62463 1247 0 112976 | ||
+ | Ehime2011 4155278 581072 1113528 12161 119 0 2460559 | ||
+ | Fukuoka2010 4155278 3556374 505508 5832 2243 0 91153 | ||
+ | Ibaraki2007 4155278 3443909 515634 5822 767 0 194968 | ||
+ | Iwate2007 4155278 3555971 497487 5825 3201 0 98619 | ||
+ | Iwate2008 4155278 3631759 500401 5821 4033 0 19085 | ||
+ | Miyagi2006 4155278 2572053 637580 6420 991 0 944654 | ||
+ | Miyagi2006-01 4155278 1408615 757847 6215 335 0 1988481 | ||
+ | NCTC2916 4155278 2880942 519180 5299 747 0 754409 | ||
+ | Okayama2011 4155278 3009491 1062954 21982 3860 0 78973 | ||
+ | Tochigi2008 4155278 3529946 592005 5285 1369 0 31958 | ||
+ | Reference 4155278 4155278 0 0 0 0 0 | ||
+ | |||
+ | Runme.sh 스크립트에서는 주어진 reference에 대하여 각 샘플을 snippy로 분석한 다음 모든 결과물에 대하여 snippy-core 명령을 실행하게 만든다. 바로 이 명령이 core genome SNP alignment를 산출하는 것이다. Snippy-core의 결과 파일은 전부 ' | ||
+ | |||
+ | Core genome alignment를 후처리하여 계통수를 작성하는 방법은 다음과 같다. | ||
+ | |||
+ | $ snippy-clean_full_aln core.full.aln > clean.full.aln | ||
+ | $ conda activate nanopore # gubbins 실행을 위해 conda nanopore 환경으로 진입 | ||
+ | (nanopore) $ run_gubbins.py -p gubbins clean.full.aln # -p < | ||
+ | (nanopore) $ conda deactivate # conda base 환경으로 돌아옴 | ||
+ | $ snp-sites -c gubbins.filtered_polymorphic_sites.fasta > clean.core.aln | ||
+ | $ fasttree -gtr -nt clean.core.aln > clean.core.tre | ||
+ | |||
+ | Run_grubbins.py를 거치고 나면 일부 샘플이 제거되는 일이 벌어지기도 한다. 이는 gap이 너무 많은 taxon을 제거하는 동작 때문일 것이다(--filter_percentage <%> 또는 -f < | ||
+ | |||
+ | Gubbins의 분석 결과는 [[http:// | ||
+ | |||
+ | ===== MUMmer(dnadiff) 또는 minimap2을 이용한 변이 탐색 ===== | ||
+ | Reference와 이리 조립된 염기서열을 비교하여 변이를 탐색하는 방법에 대해서는 별도로 작성한 문서 [[bioinfo: | ||
+ | |||
+ | ===== Varifier ===== | ||
+ | 박테리아의 유전체가 갖는 고유 특성(mosaic) 때문에 core genome을 기반으로 하는 SNP 분석으로는 만족할 만한 결과를 얻기 어렵다. 2021년 Genome Biology에 발표된 [[https:// | ||
+ | |||
+ | make_truth_vcf는 두 개의 유전체 염기서열 파일(G1 & G2)을 인수로 갖는다. dnadiff와 minimap2/ | ||
+ | |||
+ | usage: varifier make_truth_vcf [options] < |