gff文件提取cds
2024-08-25 00:54:13
#!/usr/bin/perl use strict;
use warnings;
########input######## my $gff = $ARGV[];my $cut = &cut($gff);my %cut = %$cut; my ($gene_number,$gene_id,$gene_name) = ($ARGV[],$ARGV[],$ARGV[]); #########main####### my %hash_2 = %{$cut{$gene_name}}; foreach my $key_2(keys %hash_2)
{
my @arr = $hash_2{$key_2};my $exon_start = $arr[][]+-;my $exon_end =$arr[][]-+; print "$gene_name\t$key_2\t$arr[0][0]\t$exon_start\n$gene_name\t$key_2\t$exon_end\t$arr[0][1]\n";
} #############sub################ sub cut
{
my %gene; my $exon = ;my $start = ;my $length = ; my $gff = shift;open GFF,"$gff"; while(my $line = <GFF>)
{
chomp $line; my @q = split /\s/,$line; if($q[] =~ /mRNA/)
{
$exon = ;$start = $q[];$length = ;
}
elsif($q[] =~ /CDS/)
{
$q[] =~ /Parent=(.*);S/m;my $key = $; my $new_length = $q[]-$q[]; $exon =~/(\w*)/; $gene{$key}{$} = [$length+,$length+$new_length]; $exon++; $length += $new_length;
}
}
return \%gene;
}
最新文章
- [C#] Control.Invoke方法和跨线程访问控件(转载)
- LINUX安全加固规范
- iOS 网络监测
- Ubuntu——";xxx is not in the sudoers file.This incident will be reported"; 错误解决方法
- 《DSP using MATLAB》示例Example5.3
- 在CentOS 7上安装Node.js的4种方法
- POJ - 1132Border
- Urlencode and Urldecode 命令行
- php 分享两种给图片加水印的方法
- C++ builder 操作Excel方法(据网上资料整理)
- Map 对象
- sap 设备cnsapwin不支持页格式*****
- Java经典编程题50道之二十四
- HIVE和HADOOP的一些东西
- 套接字输入缓冲装置——InternalInputBuffer
- 如何查看kernel社区的变更历史
- flask_socket_io中报错RuntimeError: You need to use the eventlet server. See the Deployment section of the documentation for more information.的解决办法
- solr配置ik中文分词(二)
- Ubuntu无法连接WiFi
- 【转载三】Grafana系列教程–Grafana的配置及运行