목적
- Bam 파일을 Rsamtools 혹은 pysam으로 열려면 index 파일(.bai)이 해당 위치에 함께 있어야 함
- index 파일(.bai)을 만들기 위해서는 먼저 sort를 진행해야 함 (sort된 bam에서 index가 만들어짐)
Sort
samtools sort input.bam -o input_sorted.bam
Index
samtools index input.bam
- input 파일만 넣으면 동명의 .bam.bai 파일이 생성됨
출처
https://hhj6212.github.io/biology/tech/2020/10/18/samtools.html