forked from gustavo11/GFFLib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgff_list_alt_splicing_based_on_intron_retention.pl
executable file
·72 lines (47 loc) · 1.91 KB
/
gff_list_alt_splicing_based_on_intron_retention.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
72
#!/bin/env perl
use strict;
use FindBin;
use lib "$FindBin::Bin";
use GFFFile;
use GFFUtils;
# List issues like this
# Current model |||||-----||||||||----------||||||
# Final model |||||-----||||||||||||||||||||||||
# OR
# Current model |||||-----||||||||----------||||||
# Final model |||||-----|||||||||||||||||||||
# OR partial intron retentions
# Current model |||||-----||||||||----------||||||
# Transcript evidence with partial intron retention |||||-----|||||||||||
# Final model |||||-----|||||||||||
my $usage =
"$0 <GFF file> <log file>\n";
die $usage if scalar(@ARGV) != 2;
my $gffFile = $ARGV[0];
my $log_file = $ARGV[1];
print STDERR "Reading $gffFile ...\n";
my $gff_a = GFFFile::new($gffFile);
$gff_a->read();
my $gffAGenes = $gff_a->get_genes_hash();
open LOGFILE, ">$log_file" or die "Unable to open logfile $log_file\n";
print STDERR "Checking alt. splicing ...\n";
for my $gene_id ( keys %{$gffAGenes} ) {
my $gffTranscriptsA = $gffAGenes->{$gene_id}->get_transcripts_hash();
my $mainTranscript;
map {$mainTranscript = $gffTranscriptsA->{ $_ } if $_ =~ /.1$/ } keys %{$gffTranscriptsA};
for my $transcript_id ( keys %{$gffTranscriptsA} ) {
next if $transcript_id eq $mainTranscript->get_id();
my $altSplicing = $gffTranscriptsA->{$transcript_id};
if( GFFUtils::was_an_intron_partially_retained( $altSplicing, $mainTranscript ) ){
print LOGFILE $altSplicing->get_id() . "\n";
print OUT $altSplicing->get_id() . "\n";
next;
}
if( GFFUtils::was_an_intron_retained( $altSplicing, $mainTranscript ) ){
print LOGFILE $altSplicing->get_id() . "\n";
print OUT $altSplicing->get_id() . "\n";
next;
}
}
}
close(LOGFILE);