This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from KGML_scrape import retrieve_kgml_to_file | |
retrieve_kgml_to_file('ddc00190', 'ddc00190.kgml') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [1]: from KGML_scrape import * | |
In [2]: ex1 = retrieve_kgml('eco00010') | |
In [3]: ex1[:100] | |
Out[3]: '<?xml version="1.0"?>\n<!DOCTYPE pathway SYSTEM "http://www.genome.jp/kegg/xml/KGML_v0.7.1_.dtd">\n<!-' | |
In [4]: ex2 = retrieve_kgml_stream('ype02040') | |
In [5]: type(ex2) | |
Out[5]: instance | |
In [6]: ex2.readline() | |
Out[6]: '<?xml version="1.0"?>\n' | |
In [7]: ex3 = retrieve_KEGG_pathway('ara01120') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import KGML_parser | |
from KGML_scrape import retrieve_KEGG_pathway | |
from KGML_vis import KGMLCanvas | |
# Get the ko01110 map from KEGG, and write it out to file, visualised as | |
# the .png, and as the elements from the KGML file | |
pathway = retrieve_KEGG_pathway('ko01110') | |
kgml_map = KGMLCanvas(pathway, show_maps=True) | |
# Default settings are for the KGML elements only | |
kgml_map.draw('ex1_kgml_render.pdf') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import KGML_parser | |
from KGML_scrape import retrieve_KEGG_pathway | |
from KGML_vis import KGMLCanvas | |
from Bio.Graphics.ColorSpiral import ColorSpiral | |
# Get the ko03070 map from KEGG, and write it out to file, visualised as | |
# the .png, and as the elements from the KGML file | |
pathway = retrieve_KEGG_pathway('ko03070') | |
kgml_map = KGMLCanvas(pathway, show_maps=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import KGML_parser | |
from KGML_scrape import retrieve_KEGG_pathway | |
from KGML_vis import KGMLCanvas | |
# Get list of pathway elements to enhance | |
glyc_path = retrieve_KEGG_pathway('ko00010') | |
tca_path = retrieve_KEGG_pathway('ko00020') | |
enhance_list = [] | |
for pathway in (glyc_path, tca_path): | |
for e in pathway.entries.values(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# paradox.py | |
# | |
# Python code to illustrate the Tuesday Boy paradox ("I have two children. | |
# One is a boy born on a Tuesday. What is the probability I have two boys") | |
# for a blog post. | |
# | |
# We're simulating two sampling modes to illustrate how the approach to | |
# sampling, and posing the initial question, is important. This has general | |
# implications for what we can reasonably infer from experiments where we | |
# did not design the experiment to answer a specific question. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# boy-girl.py | |
# | |
# Python code to illustrate the Tuesday Boy paradox ("I have two children. | |
# One is a boy born on a Tuesday. What is the probability I have two boys") | |
# for a blog post. | |
# | |
# This time, unlike paradox.py, we're not assuming that there is preselection | |
# for telling you that one of the children is a boy, or a boy born on a Tuesday. | |
# This radically alters the solution of the problem. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ftp://ftp.ncbi.nih.gov/genomes/Bacteria/Chlorobium_chlorochromatii_CaD3_uid58375/NC_007514.fna | |
ftp://ftp.ncbi.nih.gov/genomes/Bacteria/Chlorobium_limicola_DSM_245_uid58127/NC_010803.fna | |
ftp://ftp.ncbi.nih.gov/genomes/Bacteria/Chlorobium_luteolum_DSM_273_uid58175/NC_007512.fna | |
ftp://ftp.ncbi.nih.gov/genomes/Bacteria/Chlorobium_phaeobacteroides_BS1_uid58131/NC_010831.fna | |
ftp://ftp.ncbi.nih.gov/genomes/Bacteria/Chlorobium_phaeobacteroides_DSM_266_uid58133/NC_008639.fna | |
ftp://ftp.ncbi.nih.gov/genomes/Bacteria/Chlorobium_phaeovibrioides_DSM_265_uid58129/NC_009337.fna | |
ftp://ftp.ncbi.nih.gov/genomes/Bacteria/Chlorobium_tepidum_TLS_uid57897/NC_002932.fna |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir test_isolates | |
cd test_isolates/ | |
wget -i chlorobium.txt | |
cd .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
time python calculate_ani.py -i test_isolates/ -m ANIb -o chlorobium_anib -g -v -l chlorobium_anib.log | |
time python calculate_ani.py -i test_isolates/ -m ANIm -o chlorobium_anim -g -v -l chlorobium_anim.log | |
time python calculate_ani.py -i test_isolates/ -m TETRA -o chlorobium_tetra -g -v -l chlorobium_tetra.log |
OlderNewer