美文网首页
SV变异韦恩图

SV变异韦恩图

作者: 花生学生信 | 来源:发表于2024-03-04 15:45 被阅读0次

想知道每个样本与参考基因组比对特有或者共有的结构变异信息,这里提取每个样本结构变异的特征列,需要的代码如下:

###提取特征列,过滤掉低质量的,严格点需要计算每个SV的长度/终点信息,这里偷个懒,只看SV的起点
###tiq.pl
#!/usr/bin/perl

use strict;
use warnings;

my $input_filename = $ARGV[0];
my $output_filename = $ARGV[1];

open(my $input_file, '<', $input_filename) or die "Cannot open input file: $!";
open(my $output_file, '>', $output_filename) or die "Cannot open output file: $!";

while (my $line = <$input_file>) {
    chomp($line);
    if ($line =~ /^#/) {
        next;  # Skip header lines starting with '#'
    }
    my @columns = split("\t", $line);
    if ($columns[6] eq "PASS") {
        my $output_line = join("\t", $columns[0], $columns[1], $columns[4], $columns[6]) . "\n";
        print $output_line;
        print $output_file $output_line;
    }
}

close $input_file;
close $output_file;
###提取所有变异特征列
cat id |while read id
do
perl tiq.pl $id.vcf ALL/$id.txt
done

####提取INS,DEL、DUP、INV改成对应字符即可
cat id|while read id 
do
grep '<INS>' ALL/$id.txt >INS/$id.ins.txt
done

####提取BND
cat id|while read id 
do
grep -v -E '(DEL|INV|DUP|INS)' ALL/$id.txt >BND/$id.bnd.txt
done

找一个可以做veeny的网站
Venny 2.1.0 (csic.es)

保留每个集合的特征列,输入网站 韦恩图

韦恩图一般可以展示5、6个集合,如果想展示更多的集合,建议使用upset图。

相关文章

网友评论

      本文标题:SV变异韦恩图

      本文链接:https://www.haomeiwen.com/subject/pofrzdtx.html