<commit_before>#!/usr/bin/env perl

use strict;
use warnings;

use FindBin;
use lib "$FindBin::Bin/../perl5", "$FindBin::Bin/../perl5-prereq", "$FindBin::Bin/../../perl5";

use Unison::WWW;
use Unison::WWW::Page qw(infer_pseq_id);
use Unison::WWW::Table;
use Unison::WWW::utilities qw(alias_link pseq_summary_link);

my $p = new Unison::WWW::Page;
my $u = $p->{unison};
my $v = $p->Vars();
$p->add_footer_lines('$Id: pseq_intx.pl,v 1.6 2005/12/07 23:21:02 rkh Exp $ ');

my $sql = qq/select pseq_id_b, sprot_b, best_annotation(pseq_id_b), pmid, interaction_detection_method
      from mint_v where pseq_id_a=$v->{pseq_id}/;

my $ar = $u->selectall_arrayref($sql);
my @f = ( 'Sequence', 'Swiss-Prot', 'Best annotation', 'PubMed', 'Interaction detection method', 'Link' );

my $sprot_a = $u->selectrow_array
  ("select alias from palias where origin_id=origin_id('Swiss-Prot') and pseq_id=$v->{pseq_id} and alias~'^[A-Z][0-9]+\$'");

# work right-to-left
do { $_->[5]= alias_link($_->[1],'Mint') } for @$ar;
do { $_->[3] = alias_link($_->[3],'Pubmed') } for @$ar;
do { $_->[1] = alias_link($_->[1],'Swiss-Prot') } for @$ar;
do { $_->[0] = pseq_summary_link($_->[0],"Unison:$_->[0]") } for @$ar;


print $p->render("Protein Interactions for Unison:$v->{pseq_id}",
				 $p->best_annotation($v->{pseq_id}),

				 '<p>',
				 ($sprot_a ? "Go to MINT with Unison:$v->{pseq_id}: ". alias_link($sprot_a,'Mint') 
				  : 'No interactions in MINT'),

				 '<p>',
				 $p->group("Unison:$v->{pseq_id} interacts with",
						   Unison::WWW::Table::render(\@f,$ar)),
				 $p->sql($sql)
				);
<commit_msg>replace Swiss-Prot with UniProtKB/Swiss-Prot<commit_after>#!/usr/bin/env perl

use strict;
use warnings;

use FindBin;
use lib "$FindBin::Bin/../perl5", "$FindBin::Bin/../perl5-prereq", "$FindBin::Bin/../../perl5";

use Unison::WWW;
use Unison::WWW::Page qw(infer_pseq_id);
use Unison::WWW::Table;
use Unison::WWW::utilities qw(alias_link pseq_summary_link);

my $p = new Unison::WWW::Page;
my $u = $p->{unison};
my $v = $p->Vars();
$p->add_footer_lines('$Id: pseq_intx.pl,v 1.7 2006/06/26 18:05:08 rkh Exp $ ');

my $sql = qq/select pseq_id_b, sprot_b, best_annotation(pseq_id_b), pmid, interaction_detection_method
      from mint_v where pseq_id_a=$v->{pseq_id}/;

my $ar = $u->selectall_arrayref($sql);
my @f = ( 'Sequence', 'UniProtKB/Swiss-Prot', 'Best annotation', 'PubMed', 'Interaction detection method', 'Link' );

my $sprot_a = $u->selectrow_array
  ("select alias from palias where origin_id=origin_id('UniProtKB/Swiss-Prot') and pseq_id=$v->{pseq_id} and alias~'^[A-Z][0-9]+\$'");

# work right-to-left
do { $_->[5]= alias_link($_->[1],'Mint') } for @$ar;
do { $_->[3] = alias_link($_->[3],'Pubmed') } for @$ar;
do { $_->[1] = alias_link($_->[1],'UniProtKB/Swiss-Prot') } for @$ar;
do { $_->[0] = pseq_summary_link($_->[0],"Unison:$_->[0]") } for @$ar;


print $p->render("Protein Interactions for Unison:$v->{pseq_id}",
				 $p->best_annotation($v->{pseq_id}),

				 '<p>',
				 ($sprot_a ? "Go to MINT with Unison:$v->{pseq_id}: ". alias_link($sprot_a,'Mint') 
				  : 'No interactions in MINT'),

				 '<p>',
				 $p->group("Unison:$v->{pseq_id} interacts with",
						   Unison::WWW::Table::render(\@f,$ar)),
				 $p->sql($sql)
				);

{'fraction_non_alphanumeric': 0.23558433549182856, 'fraction_numerical': 0.018501387604070305, 'mean_word_length': 4.651567944250871, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 55, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1265444', 'n_tokens_mistral': 1497, 'n_tokens_neox': 1355, 'n_words': 255}