Skip to content

Instantly share code, notes, and snippets.

@coela
Created July 4, 2012 09:47
Show Gist options
  • Save coela/3046417 to your computer and use it in GitHub Desktop.
Save coela/3046417 to your computer and use it in GitHub Desktop.
hoge.pl
use 5.14.2;
use warnings;
use Data::Dumper;
use SWISS::Entry;
use SWISS::IDs;
use JSON;
use GraphViz;
use GO::Parser;
use lib qw{../lib};
use UniProt;
use PhosphoSite;
my $uniprot = new UniProt('/Users/coela/projects/PhosphoViz/data/uniprot.tch',
'/Users/coela/projects/PhosphoViz/data/uniprot_ac.tch');
my $ps = new PhosphoSite("/Users/coela/projects/PhosphoViz/data/Kinase_Substrate_Dataset");
#create_nodeattr($ps,$uniprot);
#network2json7($ps,$ARGV[0]);
#network2graphviz($ps);
#network2siff($ps);
#create_nodeattr($ps,$uniprot);
sub create_json_cerebral {
sub create_json_cerebral {
my $ps = shift;
my $uniprot = shift;
my $file = shift;
open my $XGMML, '<', $file or die;
while (<$XGMML>) {
chomp;
if (/\<node label\="(\S+)" id="\S+">/){
say;
}
}
}
sub create_nodeattr {
my $ps = shift;
my $uniprot = shift;
say 'Subcellar localization';
for my $kinase ($ps->kinase()){
my $sub_local = get_subcelluar_localization($ps, $uniprot,$kinase);
if ($sub_local =~ /[Cc]ell [Jj]unction/) {
$sub_local = "Cell Junction";
}
elsif ($sub_local =~ /[Mm]embrane/) {
$sub_local = 'Membrane';
}
elsif ($sub_local =~ /[Cc]ytoplasm/) {
$sub_local = 'Cytoplasm';
}
elsif ($sub_local =~ /[Nn]ucleus/) {
$sub_local = 'Nucleus';
}
# say $kinase, ' = ', $sub_local;
say $sub_local;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment