biocommons / uta

Universal Transcript Archive: comprehensive genome-transcript alignments; multiple transcript sources, versions, and alignment methods; available as a docker image
Apache License 2.0
62 stars 26 forks source link

Cannot connect to DB (and a variant question) #242

Closed pablosolar closed 7 months ago

pablosolar commented 1 year ago

Hi all!

I tried several times to connect to the db but I can't. Python looks like pretty simple:

import mysql.connector

mydb = mysql.connector.connect(
  host="uta.biocommons.org",
  user="anonymous",
  password="anonymous",
  database="uta"
)
cur = mydb.cursor()

Is your host down or something?

By the other hand, I will like to get the latest transcript for the variant chr2:47641560-A-T, how should I define the query? I didn't find any doc or something related.

Thank you very much!

korikuzma commented 1 year ago

Hi @pablosolar UTA is a PostgreSQL database. To connect via Python (as seen in the readme):

import psycopg2, psycopg2.extras

conn = psycopg2.connect("host=uta.biocommons.org dbname=uta user=anonymous password=anonymous")
cur = conn.cursor(cursor_factory=psycopg2.extras.DictCursor)
pablosolar commented 1 year ago

Thank you @korikuzma. Now I connect successfully. But my question is, isn't there any doc or something where I can view the tables?

Could you help me at least to get the transcripts for chr2:47641560-A-T?

Thanks!

korikuzma commented 1 year ago

@pablosolar There is no documentation that I'm aware of. I use pgAdmin 4 for my local instance of UTA, so I can see the tables. The schemas can be found here.

I really only work on aligning on exons, so the query would look like this (assuming you're using GRCh37):

cur.execute("select tx_ac from uta_20210129.tx_exon_aln_v where alt_ac = 'NC_000002.11' and 47641559 between alt_start_i and alt_end_i;")
row = cur.fetchall()

However, this variant seems to be on an intron. #221 has store full tx-level cigar, including introns as a bullet point. I don't know of a way to get alignments for introns. @reece can you comment on this?

github-actions[bot] commented 11 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 11 months ago

This issue was closed because it has been stalled for 7 days with no activity.

github-actions[bot] commented 8 months ago

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 7 months ago

This issue was closed because it has been stalled for 7 days with no activity.