본문 바로가기
BioInformatics/Linux_Tools

Mapping - BWA2 & Samtools

by JoinInNoetic 2024. 4. 3.

(conda)

◆ Install

>>> conda install bioconda::bwa-mem2

>>> conda install bioconda::samtools

 

◆ Usage

1. Reference Index

>>> bwa-mem2 index -p 32GB reference.fasta

 

2. Mapping(Illumina)

>>> bwa mem -t 1 -R "@RG\tID:[ID 이름]\tSM:[샘플이름]\tPL:ILLUMINA"

 reference.fasta input_fwd.fastq input_rev.fastq > output_mapped.sam

 

* 추가설명

'@RG\tID:text\tSM:text\tPL:text'

@RG - sam header 중 RG 를 쓰겠다는 뜻..
\t - tab seperate
ID:text - ID section 에 text 를 집어넣겠다. RG header 를 쓸 때 필수.
DS:text - 설명문 넣겠음.
LB:text - library 이름을 넣겠음.
PL:text - Platform/technology 넣는 곳으로 GATK 에서 필수. CAPILLARY, LS454, ILLUMINA, SOLID, HELICOS, IONTORRENT, ONT, PACBIO 로 선점되어 있으니 맞는 거 골라써라.
PM:text - PL 과 비슷하나 좀더 상세 모델명을 쓸 수 있다. 자유롭게 쓰면 된다.
SM:text - sample name

 

3. Sam -> Bam 변환

>>> samtools view -Sb output_mapped.sam > output_mapped.bam

 

4. Sort

>>> samtools sort -o output_sorted.bam output_mapped.bam

 

5. Bam Index - .bai 생성

>>> samtools index output_sorted.bam

'BioInformatics > Linux_Tools' 카테고리의 다른 글

Variant Calling - Clair3  (0) 2024.04.03
Mapping - Bowtie2 & Samtools  (0) 2024.04.03
Mapping - BBmap & Samtools  (0) 2024.04.03
Quality Check - FastQC  (0) 2024.04.03
Trimming - Trimmomatic & BBduk  (0) 2024.04.01