Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New query for ud #30

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Model/lib/wdk/model/questions/genomicQuestions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,16 @@
<description>Find all primary sequences to by organisms</description>
</question>

<!--===========================================================================-->
<!-- retrieve sequence record which is the longest sequence in a provided organism -->
<!-- used internally by the User Dataset UI to form browser track URLs -->
<!--===========================================================================-->
<question name="LongestSeqForAnOrganism" excludeProjects="EuPathDB"
displayName="Longest seq for an organism"
queryRef="SequenceIds.ByOrganismNameForFiles"
recordClassRef="SequenceRecordClasses.SequenceRecordClass">
<description>Find longest seq for an organism</description>
</question>



Expand Down
2 changes: 2 additions & 0 deletions Model/lib/wdk/model/questions/params/genomicParams.xml
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@
<suggest includeProjects="UniDB,PlasmoDB,ToxoDB,CryptoDB" default="1"/>
</stringParam>

<stringParam name="organismNameForFiles" excludeProjects="EuPathDB" prompt="Org name for files" number="false"/>

<enumParam name="medianOrIndividual" includeProjects="AmoebaDB,TriTrypDB,PlasmoDB,ToxoDB,CryptoDB,FungiDB,UniDB"
prompt="Median Or By Strain/Sample?"
multiPick="false">
Expand Down
25 changes: 25 additions & 0 deletions Model/lib/wdk/model/questions/queries/genomicQueries.xml
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,31 @@ from apidbtuning.GenomicSeqAttributes s
</sql>
</sqlQuery>

<!--++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->
<!-- Retrieves genomic sequence ID of longest sequence in an organism -->
<!-- Used by user datasets UI to build genome browser track URLs -->
<!--++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->

<sqlQuery name="ByOrganismNameForFiles" excludeProjects="EuPathDB">
<paramRef ref="genomicParams.organismNameForFiles"/>
<column name="project_id"/>
<column name="source_id"/>
<sql>
<![CDATA[
SELECT gsa.project_id, gsa.source_id
FROM apidbtuning.genomicseqattributes gsa, apidb.organism o,
(SELECT MAX(length) AS ML, taxon_id
FROM apidbtuning.genomicseqattributes
GROUP BY taxon_id ) info
WHERE info.taxon_id = gsa.taxon_id
AND info.ml = gsa.length
AND gsa.taxon_id = o.taxon_id
AND $$organismNameForFiles$$ = o.name_for_filenames

]]>
</sql>
</sqlQuery>

</querySet>

</wdkModel>