Skip to content

Commit

Permalink
make xiview load matches with linksite = 0 (bug fix?); and minor chan…
Browse files Browse the repository at this point in the history
…ge to matches SQL query that might speed it up
  • Loading branch information
colin-combe committed Aug 13, 2024
1 parent 0fdea5e commit 58e8821
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/routes/xiview.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ async def get_results_metadata(cur, ids):
async def get_matches(cur, ids):
# todo - check whats going on with this rank =1 and pass_threshold = True in mascot data, rank =1 condition seems to speeds things up (but should be redundant)
# todo - rename 'si' to 'm'
query = """WITH submodpep AS (SELECT * FROM modifiedpeptide WHERE upload_id = ANY(%s))
query = """WITH submodpep AS (SELECT * FROM modifiedpeptide WHERE upload_id = ANY(%s) AND link_site1 > -1)
SELECT si.id AS id, si.pep1_id AS pi1, si.pep2_id AS pi2,
si.scores AS sc,
cast (si.upload_id as text) AS si,
Expand All @@ -241,8 +241,8 @@ async def get_matches(cur, ids):
INNER JOIN submodpep mp2 ON si.pep2_id = mp2.id AND si.upload_id = mp2.upload_id
WHERE si.upload_id = ANY(%s)
AND si.pass_threshold = TRUE
AND mp1.link_site1 > 0
AND mp2.link_site1 > 0;"""
AND mp1.link_site1 > -1
AND mp2.link_site1 > -1;"""
cur.execute(query, [ids, ids])
return cur.fetchall()

Expand Down

0 comments on commit 58e8821

Please sign in to comment.