cruzdb.Genome

class cruzdb.Genome(db='', user='genome', host='genome-mysql.cse.ucsc.edu', password='', engine=None)[source]

Connect to a particular database

Returns a new Genome object

Parameters :

db : str

either an sqlalchemy dburl, or just the database name.

user : str

if db is a dburl, this is not needed. otherwise it’s the database user

host : str

if db is a dburl, this is not needed. otherwise it’s the database host

password : str

if db is a dburl, this is not needed. otherwise it’s the database password

engine : sqlalchemy.engine

if specified, all other parameters must be unused. just forces

use of an existing engine

Methods

annotate(fname, tables[, feature_strand, ...]) annotate a file with a number of tables
bin_query(table, chrom, start, end) perform an efficient spatial query using the bin column if available.
bins(start, end) Get all the bin numbers for a particular interval defined by
commit() Commit the current transaction.
connection() Return the current sqlalchemy.engine.base.Connection in use by the current transaction.
create_url([db, user, host, password]) internal: create a dburl from a set of parameters or the defaults on
dataframe(table[, limit, offset]) create a pandas dataframe from a table or query
david_go(refseq_list[, annot]) open a web-browser to the DAVID online enrichment tool
delete(instance) Mark an instance as deleted.
downstream(table, chrom_or_feat[, start, end, k]) Return k-nearest downstream features
entity(attr[, schema]) Return the named entity from this SQLSoup, or
execute(stmt, **params) Execute a SQL statement.
expunge(instance) Remove an instance from the Session.
expunge_all() Clear all objects from the current Session.
flush() Flush pending changes to the database.
join(left, right[, onclause, isouter, base]) Create an expression.join() and map to it.
knearest(table, chrom_or_feat[, start, end, ...]) Return k-nearest features
load_file(fname[, table, sep, bins, indexes]) use some of the machinery in pandas to load a file into a table
map(selectable[, base]) Map a selectable directly.
map_to(attrname[, tablename, selectable, ...])
mirror(tables, dest_url) miror a set of tables from dest_url
rollback() Rollback the current transction.
save_bed(query[, filename]) write a bed12 file of the query.
sql(query) show the sql of a query
upstream(table, chrom_or_feat[, start, end, k]) Return k-nearest upstream features
with_labels(selectable[, base]) Map a selectable directly, wrapping the selectable in a subquery with labels.
__init__(db='', user='genome', host='genome-mysql.cse.ucsc.edu', password='', engine=None)[source]

Methods

__init__([db, user, host, password, engine])
annotate(fname, tables[, feature_strand, ...]) annotate a file with a number of tables
bin_query(table, chrom, start, end) perform an efficient spatial query using the bin column if available.
bins(start, end) Get all the bin numbers for a particular interval defined by
commit() Commit the current transaction.
connection() Return the current sqlalchemy.engine.base.Connection in use by the current transaction.
create_url([db, user, host, password]) internal: create a dburl from a set of parameters or the defaults on
dataframe(table[, limit, offset]) create a pandas dataframe from a table or query
david_go(refseq_list[, annot]) open a web-browser to the DAVID online enrichment tool
delete(instance) Mark an instance as deleted.
downstream(table, chrom_or_feat[, start, end, k]) Return k-nearest downstream features
entity(attr[, schema]) Return the named entity from this SQLSoup, or
execute(stmt, **params) Execute a SQL statement.
expunge(instance) Remove an instance from the Session.
expunge_all() Clear all objects from the current Session.
flush() Flush pending changes to the database.
join(left, right[, onclause, isouter, base]) Create an expression.join() and map to it.
knearest(table, chrom_or_feat[, start, end, ...]) Return k-nearest features
load_file(fname[, table, sep, bins, indexes]) use some of the machinery in pandas to load a file into a table
map(selectable[, base]) Map a selectable directly.
map_to(attrname[, tablename, selectable, ...])
mirror(tables, dest_url) miror a set of tables from dest_url
rollback() Rollback the current transction.
save_bed(query[, filename]) write a bed12 file of the query.
sql(query) show the sql of a query
upstream(table, chrom_or_feat[, start, end, k]) Return k-nearest upstream features
with_labels(selectable[, base]) Map a selectable directly, wrapping the selectable in a subquery with labels.

Attributes

bind The sqlalchemy.engine.base.Engine associated with this SQLSoup.
engine The sqlalchemy.engine.base.Engine associated with this SQLSoup.
tables
url str(object=’‘) -> string

This Page