写了一个小脚本用来格式化数据格式,必须有正负链的深度文件,得到gtf的基因高亮区域,并且计算gc含量和geneskew:
#!/usr/bin/env perl
use warnings;
use strict;
use Getopt::Long;
my %opt;
GetOptions(\%opt, "len=s");
$opt{len} ||= 1000;
die qq/
Usage: perl $0 <contig.length> <ref.gtf> <ref.genome.fa> <plus.depth> <minus.depth> -len 1000(default 1000)
/ if(@ARGV < 4);
my %hash;
my %dp;
my (%gcp, %gs);
my $ci = 1;
my $cl = shift @ARGV;
open CL, $cl or die $!;
open KT, ">karyotype.txt" or die $!;
while(<CL>)
{
chomp;
my @tmp = split;
print KT "chr - hs$ci $tmp[0] 0 $tmp[1] color\n";
$hash{$tmp[0]} = "hs$ci";
push @{$dp{$tmp[0]}}, "0";
push @{$gcp{$tmp[0]}}, "0";
push @{$gs{$tmp[0]}}, "0";
$ci ++;
}
close CL;
my $j = 1;
my $gtf = shift @ARGV;
open GTF, $gtf or die $!;
open PO, ">plu