Source

orange-bioinformatics / docs / reference / obiKEGG.htm

Full commit
<html>

<head>
<title>obiKEGG: Interface to KEGG(Kyoto Encyclopedia of Genes and Genomes)</title>
<link rel=stylesheet href="style.css" type="text/css">
<link rel=stylesheet href="style-print.css" type="text/css" media=print>
</head>

<body>
<h1>obiKEGG: Interface to KEGG (Kyoto Encyclopedia of Genes and Genomes)</h1>
<p>obiKEGG is an interface to data and information from <a href="http://www.genome.jp/kegg/">Kyoto Encyclopedia of Genes and Genomes</a>. The module supports a programmable access to KEGG pathways and information on genes.</p>

<h2>Local data manipulation</h2>
<h2><index>Update</index></h2>
<p>Is a class used for managing local KEGG database copy.</p>
<p class=section>Methods</p>
<dl class=attributes>
	<dt>getinstance(local_database_path=None, progressCallback=None)</dt>
	<dd>Return an instance of the Update class initialized to local_database_path. progressCallback will be used to report progress an all download progress.</dd>
	
	<dt>UpdateOrganism(org)</dt>
	<dd>Download organism specific pathways and genes to the local database</dd>
	
	<dt>UpdateReference()</dt>
	<dd>Download reference pathways</dd>
	
	<dt>UpdateEnzymeAndCompounds()</dt>
	<dd>Downloads enzyme and compound data</dd>
</dl>

<h2><index>KEGGOrganism</index></h2>
<p><code>KEGGOrgansim</code> is a class for easy access to organism specific data.</p>
<p class=section>Attributes</p>
<dl class=attributes>
	<dt>org</dt>
	<dd>Kegg organism code (e.g. "hsa")</dd>
	<dt>local_database_path</dt>
	<dd>Path to the local database. If <code>None</code> the <code>obiKEGG.default_database_path</code> will be used</dd>
</dl>
<p class="header">Example: construction</p>
<xmp class="code">org = KEGGOrganism("hsa", local_database_path="C:\\kegg")</xmp>
<p class=section>Methods</p>
<dl class=attributes>
	<dt>list_pathways()</dt>
	<dd>Return a list of all organism specific pathways.</dd>
	
	<dt>get_linked_pathways(pathway_id)</dt>
	<dd>Return a list of all organism specific pathways that pathway with <code>pathway_id</code> links to.</dd>
	
	<dt>get_genes()</dt>
	<dd>Return a list of all specific genes</dd>
	
	<dt>get_genes_by_pathway(pathway_id)</dt>
	<dd>Return a set of all organism specific genes that are in the pathway with <code>pathway_id</code>.</dd>
	
	<dt>get_enzymes_by_pathway(pathway_id)</dt>
	<dd>Return a set of all organism specific enzymes that are in the pathway with <code>pathway_id</code>.</dd>
	
	<dt>get_compounds_by_pathway(pathway_id)</dt>
	<dd>Return a set of all organism specific compounds that are in the pathway with <code>pathway_id</code>.</dd>
	
	<dt>get_pathways_by_genes(genes)</dt>
	<dd>Return a list of all organism specific pathways that contain all the genes.</dd>
	
	<dt>get_enriched_pathways_by_genes(genes, reference=None, callback=None)</dt>
	<dd>Return a dictionary with enriched pathways ids as keys and (list_of_genes, p_value, num_of_reference_genes) tuples as items.</dd>
	
	<dt>get_pathways_by_enzymes(enzymes)</dt>
	<dd>Return a list of all organism specific pathways that contain all the enzymes.</dd>
	
	<dt>get_pathways_by_compounds(compounds)</dt>
	<dd>Return a list of all organism specific pathways that contain all the compounds.</dd>
	
	<dt>get_enzymes_by_compound(compound)</dt>
	<dd>Return a list of all organism specific enzymes that are involved in a reaction with <code>compound</code>.</dd>
	
	<dt>get_compounds_by_enzyme(enzyme)</dt>
	<dd>Return a list of all compounds that are involved in a reaction with the <code>enzyme</code>.</dd>
	
	<dt>get_genes_by_enzyme(enzyme)</dt>
	<dd>Return a list of all genes that are involved with the production of <code>enzyme</code>.</dd>
	
	<dt>get_enzymes_by_gene(gene)</dt>
	<dd>Return a list of all enzymes that are a product of <code>gene</code>.</dd>
	
	<dt>get_unique_gene_ids(genes, caseSensitive=True)</dt>
	<dd>Return a tuple with three elements. The first is a dictionary mapping from unique gene ids to gene names in <code>genes</code>, the second is a list of conflicting gene names and the third is a list of unknown genes.</dd>
	
</dl>

<h3>Examples<h3>

<p class="header">Getting enriched pathways</p>
<xmp class="code">org = KEGGOrganism("hsa")
genes, _, _ = org.get_unique_gene_ids([...])
res = orng.get_enriched_pathways(genes)
for p_id, (genes, p_value, refCount) in res.items():
	print "Pathway id %s with p-value %.4f" %(p_id, p_value)</xmp>


<h2><index>KEGGPathway</index></h2>
<p><code>KEGGPathway</code> is a class for pathway specific data</p>
<p class=section>Attributes</p>
<dl class=attributes>
	<dt>pathway_id</dt>
	<dd>Kegg pathway id code (e.g. "hsa:00052")</dd>
	<dt>local_database_path</dt>
	<dd>Path to the local database. If <code>None</code> the <code>obiKEGG.default_database_path</code> will be used</dd>
</dl>
<p class=section>Methods</p>
<dl class=attributes>
	<dt>get_image()</dt>
	<dd>Return an PIL image of the pathway</dd>
	
	<dt>get_colored_image(objects)</dt>
	<dd>Return an PIL image of the pathway with marked <code>objects</code></dd>
	
	<dt>get_bounding_box(object)</dt>
	<dd>Return a bounding box of the form (x1, y1, x2, y2) of <code>object</code> on the pathway image</dd>
	
	<dt>get_bounding_box_dict()</dt>
	<dd>Return a dictionary mapping all objects on the pathways to bounding boxes (x1, y1, x2, y2) on the pathway image</dd>
	
	<dt>get_genes()</dt>
	<dd>Return all genes on the pathway</dd>
	
	<dt>get_enzymes()</dt>
	<dd>Return all enzymes on the pathway</dd>
	
	<dt>get_compounds()</dt>
	<dd>Return all compounds on the pathway</dd>
	
</dl>

<h3>Example<h3>
<p class="header">Retrieval of enriched pathway images with marked genes</p>
<xmp class="code">for p_id, (genes, _, _) in res.items():
	pathway = KEGGPathway(p_id)
	image = pathway.get_colored_image(genes)
	image.save(p_id)</xmp>