Entering edit mode
5.7 years ago
endrebak
▴
980
To get genome sizes from UCSC I just use the following code:
import MySQLdb
def ucsc(genome, query):
host = "genome-mysql.cse.ucsc.edu"
user = "genome"
db = genome
conn = MySQLdb.Connection(host=host, user=user, db=db)
df = pd.read_sql(query, conn)
conn.close()
return df
def chromosome_lengths(genome):
query = 'select chrom,size from chromInfo'
df = ucsc(genome, query)
return pd.Series(df.size, index=df.chrom).to_dict()
But how do I get genome sizes from ensembl through mysql? For example for GRCz11
and GRCm38.p6
.
Just giving me the mysql command line command is enough :)
Do you also know how to get chromosome sizes? :)
seq_region table