리눅스 기초 #12 BWA mapping

 

기초 #1~기초 #11까지 모두 수행하면, BWA mapping을 할 수 있는 기본적인 형태가 완성됨. 


1) 폴더 생성해주기 (본 예제와 동일하게 작동하게 하기 위해서는 동일한 폴더 이름으로 작동해야 편리함)

mkdir -p demo/supporting files, demo/VC, demo/supporting_files/hg38_re, demo/VC/alinged_reads, demo/VC/reads, demo/VC/data


2) 경로 지정해주기

ref="reference 파일 위치"
aligned_reads="mapping이 끝난 이후, 저장할 위치"
reads="fasta raw 파일 위치"
results="최종 결과 저장 위치"
alias gatk="/home/sj/Downloads/gatk-4.3.0.0/gatk"


예)

ref="/home/sj/Desktop/demo/supporting_files/hg38_chr1/chr1.fa"
aligned_reads="/home/sj/Desktop/demo/VC/aligned_reads_first"
reads="/home/sj/Desktop/demo/VC/reads_first"
results="/home/sj/Desktop/demo/VC/result_first"
data="/home/sj/Desktop/demo/VC/data"

alias gatk="/home/sj/Downloads/gatk-4.3.0.0/gatk"


3) BWA로 mapping과 samtool이용하여 bam file 까지 형성
    (3)의 과정은 indexing이 모두 끝나야 진행 가능함 [참고 #9~#11]


아래의 명령어를 한 줄로 입력 

bwa mem -t 4 -R "@RG\tID:1\tPL:ILLUMINA\tSM:1"
${ref} ${reads}/[fasta file이름_foward방향]
${reads}/[fasta file이름_reverse방향]
| samtools sort > ${aligned_reads}/[bam file 형성 이름]


예)

bwa mem -t 4 -R "@RG\tID:1\tPL:ILLUMINA\tSM:1" ${ref} ${reads}/1_S1_L001_R1_001.fastq.gz ${reads}/1_S1_L001_R2_001.fastq.gz | samtools sort > ${aligned_reads}/1.bam



4) bai file 형성 

samtools index ${aligned_reads}/1.bam


제대로 작동하면, 위와 같이 작동

경로 들어가서 확인하면 bam file 만들어진 것 확인 가능함. 

댓글

이 블로그의 인기 게시물

#single cell sequencing 기초 분석 - #1 R 설치 및 package 설치

리눅스 기초 #10 GATK calling을 사용하기 위하여, reference file indexing하는 방법

Single cell 분석을 위한 package 소개