IGV的使用
IGV需要的文件:比对文件为 bam和bam.bai文件
参考基因组文件为 .fa文件
比对文件处理:sam -> bam
-> bam.sorted
-> bam.bai
(三步)
代码:samtools view-bS abc.sam>abc.bam (最终samtools view -Sb -T /mnt/S30/database/tair10/tair10.fa one_pair._2sam >sample_with_header.bam)
samtools sort tmp.bam -o tmp.bam.sort (最终 samtools sort sample_with_header.bam -o sample_with_header.bam.sort)
【修改:注意因为要从服务器下到windows上看,最好把它写成xxx.bam,不然windows识别不出】
samtools index abc.bam.sort (最终 samtools index sample_with_header.bam.sort)
实操:
问题1

解决方法:pysam有加header的方法,这次先手动复制。 不行
samtools view -Sb -T genome.fa sample_no_header.sam >sample_with_header.bam(https://flystar233.github.io/2018/11/20/sam-header/) 成功


另记:bam没header时也有办法加


不能用 -n

否则会出以下错误:

IGV使用注意:
1.文件路径不能有中文
2.bam和.bai文件同时都需要,放一个文件夹比较好。

全部加载后双击能查看


下一步是解读结果。目前看似乎是接近想要的结果。