In [1]:
from om import base, settings
from om.data import *
from om.components import *

from IPython.display import HTML
from matplotlib import pylab as plt

from math import log
from itertools import combinations
import pandas as pd

ome = base.Session()
genome_data = omics_database.genome_data
%matplotlib inline


/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pandas/io/excel.py:626: UserWarning: Installed openpyxl is not supported at this time. Use >=1.6.1 and <2.0.0.
  .format(openpyxl_compat.start_ver, openpyxl_compat.stop_ver))

In [10]:
with open('/Volumes/extra/Dropbox/crp/data/annotation/ecocyc_tu.gff','wb') as tu_file:
    for tu in ome.query(TU).all():
        tu_file.write('%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n' % 
                      ('NC_000913','ecocyc_TUs', 'transcript', tu.genome_region.leftpos,
                       tu.genome_region.rightpos, '.', tu.genome_region.strand, '.', tu.name))

In [4]:
ome.query(ChIPExperiment).order_by(ChIPExperiment.name).first().fastq_files


---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-4-29699c6e51dc> in <module>()
----> 1 ome.query(ChIPExperiment).order_by(ChIPExperiment.name).first().fastq_files

AttributeError: 'ChIPExperiment' object has no attribute 'fastq_files'

In [2]:
ome.query(RNASeqExperiment).all()


Out[2]:
[RNASeqExperiment (#1, RNAseq_Ar3_glycerol_NH4Cl_O2_1):  1,
 RNASeqExperiment (#2, RNAseq_Ar3_glycerol_NH4Cl_O2_2):  2,
 RNASeqExperiment (#3, RNAseq_Ar3_glycerol_NH4Cl_O2_3):  3,
 RNASeqExperiment (#4, RNAseq_delAr1_glycerol_NH4Cl_O2_1):  1,
 RNASeqExperiment (#5, RNAseq_delAr1_glycerol_NH4Cl_O2_2):  2,
 RNASeqExperiment (#6, RNAseq_delAr1_glycerol_NH4Cl_O2_3):  3,
 RNASeqExperiment (#7, RNAseq_delAr1delAr2_glycerol_NH4Cl_O2_1):  1,
 RNASeqExperiment (#8, RNAseq_delAr1delAr2_glycerol_NH4Cl_O2_2):  2,
 RNASeqExperiment (#9, RNAseq_delAr1delAr2_glycerol_NH4Cl_O2_3):  3,
 RNASeqExperiment (#10, RNAseq_delAr2_glycerol_NH4Cl_O2_1):  1,
 RNASeqExperiment (#11, RNAseq_delAr2_glycerol_NH4Cl_O2_3):  3,
 RNASeqExperiment (#12, RNAseq_delta-crp_fructose_NH4Cl_O2_1):  1,
 RNASeqExperiment (#13, RNAseq_delta-crp_fructose_NH4Cl_O2_2):  2,
 RNASeqExperiment (#14, RNAseq_delta-crp_fructose_NH4Cl_O2_3):  3,
 RNASeqExperiment (#15, RNAseq_delta-crp_glucose_NH4Cl_O2_1):  1,
 RNASeqExperiment (#16, RNAseq_delta-crp_glucose_NH4Cl_O2_2):  2,
 RNASeqExperiment (#17, RNAseq_delta-crp_glucose_NH4Cl_O2_3):  3,
 RNASeqExperiment (#18, RNAseq_delta-crp_glycerol_NH4Cl_O2_1):  1,
 RNASeqExperiment (#19, RNAseq_delta-crp_glycerol_NH4Cl_O2_2):  2,
 RNASeqExperiment (#20, RNAseq_delta-crp_glycerol_NH4Cl_O2_3):  3,
 RNASeqExperiment (#21, RNAseq_wt_fructose_NH4Cl_O2_1):  1,
 RNASeqExperiment (#22, RNAseq_wt_fructose_NH4Cl_O2_2):  2,
 RNASeqExperiment (#23, RNAseq_wt_glucose_NH4Cl_O2_1):  1,
 RNASeqExperiment (#24, RNAseq_wt_glucose_NH4Cl_O2_2):  2,
 RNASeqExperiment (#25, RNAseq_wt_glycerol_NH4Cl_O2_1):  1,
 RNASeqExperiment (#26, RNAseq_wt_glycerol_NH4Cl_O2_2):  2,
 RNASeqExperiment (#27, RNAseq_delAr2_glycerol_NH4Cl_O2_2):  2,
 RNASeqExperiment (#28, RNAseq_bw25113_acetate_NH4Cl_O2_1_thiamine):  1,
 RNASeqExperiment (#29, RNAseq_bw25113_acetate_NH4Cl_O2_2_thiamine):  2,
 RNASeqExperiment (#30, RNAseq_bw25113_fumarate_NH4Cl_O2_1_thiamine):  1,
 RNASeqExperiment (#31, RNAseq_bw25113_fumarate_NH4Cl_O2_2_thiamine):  2,
 RNASeqExperiment (#32, RNAseq_bw25113_glucose_NH4Cl_O2_1_thiamine):  1,
 RNASeqExperiment (#33, RNAseq_bw25113_glucose_NH4Cl_O2_2_thiamine):  2,
 RNASeqExperiment (#34, RNAseq_bw25113_pyruvate_NH4Cl_O2_1_thiamine):  1,
 RNASeqExperiment (#35, RNAseq_bw25113_pyruvate_NH4Cl_O2_2_thiamine):  2,
 RNASeqExperiment (#36, RNAseq_delta-fur_glucose_NH4Cl_O2_1_dpd):  1,
 RNASeqExperiment (#37, RNAseq_delta-fur_glucose_NH4Cl_O2_1_FeCl2):  1,
 RNASeqExperiment (#38, RNAseq_delta-fur_glucose_NH4Cl_O2_2_dpd):  2,
 RNASeqExperiment (#39, RNAseq_delta-fur_glucose_NH4Cl_O2_2_FeCl2):  2,
 RNASeqExperiment (#40, RNAseq_wt_glucose_cytidine_O2_1):  1,
 RNASeqExperiment (#41, RNAseq_wt_glucose_cytidine_O2_2):  2,
 RNASeqExperiment (#42, RNAseq_wt_glucose_cytosine_O2_1):  1,
 RNASeqExperiment (#43, RNAseq_wt_glucose_cytosine_O2_2):  2,
 RNASeqExperiment (#44, RNAseq_wt_glucose_glutamine_O2_1):  1,
 RNASeqExperiment (#45, RNAseq_wt_glucose_glutamine_O2_2):  2,
 RNASeqExperiment (#46, RNAseq_wt_glucose_NH4Cl_O2_1_dpd):  1,
 RNASeqExperiment (#47, RNAseq_wt_glucose_NH4Cl_O2_1_FeCl2):  1,
 RNASeqExperiment (#48, RNAseq_wt_glucose_NH4Cl_O2_2_dpd):  2,
 RNASeqExperiment (#49, RNAseq_wt_glucose_NH4Cl_O2_2_FeCl2):  2,
 RNASeqExperiment (#50, RNAseq_wt_glucose_NH4Cl_O2_4):  4,
 RNASeqExperiment (#51, RNAseq_wt_glucose_NH4Cl_O2_5):  5]

In [ ]: