-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathest2geno_to_gtf.pl
executable file
·73 lines (50 loc) · 1.52 KB
/
est2geno_to_gtf.pl
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
#! /usr/bin/perl -w
use strict;
use EGlite;
use FAlite;
use POSIX;
my($filename) = @ARGV;
#my$dir = $ARGV[0];
#mask_genoseq($dir);
#sub mask_genoseq{
# my($tmpdir) = @_;
my@mask_txt = ();
# read in all *.out2 files (those contain my est2geno alignments, I guess you should change this)
# opendir (DIR, "$tmpdir");
# while (defined(my$file = readdir(DIR))){
#print "new file here\n";
# unless($file =~ /.*\.out2$/){next}
open(INF, $filename);
#open (INF, "$tmpdir\/$file")||die "cannot open file";
if(my $report = new EGlite(\*INF)){
my$genome = $report->genome;
my($est) = $report->est;
my$orientation= '-';
my$orient = $report->genomeDirection;
if($orient eq "forward"){
$orientation = '+';
}
my%maskexons = ();
my@intron_sizes=();
my@exon_sizes=();
while(my $element = $report->nextElement) {
# skip introns
if($element->type eq "INTRON"){
next;
}
# the other elements are exons
my$start = $element->genomeBegin;
my$end = $element->genomeEnd;
print "sometext\tPMASK\tCDS\t$start\t$end\t\.\t$orientation\t\.\tgene_id \"${filename}\"\; transcript_id \"${filename}\"\;\n";
push (@mask_txt,
"sometext\tPMASK\tCDS\t$start\t$end\t\.\t$orientation\t\.\tgene_id \"${filename}\"\; transcript_id \"${filename}\"\;\n");
}
# if there is no readable file in the *out2: issue warning
}else{
# print STDERR "$tmpdir\/$file is empty or has wrong format\n";
}
close INF;
# }
# closedir DIR;
# print @mask_txt;
#}