Leser: 21
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/usr/bin/perl -w
use strict;
use Bio::Perl;
use Data::Dumper;
my @var;
my @gff;
my @fields;
my @results;
my $gff;
my $gfffilename;
my $string;
my $name;
my $line;
my $var;
my $score;
my $column;
@fields=();
@results=();
@var=();
@gff=();
my %score;
my $varfilename;
my $ref;
# sub routinen
###########################
sub read_gff_file {
print "Enter the filename of your input file with the single columns of your gff file:= ";
chomp( my $gfffilename=<STDIN> );
open my $gff_fh, '<', $gfffilename or die "$gfffilename Can not open file\n";
# only read first line
chomp( my $gff = <$gff_fh> );
return $gff;
}
sub open_var_file {
print "Enter the filename of your input file with the variants:= ";
chomp( my $varfilename=<STDIN> );
open my $var_fh, '<',$varfilename or die "$varfilename Can not open file\n";
return $var_fh;
}
sub do_my_job {
my @column = split(/\t/,&read_gff_file());
my $var_handle = open_var_file();
while ( my $line = <$var_handle> ) {
chomp $line;
# should reveal 3 fields like (A,A1,A2)
my @fields = split /\t/, $line;
my @result = @column;
splice(@result,2,0,@fields);
print join( ' ', @result ), "\n";
}
}
# main program
###########################
foreach (my $var_fh)
{
($name,$score) = split; # get score
$score{$_} = $score; # record it
}
print sort {
$score{$a} <=> $score{$b};
}
@var;
do_my_job();
1
2
3
4
5
NC_010109.1 NTRFinder motif_small_h 2298 2308 . . . ID=NTR-a1;Parent=NTR-a;Name=motif_small_b
NC_010109.1 NTRFinder motif_small_h 2309 2319 . . . ID=NTR-a1;Parent=NTR-a;Name=motif_small_b
NC_010109.1 NTRFinder motif_small_i 822 832 . . . ID=NTR-a1;Parent=NTR-a;Name=motif_small_b
NC_010109.1 NTRFinder motif_small_i 1598 1608 . . . ID=NTR-a1;Parent=NTR-a;Name=motif_small_b
NC_010109.1 NTRFinder motif_small_j 1723 1733 . . . ID=NTR-a1;Parent=NTR-a;Name=motif_small_b