-->

GoogleSearch




Scientist. Husband. Daddy. --- TOLLE. LEGE
외부자료의 인용에 있어 대한민국 저작권법(28조)과 U.S. Copyright Act (17 USC. §107)에 정의된 "저작권물의 공정한 이용원칙 | the U.S. fair use doctrine" 을 따릅니다. 저작권(© 최광민)이 명시된 모든 글과 번역문들에 대해 (1) 복제-배포, (2) 임의수정 및 자의적 본문 발췌, (3) 무단배포를 위한 화면캡처를 금하며, (4) 인용 시 URL 주소 만을 사용할 수 있습니다. [후원 | 운영] [대문으로] [방명록] [옛 방명록] [티스토리 (백업)]

이 블로그 검색

KEGG highlighing

라벨:


KEGG Color Codes

Database category (see: KEGG overview)
KEGG top keggtop #f5e05f       #ffefaf
KEGG PATHWAY
KEGG BRITE
KEGG MODULE
kegg3 #005050       #e0f0e0
KEGG DISEASE
KEGG DRUG
KEGG ENVIRON
kegg5 #440066       #e4ddf8
KEGG ORTHOLOGY kegg4 #663300       #edddcd
KEGG GENES
KEGG GENOME
kegg1 #660033       #f0e0e4
KEGG LIGAND kegg2 #003366       #d4e4f0
GenomeNet gntop #000066       #ccccff

Functional category (used in global pathway maps and genome maps)
Carbohydrate metabolism      #0000ee
Energy metabolism      #9933cc
Lipid metabolism      #009999
Nucleotide metabolism      #ff0000
Amino acid metabolism      #ff9933
Metabolism of other amino acids      #ff6600
Glycan biosynthesis and metabolism      #3399ff
Metabolism of cofactors and vitamins      #ff6699
Metabolism of terpenoids and polyketides      #00cc33
Biosynthesis of other secondary metabolites      #cc3366
Xenobiotics biodegradation and metabolism      #ccaa99
Genetic information processing      #ffff00
Environmental information processing      #ffff00
Cellular processes      #ffff00
Organismal systems      #ffff00

KEGG PATHWAY
Organism-specific pathway      #bfffbf
Reference pathway (KO, EC, Reaction)      #bfbfff
KEGG module      #ffbfbf

Pathway mapping of two organisms (global map)
Organism 1      #00cc33
Organism 2      #ff3366
Organisms 1 and 2      #3366ff

Pathway mapping of multiple organisms (regular map)
Organism 1      #bfffbf
Organism 2      #ffbbcc
Organism 3      #bbccff
Organism 4      #cfffcf
Organism 5      #ffcfef
Organism 6      #cfefff
Organism 7      #dfefcf
Organism 8      #ffefcc
Organism 9      #dfccff
Organism 10      #dfdfcc

Last updated: July 23, 2012

#! /usr/bin/perl

#=================================================================
# Author : Kwangmin Choi 2004.1.1
# Script : highlight_kegg_map.pl
# Usage  : perl highlight_kegg_map.pl -p 00010 -g map -e white,blue,ko:K05344 -e white,red,ko:K01084 -o test.gif
# Comment: web interface for genome annotation (genome selection page)
# Comment: after installing perl -MCPAN -e 'install SOAP::Lite'
#          
#===============================================================
use warnings;
use strict;
use Getopt::Long;

#-------------
#
# parameters
#
#-------------

my ($path, $gnm, @ECs, $output);
GetOptions(
           'path:s'    => \$path,     # 00010
    'genome:s'  => \$gnm,      # eco
    'ec:s'      => \@ECs,      # -e white,blue,ec:1.1.1.1,ec:2.3.4.5 -e yellow,black,ec:4.4.4.3,ec:5.4.3.2
    'output:s'  => \$output,   # img.gif 
           );



if( !defined($path) or !defined($gnm)  or !defined($output) ){
    die "\n$0 -p [pathway(=00010)] -g [genome] -ec [fg_col,bg_col,ec:1.1.1.1,....] -e ......\n\n";
}




### only EC number(s) and path ID are provided.
my $url = &color_pathway_by_elements( \@ECs, $path );
`rm $output` if( -e $output );
`wget $url -O $output 2> /dev/null`;




sub color_pathway_by_elements {
    my ($ref_Array, $path) = @_;

    my @Array = @$ref_Array ;
    my @Node_list = ();
    my @F_color_list = ();
    my @B_color_list = ();

    foreach my $elm ( @Array ) {
        my @Nodes = split( /\,/, $elm );
        my $f_color = $Nodes[0];
        shift( @Nodes );
        my $b_color = $Nodes[0];
        shift( @Nodes );   # only ec
        push ( @Node_list, @Nodes );

        my @F_colors = &assign_color( \@Nodes, $f_color );
        my @B_colors = &assign_color( \@Nodes, $b_color );
        push (@F_color_list, @F_colors ); 
        push (@B_color_list, @B_colors );
    }


    use SOAP::Lite;
    my $wsdl = 'http://soap.genome.jp/KEGG.wsdl';
    my $serv = SOAP::Lite -> service($wsdl);
    

    #my $obj_list = SOAP::Data->type(array=>\@Node_list );
    #my $fg_list  = SOAP::Data->type(array =>\@F_color_list );
    #my $bg_list  = SOAP::Data->type(array =>\@B_color_list );

    my $obj_list = [@Node_list];
    my $fg_list  = [@F_color_list] ;
    my $bg_list =  [@B_color_list] ;

#    my $obj_list = ['ec:1.1.1.1'] ;
#    my $fg_list  = ['blue' ] ;
#    my $bg_list  = ['#ff0000'] ;


    my $result = $serv->color_pathway_by_objects("path:map$path", $obj_list, $fg_list, $bg_list);
    return $result;


}


