Skip to content

Commit 9229576

Browse files
committed
app: update Perl script to generate JSON files for the sift and polyphen versions, #TASK-5442, #TASK-5388
1 parent ea02c6f commit 9229576

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

cellbase-app/app/scripts/ensembl-scripts/protein_function_prediction_matrices.pl

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,37 @@
9191
#}
9292
#print join("=", $polyphen2->get_prediction(1, 'G'))."\n";
9393

94+
##################################################################
95+
96+
# Get the current time
97+
my ($sec, $min, $hour, $mday, $mon, $year) = localtime();
98+
# Adjust the year and month values (year is years since 1900, and month is 0-based)
99+
100+
$year += 1900;
101+
$mon += 1;
102+
103+
# Format the date and time
104+
my $formatted_date = sprintf("%04d%02d%02d_%02d%02d%02d", $year, $mon, $mday, $hour, $min, $sec);
105+
106+
my $jsonVersion = {};
107+
$jsonVersion->{"date"} = $formatted_date;
108+
$jsonVersion->{"data"} = "protein_substitution_predictions";
109+
$jsonVersion->{"version"} = "Ensembl 104";
110+
my @urls = ();
111+
push @urls, "ensembldb.ensembl.org:3306";
112+
$jsonVersion->{"url"} = \@urls;
113+
114+
print "Generating the JSON file for the Sift version.\n";
115+
$jsonVersion->{"name"} = "sift";
116+
open(FILE, ">".$outdir."/siftVersion.json") || die "error opening file\n";
117+
print FILE to_json($jsonVersion) . "\n";
118+
close(FILE);
119+
120+
print "Generating the JSON file for the PolyPhen version\n";
121+
$jsonVersion->{"name"} = "polyphen";
122+
open(FILE, ">".$outdir."/polyphenVersion.json") || die "error opening file\n";
123+
print FILE to_json($jsonVersion) . "\n";
124+
close(FILE);
94125

95126
my ($translation, $seq, $md5seq, @preds, @all_predictions);
96127
#my @transcripts = @{$transcript_adaptor->fetch_all_by_biotype('protein_coding')};

0 commit comments

Comments
 (0)