(未完待续) 使用NGenomeSyn展示局部共线性

  1. 效果图


    红色箭头是高亮展示的基因

  1. nucmer比对与输入文件的准备
    这里我们使用mummer4
#按照我这个顺序.
#最终图片上的顺序也是从sppA, sppB到sppC和sppD.
nucmer --mum -t 10 sppA.fa sppB.fa -p sppA.sppB
nucmer --mum -t 10 sppB.fa sppC.fa -p sppB.sppC
nucmer --mum -t 10 sppC.fa sppD.fa -p sppC.sppD
...

#因为是局部共线性, 这里不进行序列相似度和长度的过滤
#我们保留唯一比对即可
#对每一个delta文件运行:
delta-filter -1 sppA.sppB.delta > sppA.sppB.1v1.delta
show-coords -H -c -l -o -r -T sppA.sppB.1v1.delta > sppA.sppB.1v1.coords

#对每一个coords文件运行:
bash coords2link.sh sppA.sppB.1v1.coords -l 1 > sppA.sppB.1v1.link
#这里的-l也是过滤比对长度的参数
#最后得到的sppA.sppB.1v1.link是NGenomeSyn所需要的第一个输入文件

#第二个输入文件是基因组的染色体长度:
#对每一个物种运行:
samtools faidx sppA.fa
awk '{print $1"\t""1""\t"$2}' sppA.fa.fai > sppA.length2
#sppA.length2就是NGenomeSyn所需要的第二个输入文件

#如果需要高亮某些区域
#准备一个bed文件,比如sppA.hilighted.bed:
#cat sppA.hilighted.bed
Chr2  100  60000  fill=red  stroke=red

cat coords2link.sh

#!/bin/bash

# 检查是否提供了正确的参数
if [ "$#" -ne 3 ] || [ "$2" != "-l" ]; then
    echo "Usage: $0 <input_file> -l <threshold>"
    exit 1
fi

input_file="$1"
threshold="$3"

awk -v threshold="$threshold" '{ 
    A = ($2 > $1) ? ($2 - $1) : ($1 - $2); 
    B = ($4 > $3) ? ($4 - $3) : ($3 - $4); 
    if (A > threshold && B > threshold) 
        print $12"\t"$1"\t"$2"\t"$13"\t"$3"\t"$4;
}' "$input_file"


2.软件网址:
https://github.com/hewm2008/NGenomeSyn

准备配置文件config.txt


©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容