sub assign_color {
    my ($ref_Array, $color) = @_;
    my @Array = @$ref_Array;
    my @Colors = ();
    foreach my $elm ( @Array ) {
 push( @Colors, $color );
    }
    return @Colors;
}



sub SOAP::Serializer::as_ArrayOfstring{
    my ($self, $value, $name, $type, $attr) = @_;
    return [$name, {'xsi:type' => 'array', %$attr}, $value];
}

sub SOAP::Serializer::as_ArrayOfint{
    my ($self, $value, $name, $type, $attr) = @_;
    return [$name, {'xsi:type' => 'array', %$attr}, $value];
}


# test purpose
sub get_html_of_colored_pathway_by_objects {

    use SOAP::Lite;
    my $wsdl = 'http://soap.genome.jp/KEGG.wsdl';
    my $serv = SOAP::Lite -> service($wsdl);

    my $obj_list = SOAP::Data->type(array => ['ec:1.1.1.1'] );
    my $fg_list  = SOAP::Data->type(array => ['blue' ] );
    my $bg_list  = SOAP::Data->type(array => ['#ff0000'] );
    my $result = $serv->get_html_of_colored_pathway_by_objects('path:map00010', $obj_list, $fg_list, $bg_list);
    print $result;
}


#
# using KEGG SOAP
#
#


library( KEGGSOAP )

xref = data.frame(cbind( entrez.noNA, symbol.noNA, fc.noNA) )
colnames(xref ) = c( 'entrez', 'symbol', 'foldChange' )
row.names( xref ) = entrez.noNA



keggGenes = NULL
#keggEntrez = NULL
#keggBGcolors = NULL
keggURLs = NULL

for( urlLink in kegg.link ) {
 array = strsplit( urlLink, "\\+", )[[1]]
 mapGenes = NULL  # entrez gene list sep=space
 mapSymbols = NULL
 mapEntrez = NULL  # genes in a pathway
 keggPath = paste( "path:",strsplit( array[1], "\\?", )[[1]][2],sep="") 
 for( i in 2:length( array ) ) {
     mapEntrez = c( mapEntrez, array[i] ) #paste("mmu:",array[i],sep="")) 
  mapGenes = paste( mapGenes, array[i], sep=" " )
  symbol = xref[ xref$entrez == array[i], ]$symbol
  mapSymbols = paste( mapSymbols, symbol, sep=" " )
 }
 
 keggGenes = c( keggGenes, mapSymbols)
 
 
 bgColors = NULL
 fgColors = NULL
 ## up gene as red
 bgColors[ which( as.vector( xref[ mapEntrez, ]$foldChange ) \> 0 ) ] = 'pink'
 bgColors[ which( as.vector( xref[ mapEntrez, ]$foldChange ) \< 0 ) ] = 'sky blue' 
 fgColors = rep( "black", length(bgColors) )
 ## down gene as blue
 #keggEntrez = c( keggEntrez, mapEntrez )
 url = color.pathway.by.objects(keggPath, paste("path:",mapEntrez,sep=""), fgColors, bgColors )
 keggURLs = c( keggURLs, url )
}



# check which entrez is up, which entrez is down
#sig.genes  = fc.noNA
#names(sig.genes) = entrez.noNA



#output = spia.result[, c(1,2,3,4,9,11)]
output$Genes = keggGenes
#spia.result2 = spia(de=sig.genes, all=all.entrez.noNA2, organism="mmu", plots=TRUE)
output$Links = keggURLs




or KEGG Mapper : http://www.genome.jp/kegg/tool/map_pathway2.html http://www.genome.jp/kegg/tool/map_pathway3.html


or https://github.com/ajmazurie/color-KEGG-pathways




라벨:





Scientist. Husband. Daddy. --- TOLLE. LEGE
외부자료의 인용에 있어 대한민국 저작권법(28조)과 U.S. Copyright Act (17 USC. §107)에 정의된 "저작권물의 공정한 이용원칙 | the U.S. fair use doctrine" 을 따릅니다. 저작권(© 최광민)이 명시된 모든 글과 번역문들에 대해 (1) 복제-배포, (2) 임의수정 및 자의적 본문 발췌, (3) 무단배포를 위한 화면캡처를 금하며, (4) 인용 시 URL 주소 만을 사용할 수 있습니다. [후원 | 운영] [대문으로] [방명록] [옛 방명록] [티스토리 (백업)] [신시내티]

-