반응형

python Platypus.py callVariants --bamFiles=input.bam --refFile=ref.fa --output=VariantCalls.vcf



출처: http://3months.tistory.com/155 [Deep Play]


python Platypus.py callVariants --bamFiles=input.bam --refFile=ref.fa --output=VariantCalls.vcf



출처: http://3months.tistory.com/155 [Deep Play]


python Platypus.py callVariants --bamFiles=input.bam --refFile=ref.fa --output=VariantCalls.vcf



출처: http://3months.tistory.com/155 [Deep Play]

Platypus 설치 확인


platypus 설치하기 링크 : 3months.tistory.com/155


platypus를 설치하였으면 아래 명령어를 통해 variant calling을 하여 플라티푸스가 잘 설치되었는지 확인해보자.


python Platypus.py callVariants --bamFiles=input.bam --refFile=ref.fa --output=VariantCalls.vcf

출처: http://3months.tistory.com/155 [Deep Play]
python Platypus.py callVariants --bamFiles=input.bam --refFile=ref.fa --output=VariantCalls.vcf

출처: http://3months.tistory.com/155 [Deep Play]


python Platypus.py callVariants --bamFiles=input.bam --refFile=ref.fa --output=VariantCalls.vcf



출처: http://3months.tistory.com/155 [Deep Play]

amFiles=input.bam --refFile=ref.fa --output=VariantCalls.vcf


플라티푸스 폴더에 들어가서 저 명령어를 실행하는 것인데,

이 때, 1개 이상의 BAM 파일을 인풋으로 제공할 수 있으며, reference file은 fast파일로 제공하면된다.

또한 BAM 파일은 samtools나 이와 비슷한 프로그램으로 indexing이 되어있어야하며,

FASTA 파일도 마찬가지로 "samtools faidx" 나 이와



출처: http://3months.tistory.com/155 [Deep Play]

amFiles=input.bam --refFile=ref.fa --output=VariantCalls.vcf


플라티푸스 폴더에 들어가서 저 명령어를 실행하는 것인데,

이 때, 1개 이상의 BAM 파일을 인풋으로 제공할 수 있으며, reference file은 fast파일로 제공하면된다.

또한 BAM 파일은 samtools나 이와 비슷한 프로그램으로 indexing이 되어있어야하며,

FASTA 파일도 마찬가지로 "samtools faidx" 나 이와



출처: http://3months.tistory.com/155 [Deep Play]

python Platypus.py callVariants --bamFiles=input.bam --refFile=ref.fa --output=VariantCalls.vcf



출처: http://3months.tistory.com/155 [Deep Play]

python Platypus.py callVariants --bamFiles=input.bam --refFile=ref.fa --output=VariantCalls.vcf



출처: http://3months.tistory.com/155 [Deep Play]

python Platypus.py callVariants --bamFiles=input.bam --refFile=ref.fa --output=VariantCalls.vcf



출처: http://3months.tistory.com/155 [Deep Play]

python Platypus.py callVariants --bamFiles=input.bam --refFile=ref.fa --output=VariantCalls.vcf


(이 명령어를 실행하기 전에 전에 samtools를 활용해 bam 파일과 fasta 파일의 인덱스 파일을 만들어 놓아야한다.)



실행 에러


간단한 sample 데이터로 위 명령어를 실행하니


ImportError: libhts.so.2: cannot open shared object file: No such file or directory


라는 에러메시지가 출력되면서 실행되지 않았다. 찾아보니 htslib의 라이브러리 경로가 제대로 지정되지 않았기 때문이라고 한다.


https://github.com/andyrimmer/Platypus


위 링크를 보고 해결하였는데 htslib를 설치하면 /usr/local 폴더에 htslib 가 설치되는데 여기서 /usr/local/lib와 /usr/local/include 폴더의 라이브러리 경로를 잡아주어야 한다.

export C_INCLUDE_PATH=/usr/local/include
export LIBRARY_PATH= /usr/local/lib
export LD_LIBRARY_PATH=/usr/local/lib

bash 에서 위 명령어를 실행하여 라이브러리 경로를 잡아주고 다시 실행하니 잘 실행이 되는 것을 볼 수 있다.



그러면 실제 데이터로 variant calling을 해보자.

http://hgdownload.cse.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeUwRepliSeq/


위 링크에서 아무거나 골라서 bam 파일과 인덱스 파일을 다운받는다.

그리고 hg19의 chromosome1 fasta file을 다운받는다. http://hgdownload.cse.ucsc.edu/goldenPath/hg19/chromosomes/


그리고 chromosome1의 variant 만 확인하기 위해 bam 파일에서 chromosome1의 시퀀스만 뽑아낸다.


samtools view -b sample.bam chr1 > sample_ch1.bam


위 명령어를 통해 bam 파일에서 ch1 부분만 뽑아낼 수 있다.  그리고 이 bam 파일에서 인덱스 파일을 생성한다.


samtools index sample_ch1.bam


그러면 sample_ch1.bam.bai 파일이 생성되며 준비가 끝났다.


또한 hg19의 chr1 fasta 파일도 인덱스 파일을 생성해준다.


samtools faidx chr1.fasta


이제 플라티푸스 명령어를 돌리기 위한 준비가 끝났다.


python Platypus.py callVariants --bamFiles=sample_ch1.bam --refFile=chr1.fa --output=VariantCalls.vcf



실행되는 모습


생성된 VariantCalls.vcf 파일

반응형

'Domains > Bioinformatics' 카테고리의 다른 글

Lastz 실행  (0) 2017.08.13
Lastz 설치 및 테스트  (0) 2017.08.07
bam 파일 인덱싱  (0) 2017.08.07
platypus 설치  (0) 2017.08.07
samtools 설치시 에러 해결  (0) 2017.07.16
반응형