diff --git a/Model/lib/dst/cellularLocalization.dst b/Model/lib/dst/cellularLocalization.dst index 72c83dfbf..f4be53f29 100644 --- a/Model/lib/dst/cellularLocalization.dst +++ b/Model/lib/dst/cellularLocalization.dst @@ -18,8 +18,9 @@ prop=cellularLocalizationWdkAttributes + diff --git a/Model/lib/dst/metaCycle.dst b/Model/lib/dst/metaCycle.dst index aa386bff2..b83d54f08 100644 --- a/Model/lib/dst/metaCycle.dst +++ b/Model/lib/dst/metaCycle.dst @@ -68,11 +68,12 @@ prop=includeProjectsExcludeEuPathDB diff --git a/Model/lib/dst/quantProteomics.dst b/Model/lib/dst/quantProteomics.dst index 15ffc2319..d7b321dee 100644 --- a/Model/lib/dst/quantProteomics.dst +++ b/Model/lib/dst/quantProteomics.dst @@ -83,17 +83,17 @@ prop=dataType -select distinct s.study_id as internal, s.name as term, s.name as display -from study.study s, sres.externaldatabase ed, sres.externaldatabaserelease edr - ,results.nafeaturediffresult ndr, study.protocolappnode pan, study.studylink sl +select distinct s.node_set_id as internal, s.name as term, s.name as display +from study.nodeset s, sres.externaldatabase ed, sres.externaldatabaserelease edr + ,results.nafeaturediffresult ndr, study.protocolappnode pan, study.nodenodeset sl where ed.external_database_id=edr.external_database_id and s.external_database_release_id = edr.external_database_release_id and ed.name='${datasetName}' -and s.study_id = sl.study_id +and s.node_set_id = sl.node_set_id and sl.protocol_app_node_id = pan.protocol_app_node_id and ndr.protocol_app_node_id = pan.protocol_app_node_id and s.name NOT like 'Quantitative Mass Spec%' -order by s.study_id +order by s.node_set_id diff --git a/Model/lib/dst/rnaSeqTemplates.dst b/Model/lib/dst/rnaSeqTemplates.dst index bce0955be..9dbeba248 100644 --- a/Model/lib/dst/rnaSeqTemplates.dst +++ b/Model/lib/dst/rnaSeqTemplates.dst @@ -652,7 +652,7 @@ prop=includeProjectsExcludeEuPathDB @@ -734,14 +734,14 @@ SELECT study_id AS internal, ELSE ps_name || sense END AS display FROM ( - SELECT DISTINCT s.study_id as study_id + SELECT DISTINCT s.node_set_id as study_id , s.name as name , REGEXP_REPLACE (s.name, '\[(.)+\]', '') AS ps_name ,REPLACE (REPLACE ( REPLACE ( REPLACE ( REGEXP_SUBSTR (s.name, ' \[\S+ ') , 'DESeq2Analysis', '') , 'unique' , '' ), '[', '') , '-', ' ' ) AS anal ,CASE WHEN REGEXP_LIKE (s.name, '${sense}') THEN '- Sense' WHEN REGEXP_LIKE (s.name, ' ${antisense}') THEN '- Antisense' ELSE 'unstranded' END AS sense -from study.study s +from study.nodeset s , SRES.EXTERNALDATABASERELEASE r , sres.externaldatabase d where lower(s.name) like '%deseq%' @@ -807,13 +807,8 @@ prop=includeProjectsExcludeEuPathDB @@ -1154,11 +1149,12 @@ prop=includeProjectsExcludeEuPathDB diff --git a/Model/lib/psql/webready/comparative/LoadRefSynOrthologousGenesTable.psql b/Model/lib/psql/webready/comparative/LoadRefSynOrthologousGenesTable.psql index 093145e3a..3747f51cb 100644 --- a/Model/lib/psql/webready/comparative/LoadRefSynOrthologousGenesTable.psql +++ b/Model/lib/psql/webready/comparative/LoadRefSynOrthologousGenesTable.psql @@ -11,31 +11,35 @@ DECLARE BEGIN FOR orgrecord IN SELECT org_abbrev, sanitized_org_abbrev, ref_strain_abbrev as ref_org_abbrev - FROM :SCHEMA.organismabbreviation_p oa, apidb.organism o - WHERE oa.org_abbrev = o.abbrev + FROM :SCHEMA.organismabbreviation_p oa, apidb.organism o + WHERE oa.org_abbrev = o.abbrev LOOP INSERT INTO :SCHEMA.RefSynOrthologousGenes_p (source_id, ref_source_id, org_abbrev, project_id, modification_date) WITH syn_pairs AS ( - SELECT DISTINCT ga.source_id, sg.syn_na_feature_id as ref_na_feature_id - FROM :SCHEMA.SyntenicGene_p sg, :SCHEMA.GeneAttributes_p ga - WHERE sg.na_sequence_id = ga.na_sequence_id - AND ga.org_abbrev = orgrecord.org_abbrev - and sg.syn_organism_abbrev = orgrecord.ref_org_abbrev - AND sg.end_max >= ga.start_min - AND sg.start_min <= ga.end_max - ), + SELECT DISTINCT ga.source_id, sg.syn_na_feature_id as ref_na_feature_id + FROM :SCHEMA.SyntenicGene_p sg, :SCHEMA.GeneAttributes_p ga + WHERE sg.na_sequence_id = ga.na_sequence_id + AND ga.org_abbrev = orgrecord.org_abbrev + and sg.syn_organism_abbrev = orgrecord.ref_org_abbrev + AND sg.end_max >= ga.start_min + AND sg.start_min <= ga.end_max + ), ortholog_pairs AS (SELECT gog.gene_id as source_id, ga_ref.na_feature_id as ref_na_feature_id, gog_ref.gene_id as ref_source_id - FROM :SCHEMA.GeneOrthologGroup gog - JOIN :SCHEMA.GeneOrthologGroup gog_ref ON gog.group_id = gog_ref.group_id - JOIN :SCHEMA.GeneAttributes_p ga_ref on gog_ref.gene_id = ga_ref.source_id - WHERE gog.org_abbrev = orgrecord.org_abbrev - AND gog_ref.org_abbrev = orgrecord.ref_org_abbrev - and ga_ref.org_abbrev = orgrecord.ref_org_abbrev + FROM :SCHEMA.GeneOrthologGroup gog + JOIN :SCHEMA.GeneOrthologGroup gog_ref ON gog.group_id = gog_ref.group_id + JOIN :SCHEMA.GeneAttributes_p ga_ref on gog_ref.gene_id = ga_ref.source_id + WHERE gog.org_abbrev = orgrecord.org_abbrev + AND gog_ref.org_abbrev = orgrecord.ref_org_abbrev + and ga_ref.org_abbrev = orgrecord.ref_org_abbrev ) SELECT ortholog_pairs.source_id, ortholog_pairs.ref_source_id, orgrecord.org_abbrev, ':PROJECT_ID', current_timestamp FROM ortholog_pairs - LEFT JOIN syn_pairs ON ortholog_pairs.source_id = syn_pairs.source_id AND ortholog_pairs.ref_na_feature_id = syn_pairs.ref_na_feature_id:PLPGSQL_DELIM - + INNER JOIN syn_pairs ON ortholog_pairs.source_id = syn_pairs.source_id AND ortholog_pairs.ref_na_feature_id = syn_pairs.ref_na_feature_id + UNION + SELECT ga.source_id, ga.source_id as ref_source_id, ga.org_abbrev, ga.project_id, current_timestamp + FROM :SCHEMA.geneattributes_p ga + WHERE ga.org_abbrev = orgrecord.org_abbrev + AND ga.org_abbrev = orgrecord.ref_org_abbrev:PLPGSQL_DELIM END LOOP:PLPGSQL_DELIM END $$; diff --git a/Model/lib/psql/webready/orgSpecific/GeneAttributes_p.psql b/Model/lib/psql/webready/orgSpecific/GeneAttributes_p.psql index bfc5e2503..3c5fd1289 100644 --- a/Model/lib/psql/webready/orgSpecific/GeneAttributes_p.psql +++ b/Model/lib/psql/webready/orgSpecific/GeneAttributes_p.psql @@ -82,8 +82,9 @@ OR d.name like '%_dbxref_uniprot_from_annotation_RSRC') ) t GROUP BY na_feature_id - ) uniprot ON ta.gene_na_feature_id = uniprot.na_feature_id and ta.org_abbrev = ':ORG_ABBREV' + ) uniprot ON ta.gene_na_feature_id = uniprot.na_feature_id LEFT JOIN :SCHEMA.GeneProduct_p gp ON ta.gene_source_id = gp.source_id and gp.org_abbrev = ':ORG_ABBREV' + WHERE ta.org_abbrev = ':ORG_ABBREV' ORDER BY ta.gene_source_id; :DECLARE_PARTITION; diff --git a/Model/lib/psql/webready/orgSpecific/IntronSupportLevel_p.psql b/Model/lib/psql/webready/orgSpecific/IntronSupportLevel_p.psql index cee0e1ba3..7fb5296e6 100644 --- a/Model/lib/psql/webready/orgSpecific/IntronSupportLevel_p.psql +++ b/Model/lib/psql/webready/orgSpecific/IntronSupportLevel_p.psql @@ -10,7 +10,7 @@ with annotatedJunctions AS ( , il.is_reversed from apidb.intronlocation il inner join :SCHEMA.TranscriptAttributes_p ta - ON il.parent_id = ta.na_feature_id + ON il.parent_id = ta.na_feature_id and ta.org_abbrev = ':ORG_ABBREV' ) group by gene_source_id ), exptJunctions as ( select gij.gene_source_id diff --git a/Model/lib/psql/webready/orgSpecific/TFBSGene_p.psql b/Model/lib/psql/webready/orgSpecific/TFBSGene_p.psql index 6985b6d7b..555d40fa3 100644 --- a/Model/lib/psql/webready/orgSpecific/TFBSGene_p.psql +++ b/Model/lib/psql/webready/orgSpecific/TFBSGene_p.psql @@ -32,7 +32,9 @@ ELSE '+' END END as direction - -- , aef.* + , aef.primary_score + , aef.name + , aef.external_database_release_id FROM dots.BindingSiteFeature aef, apidb.FeatureLocation arrloc, :SCHEMA.GeneAttributes_p ga diff --git a/Model/lib/wdk/model/questions/compoundQuestions.xml b/Model/lib/wdk/model/questions/compoundQuestions.xml index f2e817426..e3a8ba182 100644 --- a/Model/lib/wdk/model/questions/compoundQuestions.xml +++ b/Model/lib/wdk/model/questions/compoundQuestions.xml @@ -1,7 +1,6 @@ - + diff --git a/Model/lib/wdk/model/questions/geneQuestions.xml b/Model/lib/wdk/model/questions/geneQuestions.xml index 336d9c32a..7a62cc045 100644 --- a/Model/lib/wdk/model/questions/geneQuestions.xml +++ b/Model/lib/wdk/model/questions/geneQuestions.xml @@ -1617,7 +1617,7 @@ IMPORTANT: searchCategory="Protein Expression" queryRef="GeneId.GenesByMassSpec" recordClassRef="TranscriptRecordClasses.TranscriptRecordClass"> - @@ -2507,7 +2507,7 @@ Find genes based on the Gene Ontology (GO) Term(s) or ID(s) assigned to them. - - - - Protein interactions + Y2H interactions @@ -6291,7 +6291,7 @@ Each point shows the sense fold-change and the antisense fold-change between a p @@ -6315,7 +6315,7 @@ Each point shows the sense fold-change and the antisense fold-change between a p - LongReadRNASeq + longReadrnaseq @@ -6393,7 +6393,7 @@ Each point shows the sense fold-change and the antisense fold-change between a p - Protein expression + Protein expression (quantitative) diff --git a/Model/lib/wdk/model/questions/params/compoundParams.xml b/Model/lib/wdk/model/questions/params/compoundParams.xml index f53765000..0ffd86ba1 100644 --- a/Model/lib/wdk/model/questions/params/compoundParams.xml +++ b/Model/lib/wdk/model/questions/params/compoundParams.xml @@ -1,5 +1,5 @@ - + @@ -289,7 +289,7 @@ lower expression in the comparator as compared to the reference. - + @@ -309,9 +309,9 @@ lower expression in the comparator as compared to the reference. - SELECT name as term, study_id as internal, - 'Effect of pH on metabolite levels (Lewis, Baska and Llinas)' as display - FROM study.study + SELECT name as term, node_set_id as internal, + 'Effect of pH on metabolite levels (Lewis, Baska and Llinas)' as display + FROM study.nodeset WHERE name = 'Profiles of Metabolites from Llinas' @@ -323,12 +323,10 @@ lower expression in the comparator as compared to the reference. select s.name as term - , s.study_id as internal + , s.node_set_id as internal , replace(s.name, '[metaboliteProfiles]', '') as display --use display name in injector - from study.study i - , study.study s - where i.name = 'compoundMassSpec_Barrett_PurineStarvation_RSRC' - and s.investigation_id = i.study_id + from study.nodeset s + where s.name = 'compoundMassSpec_Barrett_PurineStarvation_RSRC' diff --git a/Model/lib/wdk/model/questions/params/geneParams.xml b/Model/lib/wdk/model/questions/params/geneParams.xml index 73d557f1c..1554954aa 100644 --- a/Model/lib/wdk/model/questions/params/geneParams.xml +++ b/Model/lib/wdk/model/questions/params/geneParams.xml @@ -208,7 +208,7 @@ --> -
SELECT name AS internal, name AS term - FROM study.study + FROM study.nodeset @@ -6524,15 +6524,17 @@ products of your selected type (or types).

- SELECT s.name as internal, + SELECT s.name as internal, CASE WHEN s.name ='WT MetaCycle FirstStrand' THEN 'WT - Sense' WHEN s.name ='MSN MetaCycle FirstStrand' THEN 'ΔMSN - Sense' WHEN s.name ='WT MetaCycle SecondStrand' THEN 'WT - Antisense' ELSE 'ΔMSN Antisense' END "term" - FROM STUDY.STUDY s, STUDY.STUDY i - Where i.name = 'ncraOR74A_Bharath_Circadian_Time_Course_ebi_rnaSeq_RSRC' - And i.study_id = s.INVESTIGATION_ID and s.name like '%MetaCycle%' - + FROM STUDY.nodeset s, sres.externaldatabase ed, sres.externaldatabaserelease edr + WHERE ed.name = 'ncraOR74A_Bharath_Circadian_Time_Course_ebi_rnaSeq_RSRC' + AND ed.external_database_id = edr.external_database_id + AND edr.external_database_release_id = s.external_database_release_id + AND node_type IN ('RNASeq') + @@ -6540,12 +6542,17 @@ products of your selected type (or types).

- SELECT s.name as internal, REPLACE (s.name, ' MetaCycle', '') as term - FROM STUDY.STUDY s, STUDY.STUDY i - WHERE i.name = 'ncraOR74A_Hurley_2014_NC_3_ebi_rnaSeq_RSRC' - AND i.study_id = s.INVESTIGATION_ID - AND s.name like 'time course %' - + SELECT s.name as internal, + CASE WHEN s.name ='WT MetaCycle FirstStrand' THEN 'WT - Sense' + WHEN s.name ='MSN MetaCycle FirstStrand' THEN 'ΔMSN - Sense' + WHEN s.name ='WT MetaCycle SecondStrand' THEN 'WT - Antisense' + ELSE 'ΔMSN Antisense' END "term" + FROM STUDY.nodeset s, sres.externaldatabase ed, sres.externaldatabaserelease edr + WHERE ed.name = 'ncraOR74A_Hurley_2014_NC_3_ebi_rnaSeq_RSRC' + AND ed.external_database_id = edr.external_database_id + AND edr.external_database_release_id = s.external_database_release_id + AND node_type IN ('RNASeq') + @@ -6558,9 +6565,8 @@ products of your selected type (or types).

WHEN s.name ='BSF Const MetaCycle' THEN 'BSF Const' WHEN s.name ='PF Alt MetaCycle' THEN 'PF Alt' ELSE 'PF Const' END AS term - FROM study.study s, study.study i - WHERE i.name = 'tbruTREU927_Rijo_Circadian_Regulation_ebi_rnaSeq_RSRC' - AND i.study_id = s.INVESTIGATION_ID and s.name like '%MetaCycle%' + FROM study.nodeset s + WHERE s.name like '%MetaCycle%' @@ -6569,17 +6575,23 @@ products of your selected type (or types).

- SELECT s.name as internal,s.name as term - FROM STUDY.STUDY s, STUDY.STUDY i - WHERE i.name = 'agamPEST_microarrayExpression_GSE22585_circadian_rhythm_RSRC' - AND i.study_id = s.investigation_id and s.name like '%circadian%' - + SELECT s.name as internal, + CASE WHEN s.name ='WT MetaCycle FirstStrand' THEN 'WT - Sense' + WHEN s.name ='MSN MetaCycle FirstStrand' THEN 'ΔMSN - Sense' + WHEN s.name ='WT MetaCycle SecondStrand' THEN 'WT - Antisense' + ELSE 'ΔMSN Antisense' END "term" + FROM STUDY.nodeset s, sres.externaldatabase ed, sres.externaldatabaserelease edr + WHERE ed.name = 'agamPEST_microarrayExpression_GSE22585_circadian_rhythm_RSRC' + AND ed.external_database_id = edr.external_database_id + AND edr.external_database_release_id = s.external_database_release_id + AND node_type IN ('microarray') + - + @@ -6594,10 +6606,8 @@ products of your selected type (or types).

, apidbtuning.datasetdatasource dd , apidb.organism o WHERE o.abbrev = $$organismsWithSingleCell$$ - WHERE dd.taxon_id = o.taxon_id + AND dd.taxon_id = o.taxon_id AND dsp.name like '%cellxgene%' - AND dsp.name = dnt.name - AND ed.name = dnt.name AND dsp.name = ed.name AND ed.external_database_id = edr.external_database_id ]]> @@ -6616,10 +6626,10 @@ products of your selected type (or types).

FROM sres.externaldatabase d , sres.externaldatabaserelease r , apidb.nafeatureWGCNAResults fwr - , study.studylink sl - , study.study s + , study.nodenodeset sl + , study.nodeset s WHERE sl.protocol_app_node_id = fwr.protocol_app_node_id - AND sl.study_id= s.study_id + AND sl.node_set_id= s.node_set_id AND r.external_database_release_id = s.external_database_release_id AND d.external_database_id = r.external_database_id ]]> @@ -6643,10 +6653,10 @@ products of your selected type (or types).

pan.protocol_app_node_id as internal , regexp_replace(pan.name,'(((\w+)\s){1}).*', '\1') as display --clean pan.name by keeping only the first full word from study.protocolappnode pan - , study.study s - , study.studylink sl + , study.nodeset s + , study.nodenodeset sl where s.external_database_release_id = $$wgcnaDataset$$ - and s.study_id = sl.study_id + and s.node_set_id = sl.node_set_id and sl.protocol_app_node_id = pan.protocol_app_node_id and pan.name like '%module%' ) a @@ -6669,10 +6679,10 @@ products of your selected type (or types).

FROM sres.externaldatabase d , sres.externaldatabaserelease r , apidb.nafeaturelist fl - , study.studylink sl - , study.study s + , study.nodenodeset sl + , study.nodeset s WHERE sl.protocol_app_node_id = fl.protocol_app_node_id - AND sl.study_id= s.study_id + AND sl.node_set_id= s.node_set_id AND r.external_database_release_id = s.external_database_release_id AND d.external_database_id = r.external_database_id ]]> @@ -6688,9 +6698,9 @@ products of your selected type (or types).

@@ -6757,9 +6767,9 @@ products of your selected type (or types).

CASE WHEN pan.name ='outlier (lopit)' THEN CONCAT('- ', upper(substr(CONCAT(replace(pan.name,' (lopit)',''), ' probability'),1,1)), substr(CONCAT(replace(pan.name,' (lopit)',''), ' probability'),2,9999)) ELSE CONCAT(upper(substr(CONCAT(replace(pan.name,' (lopit)',''), ' probability'),1,1)), substr(CONCAT(replace(pan.name,' (lopit)',''), ' probability'),2,9999)) END as display_name , cast(null as varchar(1)) as description, cast(null as varchar(1)) as units, 'number' as type,1 as is_range,1 as precision, cast(null as varchar(1)) as display_order - FROM study.study s , study.studyLink sl, study.ProtocolAppNode pan, apidb.LopitResults lr, apidbtuning.GeneAttributes ga + FROM study.nodeset s , study.nodenodeset sl, study.ProtocolAppNode pan, apidb.LopitResults lr, apidbtuning.GeneAttributes ga WHERE s.name = $$lopit_method$$ - AND s.study_id = sl.study_id + AND s.node_set_id = sl.node_set_id AND sl.protocol_app_node_id = pan.protocol_app_node_id AND pan.protocol_app_node_id = lr.protocol_app_node_id AND ga.na_feature_id = lr.na_feature_id @@ -6778,17 +6788,17 @@ products of your selected type (or types).


, d.name as internal FROM sres.externaldatabase d , sres.externaldatabaserelease r - , study.study s - , study.studylink sl + , study.nodeset s + , study.nodenodeset sl , apidb.phenotypescore ps WHERE d.external_database_id = r.external_database_id AND r.external_database_release_id = s.external_database_release_id - AND s.study_id = sl.study_id + AND s.node_set_id = sl.node_set_id AND sl.protocol_app_node_id = ps.protocol_app_node_id ]]>
@@ -7027,14 +7037,14 @@ products of your selected type (or types).

FROM apidb.PhenotypeScore ps , study.protocolappnode pan , (SELECT DISTINCT sl.protocol_app_node_id, d.name - FROM study.study s - , study.studylink sl + FROM study.nodeset s + , study.nodenodeset sl , sres.externaldatabase d , sres.externaldatabaserelease r WHERE d.name = '$$phenotypeScoreDataset$$' and d.external_database_id = r.external_database_id and r.external_database_release_id = s.external_database_release_id - and s.study_id = sl.study_id + and s.node_set_id = sl.node_set_id ) sl WHERE ps.protocol_app_node_id = pan.protocol_app_node_id AND pan.protocol_app_node_id = sl.protocol_app_node_id @@ -7070,14 +7080,14 @@ products of your selected type (or types).

, study.protocolappnode pan , ( SELECT distinct sl.protocol_app_node_id, d.name - FROM study.study s - , study.studylink sl + FROM study.nodeset s + , study.nodenodeset sl , sres.externaldatabase d , sres.externaldatabaserelease r WHERE d.name = '$$phenotypeScoreDataset$$' AND d.external_database_id = r.external_database_id AND r.external_database_release_id = s.external_database_release_id - AND s.study_id = sl.study_id + AND s.node_set_id = sl.node_set_id ) sl WHERE p.protocol_app_node_id = pan.protocol_app_node_id and pan.protocol_app_node_id = sl.protocol_app_node_id @@ -7159,9 +7169,9 @@ products of your selected type (or types).

, null::numeric as number_value , lower(p.value) as string_value , cast(null as timestamp) as date_value - FROM apidb.nafeaturephenotype p, study.study s, study.studylink sl + FROM apidb.nafeaturephenotype p, study.nodeset s, study.nodenodeset sl WHERE s.name = 'ncraOR74A_phenotype_GeneImage_NAFeaturePhenotypeImage_RSRC' - AND s.study_id = sl.study_id + AND s.node_set_id = sl.node_set_id AND sl.protocol_app_node_id = p.protocol_app_node_id ]]> @@ -7187,9 +7197,9 @@ products of your selected type (or types).

, 'string' as type , 0 as is_range , 1 as precision - FROM apidb.nafeaturephenotype p, study.study s, study.studylink sl + FROM apidb.nafeaturephenotype p, study.nodeset s, study.nodenodeset sl WHERE s.name = 'ncraOR74A_phenotype_GeneImage_NAFeaturePhenotypeImage_RSRC' - AND s.study_id = sl.study_id + AND s.node_set_id = sl.node_set_id AND sl.protocol_app_node_id = p.protocol_app_node_id ORDER BY initcap(p.property) ]]> @@ -7210,9 +7220,9 @@ products of your selected type (or types).

, null::numeric as number_value , p.value as string_value , cast(null as timestamp) as date_value - FROM apidb.nafeaturephenotype p, study.study s, study.studylink sl + FROM apidb.nafeaturephenotype p, study.nodeset s, study.nodenodeset sl WHERE s.name like '%_PHI-base_curated_phenotype_NAFeaturePhenotypeGeneric_RSRC' - AND s.study_id = sl.study_id + AND s.node_set_id = sl.node_set_id AND sl.protocol_app_node_id = p.protocol_app_node_id AND p.property NOT IN ('Co-mutated gene(s)','Gene inducer','PHI-base entry','PMID') AND p.property NOT like 'Comments%' @@ -7240,9 +7250,9 @@ products of your selected type (or types).

, 'string' as type , 0 as is_range , 1 as precision - FROM apidb.nafeaturephenotype p, study.study s, study.studylink sl + FROM apidb.nafeaturephenotype p, study.nodeset s, study.nodenodeset sl WHERE s.name like '%_PHI-base_curated_phenotype_NAFeaturePhenotypeGeneric_RSRC' - AND s.study_id = sl.study_id + AND s.node_set_id = sl.node_set_id AND sl.protocol_app_node_id = p.protocol_app_node_id AND p.property NOT IN ('Co-mutated gene(s)','Gene inducer','PHI-base entry','PMID') AND p.property NOT like 'Comments%' @@ -7886,7 +7896,7 @@ products of your selected type (or types).

WITH tpm AS ( - SELECT coalesce(round(power(10,10) / (num_reads * tx_length),2), 1) as value + SELECT coalesce(round((power(10,10)/(num_reads * tx_length))::numeric, 2), 1) as value FROM ( SELECT min(rs.avg_unique_reads) as num_reads, min(oa.avg_transcript_length) as tx_length FROM apidbTuning.ProfileSamples ps @@ -8011,8 +8021,8 @@ products of your selected type (or types).

end as display FROM apidbtuning.profiletype WHERE profile_set_name in ( - 'T.brucei paired end RNA Seq data from Horn aligned with cds coordinates [htseq-union - unstranded - tpm - unique]', - 'T.brucei paired end RNA Seq data from Horn [htseq-union - unstranded - tpm - unique]' + 'T.brucei paired end RNA Seq data from Horn aligned with cds coordinates', + 'T.brucei paired end RNA Seq data from Horn' ) AND profile_type = 'values' ORDER BY term desc @@ -8033,8 +8043,8 @@ products of your selected type (or types).

pan.protocol_app_node_id as internal, 'Uninduced sample' as display from study.protocolappnode pan - , study.studylink sl - where sl.study_id = $$profileset_generic$$ + , study.nodenodeset sl + where sl.node_set_id = $$profileset_generic$$ and sl.protocol_app_node_id = pan.protocol_app_node_id and pan.name like 'No_Tet%tpm%'
@@ -8056,8 +8066,8 @@ products of your selected type (or types).

WHEN (pan.name like 'DIF%') THEN CONCAT('Induced throughout differentiation (DIF = 7 BS doublings + 6 PS doublings)', chr(185)) END as display FROM study.protocolappnode pan - , study.studylink sl - WHERE sl.study_id = $$profileset_generic$$ + , study.nodenodeset sl + WHERE sl.node_set_id = $$profileset_generic$$ AND sl.protocol_app_node_id = pan.protocol_app_node_id AND pan.name not like 'No_Tet%' AND pan.name like '%tpm%' @@ -9214,12 +9224,12 @@ end as term , pan.PROTOCOL_APP_NODE_ID as internal , pan2.name as display , pan2.node_order_num - FROM study.studylink sl + FROM study.nodenodeset sl , study.protocolappnode pan , RESULTS.NAFEATUREDIFFRESULT dr , webready.PANIO_p io , study.protocolappnode pan2 - WHERE sl.study_id = '$$profileset_generic$$' + WHERE sl.node_set_id = '$$profileset_generic$$' AND sl.PROTOCOL_APP_NODE_ID = pan.PROTOCOL_APP_NODE_ID AND pan.PROTOCOL_APP_NODE_ID = dr.PROTOCOL_APP_NODE_ID AND pan.protocol_app_node_id = io.output_pan_id @@ -9334,13 +9344,13 @@ end as term ) SELECT distinct ap.value as term, ap.value as internal, ap.value as display, ps.node_order_num FROM Study.ProtocolAppNode an, Study.ProtocolAppParam ap, - Study.StudyLink sl, Study.Study s, Study.Output o, perc_samples ps - WHERE sl.study_id = $$profileset_generic$$ + Study.nodenodeset sl, Study.nodeset s, Study.Output o, perc_samples ps + WHERE sl.node_set_id = $$profileset_generic$$ AND o.protocol_app_node_id = sl.protocol_app_node_id AND o.protocol_app_id = ap.protocol_app_id AND an.name like '%DESeq%' AND o.protocol_app_node_id = an.protocol_app_node_id - AND sl.study_id = s.study_id + AND sl.node_set_id = s.node_set_id AND ps.study_name = regexp_replace (s.name, ' \[.+\]', '') AND ap.value = ps.protocol_app_node_name ORDER BY ps.node_order_num @@ -9400,10 +9410,10 @@ end as term SELECT DISTINCT ndr.protocol_app_node_id as internal, pan.name as term, pan.name as display - FROM results.nafeaturediffresult ndr, study.protocolappnode pan, study.studylink sl + FROM results.nafeaturediffresult ndr, study.protocolappnode pan, study.nodenodeset sl WHERE pan.protocol_app_node_id = sl.protocol_app_node_id AND ndr.protocol_app_node_id = pan.protocol_app_node_id - AND sl.study_id = '$$profileset_generic$$' + AND sl.node_set_id = '$$profileset_generic$$'
diff --git a/Model/lib/wdk/model/questions/params/organismParams.xml b/Model/lib/wdk/model/questions/params/organismParams.xml index 1a88a696c..ea720c90b 100644 --- a/Model/lib/wdk/model/questions/params/organismParams.xml +++ b/Model/lib/wdk/model/questions/params/organismParams.xml @@ -1,5 +1,23 @@ + 5 + + + You are selecting more than five organisms. +

+

+ Selecting a large number of organisms may impact performance and make results harder to interpret. +

+

+ Please select five or fewer organisms where possible. +

+

+ For the best experience, use My Organism Preferences in the page header to focus on the organisms you care about most. +

+]]>
+ + @@ -55,6 +73,12 @@ showOnlyPreferredOrganisms highlightReferenceOrganisms
+ + %%maxRecommendedOrganisms%% + + + + @@ -76,6 +100,12 @@ showOnlyPreferredOrganisms highlightReferenceOrganisms + + %%maxRecommendedOrganisms%% + + + + @@ -99,6 +129,12 @@ showOnlyPreferredOrganisms highlightReferenceOrganisms + + %%maxRecommendedOrganisms%% + + + + showOnlyPreferredOrganisms highlightReferenceOrganisms + + %%maxRecommendedOrganisms%% + + + + @@ -140,6 +182,12 @@ highlightReferenceOrganisms + + %%maxRecommendedOrganisms%% + + + + showOnlyPreferredOrganisms highlightReferenceOrganisms + + %%maxRecommendedOrganisms%% + + + + @@ -210,6 +264,12 @@ showOnlyPreferredOrganisms highlightReferenceOrganisms + + %%maxRecommendedOrganisms%% + + + + + + %%maxRecommendedOrganisms%% + + + + @@ -236,6 +302,12 @@ showOnlyPreferredOrganisms highlightReferenceOrganisms + + %%maxRecommendedOrganisms%% + + + + Select the organism(s) you wish to query. + + %%maxRecommendedOrganisms%% + + + + Select the organism(s) you wish to query. + + %%maxRecommendedOrganisms%% + + + + @@ -291,9 +375,15 @@ showOnlyPreferredOrganisms + + %%maxRecommendedOrganisms%% + + + + - WITH FilterQuery AS ( SELECT DISTINCT ga.organism, ga.org_abbrev - FROM apidbtuning.geneintronjunction gij, apidbtuning.GeneAttributes ga + FROM webready.geneintronjunction_p gij, apidbtuning.GeneAttributes ga WHERE ga.source_id = gij.gene_source_id ) /* end filter query */ @@ -438,7 +528,7 @@ , SRES.TAXONNAME tn , SRES.EXTERNALDATABASE ed , SRES.EXTERNALDATABASERELEASE edr - , STUDY.STUDY s1 + , STUDY.nodeset s1 , apidb.organism o WHERE lower(d.NAME) like '%copynumbervariations_%' AND tn.TAXON_ID = d.TAXON_ID @@ -448,7 +538,6 @@ AND edr.VERSION = d.VERSION AND edr.EXTERNAL_DATABASE_ID = ed.EXTERNAL_DATABASE_ID AND s1.EXTERNAL_DATABASE_RELEASE_ID = edr.EXTERNAL_DATABASE_RELEASE_ID - AND s1.INVESTIGATION_ID is null GROUP BY tn.name ORDER BY tn.NAME @@ -639,9 +728,8 @@ /* withSequenceStrains filter query */ WITH FilterQuery AS ( SELECT DISTINCT sa.organism - FROM dots.NaSequence ns, apidbtuning.GenomicSeqAttributes sa, apidb.organism o - WHERE ns.na_sequence_id = sa.na_sequence_id - AND sa.taxon_id = o.taxon_id + FROM apidbtuning.GenomicSeqAttributes sa, apidb.organism o + WHERE sa.taxon_id = o.taxon_id AND (sa.project_id = '@PROJECT_ID@' OR 'UniDB' = '@PROJECT_ID@') ) /* end filter query */ @@ -699,9 +787,8 @@ /* withSequenceStrains filter query */ WITH FilterQuery AS ( SELECT DISTINCT sa.organism, o.abbrev - FROM dots.NaSequence ns, apidbtuning.GenomicSeqAttributes sa, apidb.organism o - WHERE ns.na_sequence_id = sa.na_sequence_id - AND sa.taxon_id = o.taxon_id + FROM apidbtuning.GenomicSeqAttributes sa, apidb.organism o + WHERE sa.taxon_id = o.taxon_id AND (sa.project_id = '@PROJECT_ID@' OR 'UniDB' = '@PROJECT_ID@') ) /* end filter query */ @@ -1000,7 +1087,7 @@ - + diff --git a/Model/lib/wdk/model/questions/params/pathwayParams.xml b/Model/lib/wdk/model/questions/params/pathwayParams.xml index cdfb642a9..a4e4971bf 100644 --- a/Model/lib/wdk/model/questions/params/pathwayParams.xml +++ b/Model/lib/wdk/model/questions/params/pathwayParams.xml @@ -1,6 +1,6 @@ - + Use only pathways from the selected source in this query. - + - + diff --git a/Model/lib/wdk/model/questions/params/popsetParams.xml b/Model/lib/wdk/model/questions/params/popsetParams.xml index b568e439e..3245b56ef 100644 --- a/Model/lib/wdk/model/questions/params/popsetParams.xml +++ b/Model/lib/wdk/model/questions/params/popsetParams.xml @@ -450,11 +450,11 @@ r.title as internal FROM SRES.BIBLIOGRAPHICREFERENCE r , study.studybibref sbr - , study.studylink sl + , study.nodenodeset sl , apidbtuning.popsetattributes pa WHERE r.title is not null AND r.bibliographic_reference_id = sbr.bibliographic_reference_id - AND sbr.study_id = sl.study_id + AND sbr.node_set_id = sl.node_set_id AND sl.protocol_app_node_id = pa.protocol_app_node_id ORDER BY r.title ]]> diff --git a/Model/lib/wdk/model/questions/params/sharedParams.xml b/Model/lib/wdk/model/questions/params/sharedParams.xml index 3b63f0d43..9978ebb0a 100644 --- a/Model/lib/wdk/model/questions/params/sharedParams.xml +++ b/Model/lib/wdk/model/questions/params/sharedParams.xml @@ -2886,21 +2886,19 @@ This parameter allows you to apply the minimum number of peptides to each select diff --git a/Model/lib/wdk/model/questions/pathwayQuestions.xml b/Model/lib/wdk/model/questions/pathwayQuestions.xml index 602fea139..4f106cd59 100644 --- a/Model/lib/wdk/model/questions/pathwayQuestions.xml +++ b/Model/lib/wdk/model/questions/pathwayQuestions.xml @@ -1,7 +1,7 @@ + displayName="Search for Metabolic Pathways"> diff --git a/Model/lib/wdk/model/questions/queries/compoundQueries.xml b/Model/lib/wdk/model/questions/queries/compoundQueries.xml index 9083f4b03..cbc7f1c86 100644 --- a/Model/lib/wdk/model/questions/queries/compoundQueries.xml +++ b/Model/lib/wdk/model/questions/queries/compoundQueries.xml @@ -1,6 +1,5 @@ - + @@ -660,12 +659,12 @@ SELECT SUM(r.value) AS value , r.compound_id FROM apidbtuning.profileType pt - , study.study s - , study.studyLink sl + , study.nodeset s + , study.nodenodeset sl , study.protocolAppNode pan , results.compoundMassSpec r WHERE pt.profile_set_name = s.name - AND sl.study_id = s.study_id + AND sl.node_set_id = s.node_set_id AND sl.protocol_app_node_id = pan.protocol_app_node_id AND pan.protocol_app_node_id = r.protocol_app_node_id AND pan.protocol_app_node_id in ($$samples_fc_ref_generic$$) @@ -684,12 +683,12 @@ SELECT SUM(r.value) AS value , r.compound_id FROM apidbtuning.profileType pt - , study.study s - , study.studyLink sl + , study.nodeset s + , study.nodenodeset sl , study.protocolAppNode pan , results.compoundMassSpec r WHERE pt.profile_set_name = s.name - AND sl.study_id = s.study_id + AND sl.node_set_id = s.node_set_id AND sl.protocol_app_node_id = pan.protocol_app_node_id AND pan.protocol_app_node_id = r.protocol_app_node_id AND pan.protocol_app_node_id in ($$samples_fc_comp_generic$$) diff --git a/Model/lib/wdk/model/questions/queries/geneQueries.xml b/Model/lib/wdk/model/questions/queries/geneQueries.xml index 9c562dd3d..6978e2f90 100644 --- a/Model/lib/wdk/model/questions/queries/geneQueries.xml +++ b/Model/lib/wdk/model/questions/queries/geneQueries.xml @@ -6,7 +6,7 @@ @@ -1591,9 +1586,8 @@ = $$min_total_unique$$ AND gij.taxon_id = ga.taxon_id AND ga.org_abbrev IN ($$organism$$) + AND gij.org_abbrev IN ($$organism$$) ) , gmi AS ( SELECT gene_source_id, source_id, max(total_unique) AS max_unique, max(total_isrpm) AS max_isrpm FROM core @@ -2210,12 +2204,13 @@ = $$min_total_unique$$ AND gij.annotated_intron = 'No' AND gij.percent_max between $$percent_max.min$$ and $$percent_max.max$$ AND ga.org_abbrev in ($$organism$$) + AND gij.org_abbrev in ($$organism$$) AND gij.taxon_id = ga.taxon_id GROUP BY ga.gene_source_id, ga.source_id, ga.project_id ]]> @@ -2749,9 +2744,8 @@ -- set source_id UPDATE ##WDK_CACHE_TABLE## SET source_id = (SELECT min(source_id) - FROM webready.TranscriptAttributes_p + FROM apidbtuning.TranscriptAttributes WHERE gene_source_id = ##WDK_CACHE_TABLE##.gene_source_id - AND org_abbrev IN (%%PARTITION_KEYS%%) ) WHERE wdk_instance_id = ##WDK_CACHE_INSTANCE_ID## AND source_id is null @@ -2892,9 +2886,8 @@ UPDATE ##WDK_CACHE_TABLE## SET source_id = ( SELECT min(source_id) - FROM webready.TranscriptAttributes_p + FROM apidbtuning.TranscriptAttributes WHERE gene_source_id = ##WDK_CACHE_TABLE##.gene_source_id - AND org_abbrev IN (%%PARTITION_KEYS%%) ) WHERE wdk_instance_id = ##WDK_CACHE_INSTANCE_ID## AND source_id IS NULL @@ -3187,6 +3180,7 @@ + @@ -3218,8 +3212,8 @@ WHERE igi.bait_gene_feature_id = pf.gene_na_feature_id ) AS prey_number_of_baits, bait_number_of_preys, 'bait' AS bait_or_prey FROM webready.GeneId_p ga - , webready.TranscriptAttributes_p bf - , webready.TranscriptAttributes_p pf + , apidbtuning.TranscriptAttributes bf + , apidbtuning.TranscriptAttributes pf , apidb.GeneInteraction gi WHERE lower($$single_gene_id$$) = lower(ga.id) AND ga.gene = bf.gene_source_id AND gi.number_of_searches >= $$min_searches$$ AND gi.times_observed >= $$min_observed$$ AND @@ -3232,8 +3226,8 @@ WHERE igi.prey_gene_feature_id = bf.gene_na_feature_id ) AS bait_number_of_preys, 'prey' AS bait_or_prey FROM webready.GeneId_p ga - , webready.TranscriptAttributes_p bf - , webready.TranscriptAttributes_p pf + , apidbtuning.TranscriptAttributes bf + , apidbtuning.TranscriptAttributes pf , apidb.GeneInteraction gi WHERE lower($$single_gene_id$$) = lower(ga.id) AND ga.gene = pf.gene_source_id AND gi.number_of_searches >= $$min_searches$$ AND gi.times_observed >= $$min_observed$$ AND @@ -3273,7 +3267,7 @@ SELECT ta.gene_source_id, ta.source_id, 'Y' AS matched_result, ta.project_id , max(round(profile_min_max.max_value::numeric, 1)) AS max_percentile_chosen , min(round(profile_min_max.min_value::numeric, 1)) AS min_percentile_chosen - FROM webready.TranscriptAttributes_p ta + FROM apidbtuning.TranscriptAttributes ta , ( SELECT res.na_feature_id, res.protocol_app_node_id FROM results.NaFeatureExpression res @@ -3332,13 +3326,13 @@ , CASE WHEN (gls.LOD_SCORE_EXP = 0) THEN gls.LOD_SCORE_MANT::varchar ELSE to_char(gls.LOD_SCORE_MANT * power(10::double precision, gls.LOD_SCORE_EXP),'99.99EEEE') END AS lod_score - FROM webready.TranscriptAttributes_p ga, apidb.nafeaturehaploblock gls + FROM apidbtuning.TranscriptAttributes ga, apidb.nafeaturehaploblock gls WHERE gls.na_feature_id = ga.gene_na_feature_id AND gls.LOD_SCORE_MANT * power(10::double precision, gls.LOD_SCORE_EXP) >= $$lod_score$$ AND lower(ga.gene_source_id) != lower($$pf_gene_id$$) AND gls.HAPLOTYPE_BLOCK_NAME IN ( SELECT DISTINCT HAPLOTYPE_BLOCK_NAME - FROM webready.TranscriptAttributes_p ga, apidb.nafeaturehaploblock gls + FROM apidbtuning.TranscriptAttributes ga, apidb.nafeaturehaploblock gls WHERE gls.na_feature_id = ga.gene_na_feature_id AND lower(ga.gene_source_id) = lower($$pf_gene_id$$) AND LOD_SCORE_MANT * power(10::double precision, LOD_SCORE_EXP) >= $$lod_score$$ @@ -3347,7 +3341,7 @@ GROUP BY gene_source_id HAVING ((count(*) * 100) / ( SELECT count(*) - FROM webready.TranscriptAttributes_p ga, apidb.nafeaturehaploblock gls + FROM apidbtuning.TranscriptAttributes ga, apidb.nafeaturehaploblock gls WHERE gls.na_feature_id = ga.gene_na_feature_id AND lower(ga.gene_source_id) = lower($$pf_gene_id$$) AND LOD_SCORE_MANT * power(10::double precision, LOD_SCORE_EXP) >= $$lod_score$$ )) >= $$percentage_sim_haploblck$$ @@ -3360,7 +3354,7 @@ ELSE to_char(gls.LOD_SCORE_MANT * power(10::double precision, gls.LOD_SCORE_EXP), '99.99EEEE') END AS cut_off , ga.gene_source_id - FROM webready.TranscriptAttributes_p ga, apidb.nafeaturehaploblock gls + FROM apidbtuning.TranscriptAttributes ga, apidb.nafeaturehaploblock gls WHERE gls.na_feature_id = ga.gene_na_feature_id AND lower(ga.gene_source_id) = lower($$pf_gene_id$$) AND LOD_SCORE_MANT * power(10::double precision, LOD_SCORE_EXP) >= $$lod_score$$ @@ -3369,7 +3363,7 @@ ) b WHERE a.gene_source_id != b.gene_source_id ) q - , webready.TranscriptAttributes_p ta + , apidbtuning.TranscriptAttributes ta WHERE ta.gene_source_id = q.gene_source_id ]]> @@ -3399,7 +3393,7 @@ END AS lod_score FROM dots.chromosomeelementfeature cef , apidb.nafeaturehaploblock gls - , webready.TranscriptAttributes_p ga + , apidbtuning.TranscriptAttributes ga , dots.externalnasequence ens , dots.nalocation nl WHERE ens.source_id = $$pf_seqid$$ @@ -3462,13 +3456,13 @@ study.protocolappparam ap, study.protocolparam p, study.output i, - study.studylink sl, + study.nodenodeset sl, STUDY.PROTOCOLAPPNODE an WHERE an.name LIKE '%DESeq%' AND p.protocol_param_id = ap.protocol_param_id AND ap.protocol_app_id = i.protocol_app_id AND i.PROTOCOL_APP_NODE_ID = an.PROTOCOL_APP_NODE_ID - AND sl.study_id = $$profileset_generic$$ + AND sl.node_set_id = $$profileset_generic$$ AND i.protocol_app_node_id = sl.protocol_app_node_id AND ((p.name = 'reference' AND ap.value = $$samples_de_ref_generic_deseq$$) OR (ap.value = $$samples_de_comp_generic_deseq$$ AND p.name = 'comparator')) @@ -3476,7 +3470,7 @@ HAVING count(*) = 2 ) pan, results.NAFeatureDiffResult r, - webready.TranscriptAttributes_p t + apidbtuning.TranscriptAttributes t WHERE pan.protocol_app_node_id = r.protocol_app_node_id AND r.NA_FEATURE_ID = t.gene_na_feature_id AND r.adj_p_value <= $$adj_p_value$$ @@ -3586,7 +3580,7 @@ ELSE round(two.chosen::numeric, 2) END AS chose_group_two FROM - webready.TranscriptAttributes_p ga + apidbtuning.TranscriptAttributes ga , ( SELECT res.na_feature_id , CASE WHEN &&isLogged&& = 1 AND $$min_max_avg_comp$$ = 'minimum' @@ -3781,7 +3775,7 @@ END) END AS chose_group_two FROM - webready.TranscriptAttributes_p ga + apidbtuning.TranscriptAttributes ga , ( SELECT res.na_feature_id , CASE WHEN &&isLogged&& = 1 AND 'average' = 'minimum' @@ -3880,13 +3874,13 @@ ' , comp1.sample ) as sample_pair - , round(CASE WHEN comp1.sense_value / greatest($$antisense_floor$$, ref1.sense_value) > 1 + , round((CASE WHEN comp1.sense_value / greatest($$antisense_floor$$, ref1.sense_value) > 1 THEN comp1.sense_value / greatest($$antisense_floor$$, ref1.sense_value) ELSE ref1.sense_value / greatest($$antisense_floor$$, comp1.sense_value) END @@ -3946,7 +3940,7 @@ THEN comp1.antisense_value / greatest($$antisense_floor$$, ref1.antisense_value) ELSE ref1.antisense_value / greatest($$antisense_floor$$, comp1.antisense_value) END - , 1) AS FC_product + )::numeric, 1) AS FC_product FROM comp1, ref1 WHERE ref1.NA_FEATURE_ID = comp1.NA_FEATURE_ID AND ref1.sample != comp1.sample @@ -4132,7 +4126,7 @@ AND pan.protocol_app_node_id = res.protocol_app_node_id GROUP BY res.na_feature_id ) two - , webready.TranscriptAttributes_p ga + , apidbtuning.TranscriptAttributes ga WHERE one.na_feature_id = two.na_feature_id AND ga.gene_na_feature_id = one.na_feature_id AND ga.gene_na_feature_id = two.na_feature_id @@ -4203,7 +4197,7 @@ , round($$antisense_direction$$ * log(2, $$antisense_fold_change$$), 1) AS antisense_fold_change , round($$sense_direction$$ * log(2, $$sense_fold_change$$), 1) AS sense_fold_change FROM - webready.TranscriptAttributes_p ga + apidbtuning.TranscriptAttributes ga , ( SELECT ref_sense_result.na_feature_id , string_agg(CONCAT(ref_sense_pan.sample, '->', comp_sense_pan.sample), ', ' @@ -4314,7 +4308,7 @@ , to_char(p_value, '9.99EEEE') AS p_value , p_value sorting_p_value FROM - webready.TranscriptAttributes_p ta + apidbtuning.TranscriptAttributes ta , ( SELECT na_feature_id , round(avg(CASE source_set WHEN 'ref' THEN linear_value END), 3) linear_avg_ref @@ -4403,7 +4397,7 @@ else linear_avg_ref end, 6) as avg_group_two, to_char( p_value, '9.99EEEE') as p_value, p_value sorting_p_value - from webready.TranscriptAttributes_p ta, + from apidbtuning.TranscriptAttributes ta, (select na_feature_id, round(avg(decode(source_set, 'ref', linear_value, null)), 3) linear_avg_ref, round(avg(decode(source_set, 'comp', linear_value, null)), 3) linear_avg_comp, @@ -4482,7 +4476,7 @@ else linear_avg_ref end, 6) as avg_group_two, to_char( p_value, '9.99EEEE') as p_value, p_value sorting_p_value - from webready.TranscriptAttributes_p ta, + from apidbtuning.TranscriptAttributes ta, (select na_feature_id, round(avg(decode(source_set, 'ref', linear_value, null)), 3) linear_avg_ref, round(avg(decode(source_set, 'comp', linear_value, null)), 3) linear_avg_comp, @@ -4557,7 +4551,7 @@ else linear_avg_ref end, 6) as avg_group_two, to_char( p_value, '9.99EEEE') as p_value, p_value sorting_p_value - from webready.TranscriptAttributes_p ta, + from apidbtuning.TranscriptAttributes ta, (select na_feature_id, round(avg(decode(source_set, 'ref', linear_value, null)), 3) linear_avg_ref, round(avg(decode(source_set, 'comp', linear_value, null)), 3) linear_avg_comp, @@ -4627,7 +4621,7 @@ else linear_avg_ref end, 6) as avg_group_two, to_char( p_value, '9.99EEEE') as p_value, p_value sorting_p_value - from webready.TranscriptAttributes_p ta, + from apidbtuning.TranscriptAttributes ta, (select na_feature_id, round(avg(decode(source_set, 'ref', linear_value, null)), 3) linear_avg_ref, round(avg(decode(source_set, 'comp', linear_value, null)), 3) linear_avg_comp, @@ -4733,9 +4727,8 @@ UPDATE ##WDK_CACHE_TABLE## SET source_id = ( SELECT min(source_id) - FROM webready.TranscriptAttributes_p + FROM apidbtuning.TranscriptAttributes WHERE gene_source_id = ##WDK_CACHE_TABLE##.gene_source_id - AND org_abbrev IN (%%PARTITION_KEYS%%) ) WHERE wdk_instance_id = ##WDK_CACHE_INSTANCE_ID## AND source_id IS NULL @@ -4877,7 +4870,7 @@ WHERE sl.protocol_app_node_id = pan.protocol_app_node_id AND pan.protocol_app_node_id in ($$samples_fc_ref_generic$$) AND pan.protocol_app_node_id = res.protocol_app_node_id - ) expr, webready.TranscriptAttributes_p ta + ) expr, apidbtuning.TranscriptAttributes ta WHERE ( $$protein_coding_only$$ = 'no' OR ta.gene_type = $$protein_coding_only$$ ) AND $$regulated_dir$$ (expr.fold_difference) >= $$fold_difference$$ AND ta.gene_na_feature_id = expr.gene_feature_id @@ -4907,9 +4900,9 @@ = $$fold_change$$ AND r.confidence >= $$confidence$$ @@ -4939,12 +4932,12 @@ = $$fold_change$$ - AND coalesce(r.adj_p_value, r.p_value) <= to_char($$dcc_p_value$$,'99.99999999999999') + AND coalesce(r.adj_p_value, r.p_value) <= $$dcc_p_value$$ AND r.protocol_app_node_id = $$samples_direct_generic_confidence$$ AND ta.gene_na_feature_id = r.na_feature_id AND ( $$protein_coding_only$$ = 'no' OR ta.gene_type = $$protein_coding_only$$ ) @@ -4969,7 +4962,7 @@ = $$start_point$$ AND (gene_start_min <= $$end_point$$ OR $$end_point$$ = 0) @@ -5249,7 +5244,7 @@ @@ -5479,19 +5474,17 @@ select distinct ta.gene_source_id WHEN (nfe.categorical_value = 1) THEN 'Medium' ELSE 'Low' END AS confidence FROM results.nafeatureexpression nfe - , webready.TranscriptAttributes_p ta + , apidbtuning.TranscriptAttributes ta , study.protocolappnode pan - , study.studylink sl - , study.study ps - , study.study i + , study.nodenodeset sl + , study.nodeset ps , sres.externaldatabaserelease r , sres.externaldatabase d WHERE ta.gene_na_feature_id = nfe.na_feature_id AND nfe.protocol_app_node_id = pan.protocol_app_node_id AND pan.protocol_app_node_id = sl.protocol_app_node_id - AND sl.study_id = ps.study_id - AND ps.investigation_id = i.study_id - AND i.external_database_release_id = r.external_database_release_id + AND sl.node_set_id = ps.node_set_id + AND ps.external_database_release_id = r.external_database_release_id AND r.external_database_id = d.external_database_id AND d.NAME ='tbruTREU927_quantitative_massSpec_Guther_glycosomal_proteome_RSRC' AND nfe.VALUE >= $$min_glycosome_score$$ @@ -5528,7 +5521,7 @@ select distinct ta.gene_source_id - + @@ -5593,7 +5586,7 @@ select distinct ta.gene_source_id - + @@ -5917,7 +5910,7 @@ select distinct ta.gene_source_id , ta.project_id, 'Y' as matched_result , string_agg(ds.gene_source_id, ', ') AS input_id , max(coefficient) as max_coeff, min(coefficient) as min_coeff - FROM webready.TranscriptAttributes_p ta, Apidb.FungiCoexpression c, + FROM apidbtuning.TranscriptAttributes ta, Apidb.FungiCoexpression c, ($$ds_gene_ids$$) ds, webready.GeneId_p gi WHERE gi.gene= ta.gene_source_id AND ( ( c.gene_id = gi.id AND c.associated_gene_id = ds.gene_source_id ) @@ -5947,7 +5940,7 @@ select distinct ta.gene_source_id ,ta.project_id, 'Y' as matched_result , $$single_gene_id$$ AS input_id , coefficient - FROM webready.TranscriptAttributes_p ta, Apidb.FungiCoexpression c, + FROM apidbtuning.TranscriptAttributes ta, Apidb.FungiCoexpression c, webready.GeneId_p gi WHERE c.gene_id = $$single_gene_id$$ AND c.associated_gene_id = gi.id @@ -5985,7 +5978,7 @@ select distinct ta.gene_source_id - + @@ -6014,7 +6007,8 @@ select distinct ta.gene_source_id JOIN sres.externaldatabaserelease edr ON edr.external_database_release_id = $$singleCellDataset$$ JOIN sres.externaldatabase ed - ON ed.external_database_id = edr.external_database_id; + ON ed.external_database_id = edr.external_database_id + WHERE ta.org_abbrev in ($$organismsWithSingleCell$$) ]]> @@ -6066,7 +6060,7 @@ select distinct ta.gene_source_id WITH gene_result as $$gene_result$$, missing_transcripts as ( select ta.gene_source_id, ta.source_id, ta.project_id, 10 as wdk_weight - from (select distinct gene_source_id from gene_result) found_genes, webready.TranscriptAttributes_p ta + from (select distinct gene_source_id from gene_result) found_genes, apidbtuning.TranscriptAttributes ta where found_genes.gene_source_id = ta.gene_source_id except select gene_source_id, source_id, project_id, 10 as wdk_weight @@ -6081,7 +6075,7 @@ select distinct ta.gene_source_id -- for the genes in this result that had missing transcripts, all their transcripts select ta.gene_source_id, ta.source_id, ta.project_id, 10 as wdk_weight - from missing_transcripts mt, webready.TranscriptAttributes_p ta + from missing_transcripts mt, apidbtuning.TranscriptAttributes ta where mt.gene_source_id = ta.gene_source_id and $$genesWithTranscripts$$ = 'genes_missing_transcripts' and $$missingOrFoundTranscripts$$ = 'all_transcripts' @@ -6171,7 +6165,7 @@ select distinct ta.gene_source_id diff --git a/Model/lib/wdk/model/questions/queries/genomicQueries.xml b/Model/lib/wdk/model/questions/queries/genomicQueries.xml index 34ef543aa..1699b2631 100644 --- a/Model/lib/wdk/model/questions/queries/genomicQueries.xml +++ b/Model/lib/wdk/model/questions/queries/genomicQueries.xml @@ -68,10 +68,9 @@ @@ -327,12 +326,10 @@ , pan.name FROM apidb.chrcopynumber ccn , study.protocolappnode pan - , dots.nasequence ns , webready.GenomicSeqAttributes_p sa WHERE ccn.protocol_app_node_id in ($$CNV_strain$$) AND ccn.protocol_app_node_id = pan.protocol_app_node_id - AND ns.na_sequence_id = ccn.na_sequence_id - AND ns.source_id = sa.source_id + AND sa.na_sequence_id = ccn.na_sequence_id AND sa.chromosome IS NOT NULL ) , median AS ( diff --git a/Model/lib/wdk/model/questions/queries/pathwayQueries.xml b/Model/lib/wdk/model/questions/queries/pathwayQueries.xml index 0f4de27c3..54b84a9a4 100644 --- a/Model/lib/wdk/model/questions/queries/pathwayQueries.xml +++ b/Model/lib/wdk/model/questions/queries/pathwayQueries.xml @@ -1,5 +1,5 @@ - + @@ -35,7 +35,7 @@ , sres.externaldatabase ed , sres.externaldatabaserelease edr WHERE ( - p.pathway_id LIKE REPLACE(REPLACE(REPLACE(REPLACE($$metabolic_pathway_id$$,' ',''),'-', '%'),'*','%'),'any','%') + p.pathway_id::text LIKE REPLACE(REPLACE(REPLACE(REPLACE($$metabolic_pathway_id$$,' ',''),'-', '%'),'*','%'),'any','%') OR lower(p.source_id) LIKE CONCAT('%', REPLACE(REPLACE(REPLACE(REPLACE(lower($$pathway_wildcard$$),' ',''),'-', '%'),'*','%'),'any','%'), '%') OR lower(p.name) LIKE CONCAT('%', REPLACE(REPLACE(REPLACE(REPLACE(lower($$pathway_wildcard$$),' ',''),'-', '%'),'*','%'),'any','%'), '%') ) @@ -67,7 +67,7 @@ AS (select pathway_source from ($$ds_pathway_id$$)) SELECT source_id, pathway_source, string_agg(identifier, ',') as identifiers, - string_agg(type, ',') as type, + string_agg(type, ',') as type FROM ( -- Compounds SELECT distinct pa.source_id as source_id diff --git a/Model/lib/wdk/model/questions/queries/popsetQueries.xml b/Model/lib/wdk/model/questions/queries/popsetQueries.xml index 1d7c5e437..0ac93b5a1 100644 --- a/Model/lib/wdk/model/questions/queries/popsetQueries.xml +++ b/Model/lib/wdk/model/questions/queries/popsetQueries.xml @@ -144,11 +144,11 @@ from apidbtuning.PopsetAttributes s select pa.source_id, pa.project_id from SRES.BIBLIOGRAPHICREFERENCE br , study.studybibref sbr - , study.studylink sl + , study.nodenodeset sl , apidbtuning.popsetattributes pa where br.title = $$study$$ and br.BIBLIOGRAPHIC_REFERENCE_ID = sbr.BIBLIOGRAPHIC_REFERENCE_ID - and sbr.study_id = sl.study_id + and sbr.node_set_id = sl.node_set_id and sl.PROTOCOL_APP_NODE_ID = pa.PROTOCOL_APP_NODE_ID ]]> diff --git a/Model/lib/wdk/model/questions/queries/spanQueries.xml b/Model/lib/wdk/model/questions/queries/spanQueries.xml index 1529303f7..4da26f8e7 100644 --- a/Model/lib/wdk/model/questions/queries/spanQueries.xml +++ b/Model/lib/wdk/model/questions/queries/spanQueries.xml @@ -125,7 +125,7 @@ , lrt.transcript_novelty FROM apidb.longreadtranscript lrt , JSON_TABLE(count_data, '$.*' COLUMNS (reads INTEGER PATH '$')) count_table - , webready.GenomicSeqAttributes_p gsa + , apidbtuning.GenomicSeqAttributes gsa , sres.externaldatabase ed , sres.externaldatabaserelease edr , apidbtuning.organismattributes oa @@ -194,11 +194,12 @@ select INTRON_FEATURE_ID as feature_id, gsa.project_id, ab.internal_abbrev, CONCAT(gij.sequence_source_id, ':', gij.segment_start, '-', gij.segment_end, CASE gij.is_reversed WHEN 0 THEN ':f' WHEN 1 THEN ':r' END) as source_id - from ApidbTuning.GeneIntronJunction gij, webready.GenomicSeqJunctionStats_p stats ,sres.taxonname tn ,webready.GenomicSeqAttributes_p gsa ,apidbtuning.organismattributes ab + from webready.GeneIntronJunction_p gij, webready.GenomicSeqJunctionStats_p stats ,sres.taxonname tn ,webready.GenomicSeqAttributes_p gsa ,apidbtuning.organismattributes ab WHERE gij.na_sequence_id = stats.na_sequence_id and gsa.taxon_id = tn.taxon_id and gsa.na_sequence_ID = gij.na_sequence_id and ab.organism_name = gsa.organism + and gij.org_abbrev in ($$organism_span$$) and gsa.org_abbrev in ($$organism_span$$) and stats.org_abbrev in ($$organism_span$$) AND gij.segment_end - gij.segment_start <= stats.max_intron_length * 2 @@ -229,19 +230,21 @@ select INTRON_FEATURE_ID as feature_id, and gsa.taxon_id = tn.taxon_id and gsa.na_sequence_ID = gij.na_sequence_id and ab.organism_name = gsa.organism + and gij.org_abbrev in ($$organism_span$$) and gsa.org_abbrev in ($$organism_span$$) and stats.org_abbrev in ($$organism_span$$) AND gij.segment_end - gij.segment_start <= stats.max_intron_length * 4 AND gij.total_unique >= CASE WHEN contained = 1 THEN stats.min_annot_score ELSE 5*stats.min_annot_score END AND (gij.contained = 0 or gij.percent_max >= stats.min_annot_percent_max) AND gij.intron_feature_id not in ( - select gij.intron_feature_id - from ApidbTuning.GeneIntronJunction gij, webready.GenomicSeqJunctionStats_p stats - WHERE gij.na_sequence_id = stats.na_sequence_id - AND gij.segment_end - gij.segment_start <= stats.max_intron_length * 2 - AND gij.total_unique >= CASE WHEN contained = 1 THEN stats.perc01_annot_score ELSE 5*stats.perc01_annot_score END - AND (gij.contained = 0 or gij.percent_max >= 2 /*stats.perc0005_annot_percent_max*/) - + select gij.intron_feature_id + from ApidbTuning.GeneIntronJunction gij, webready.GenomicSeqJunctionStats_p stats + WHERE gij.na_sequence_id = stats.na_sequence_id + AND gij.segment_end - gij.segment_start <= stats.max_intron_length * 2 + AND gij.total_unique >= CASE WHEN contained = 1 THEN stats.perc01_annot_score ELSE 5*stats.perc01_annot_score END + AND (gij.contained = 0 or gij.percent_max >= 2 /*stats.perc0005_annot_percent_max*/) + AND gij.org_abbrev in ($$organism_span$$) + AND stats.org_abbrev in ($$organism_span$$) ) ) where (confidence = $$Intron_junction_confidence$$ or 'all' = $$Intron_junction_confidence$$) @@ -406,6 +409,7 @@ and annotated_intron in ($$Intron_junction_novelty$$) AND cef.name = gls.HAPLOTYPE_BLOCK_NAME AND nl.na_feature_id = cef.na_feature_id AND cef.na_sequence_id = ens.na_sequence_id + AND ga.org_abbrev = 'pfal3D7' AND gls.LOD_SCORE_MANT * power(10::double precision, gls.LOD_SCORE_EXP) >= $$lod_score$$ ) t GROUP BY sequence_id, start_loc, end_loc diff --git a/Model/lib/wdk/model/questions/spanQuestions.xml b/Model/lib/wdk/model/questions/spanQuestions.xml index d5425d0ee..04b422f98 100644 --- a/Model/lib/wdk/model/questions/spanQuestions.xml +++ b/Model/lib/wdk/model/questions/spanQuestions.xml @@ -585,7 +585,7 @@ doi:10.1371/journal.pbio.0060238 @@ -609,7 +609,7 @@ doi:10.1371/journal.pbio.0060238 - LongReadRNASeq + longReadrnaseq diff --git a/Model/lib/wdk/model/records/compoundAttributeQueries.xml b/Model/lib/wdk/model/records/compoundAttributeQueries.xml index cea95f737..005962491 100644 --- a/Model/lib/wdk/model/records/compoundAttributeQueries.xml +++ b/Model/lib/wdk/model/records/compoundAttributeQueries.xml @@ -1,5 +1,5 @@ - + CID:93072 diff --git a/Model/lib/wdk/model/records/compoundRecord.xml b/Model/lib/wdk/model/records/compoundRecord.xml index 3bdb64621..dea506852 100644 --- a/Model/lib/wdk/model/records/compoundRecord.xml +++ b/Model/lib/wdk/model/records/compoundRecord.xml @@ -1,5 +1,5 @@ - + diff --git a/Model/lib/wdk/model/records/compoundTableQueries.xml b/Model/lib/wdk/model/records/compoundTableQueries.xml index 6b5ec7920..e7db24f43 100644 --- a/Model/lib/wdk/model/records/compoundTableQueries.xml +++ b/Model/lib/wdk/model/records/compoundTableQueries.xml @@ -1,5 +1,5 @@ - + CID:93072 diff --git a/Model/lib/wdk/model/records/dynSpanAttributeQueries.xml b/Model/lib/wdk/model/records/dynSpanAttributeQueries.xml index 51e2996a5..e47bbe145 100644 --- a/Model/lib/wdk/model/records/dynSpanAttributeQueries.xml +++ b/Model/lib/wdk/model/records/dynSpanAttributeQueries.xml @@ -56,22 +56,22 @@ SELECT ids.source_id, ids.project_id, lower(ids.project_id) as project_id_lc,ids.seq_source_id, ids.start_min, ids.end_max, ids.strand, (ids.end_max - ids.start_min + 1) AS length, - trim(to_char(ids.end_max,'999,999,999')) as end_text, - trim(to_char(ids.start_min,'999,999,999')) as start_text, - trim(to_char((ids.end_max - ids.start_min + 1),'999,999,999')) as length_text, + ids.end_max::text as end_text, + ids.start_min::text as start_text, + (ids.end_max - ids.start_min + 1)::text as length_text, sa.organism, o.public_abbrev as organismAbbrev, ids.start_min - 1000 AS context_start, ids.end_max + 1000 AS context_end FROM ( SELECT source_id, project_id, regexp_substr(source_id, '[^:]+', 1, 1) as seq_source_id, - regexp_substr(regexp_substr(source_id, '[^:]+', 1, 2), '[^\-]+', 1,1) as start_min, - regexp_substr(regexp_substr(source_id, '[^:]+', 1, 2), '[^\-]+', 1,2) as end_max, + regexp_substr(regexp_substr(source_id, '[^:]+', 1, 2), '[^\-]+', 1,1)::integer as start_min, + regexp_substr(regexp_substr(source_id, '[^:]+', 1, 2), '[^\-]+', 1,2)::integer as end_max, case when regexp_substr(source_id, '[^:]+', 1, 3) = 'f' then '+' when regexp_substr(source_id, '[^:]+', 1, 3) = 'r' then '-' else 'Unknown' end as strand FROM (##WDK_ID_SQL##) t ) ids - LEFT JOIN webready.GenomicSeqAttributes_p sa ON ids.seq_source_id = sa.source_id + LEFT JOIN apidbtuning.GenomicSeqAttributes sa ON ids.seq_source_id = sa.source_id INNER JOIN apidbtuning.organismattributes o ON o.organism_name = sa.organism ]]> @@ -113,7 +113,7 @@ else 'Unknown' end as strand FROM (##WDK_ID_SQL##) t ) ids - LEFT JOIN webready.GenomicSeqAttributes_p sa ON ids.seq_source_id = sa.source_id + LEFT JOIN apidbtuning.GenomicSeqAttributes sa ON ids.seq_source_id = sa.source_id INNER JOIN apidbtuning.organismattributes o ON o.organism_name = sa.organism ]]> @@ -253,4 +253,4 @@ --> - \ No newline at end of file + diff --git a/Model/lib/wdk/model/records/geneAttributeQueries.xml b/Model/lib/wdk/model/records/geneAttributeQueries.xml index 3fa90a214..8da438099 100644 --- a/Model/lib/wdk/model/records/geneAttributeQueries.xml +++ b/Model/lib/wdk/model/records/geneAttributeQueries.xml @@ -178,8 +178,8 @@ WHERE ga.org_abbrev IN (%%PARTITION_KEYS%%) 1) THEN 'Yes' ELSE 'No' END AS show_strains - FROM webready.GeneAttributes_p bfmv - WHERE bfmv.org_abbrev IN (%%PARTITION_KEYS%%) + FROM apidbtuning.GeneAttributes bfmv + -- FROM webready.GeneAttributes_p bfmv + -- WHERE bfmv.org_abbrev IN (%%PARTIxxxxxxxTION_KEYS%%) ]]> diff --git a/Model/lib/wdk/model/records/geneRecord.xml b/Model/lib/wdk/model/records/geneRecord.xml index af6a9b98c..ebe1d9f9a 100644 --- a/Model/lib/wdk/model/records/geneRecord.xml +++ b/Model/lib/wdk/model/records/geneRecord.xml @@ -3433,11 +3433,11 @@ name" internal="true"/> excludeProjects="EuPathDB,HostDB"> - + diff --git a/Model/lib/wdk/model/records/geneTableQueries.xml b/Model/lib/wdk/model/records/geneTableQueries.xml index bfb7ab9ac..842fb67c8 100644 --- a/Model/lib/wdk/model/records/geneTableQueries.xml +++ b/Model/lib/wdk/model/records/geneTableQueries.xml @@ -84,12 +84,12 @@ , ed.DATASET_PRESENTER_DISPLAY_NAME from apidb.nafeaturelist fl , webready.GeneAttributes_p ga - , study.studylink sl + , study.nodenodeset sl , study.protocolappnode pan - , study.study s + , study.nodeset s , APIDBTUNING.EXTERNALDBDATASETPRESENTER ed where sl.protocol_app_node_id = fl.protocol_app_node_id - and sl.study_id= s.study_id + and sl.node_set_id= s.node_set_id and fl.na_feature_id = ga.na_feature_id and sl.PROTOCOL_APP_NODE_ID = pan.PROTOCOL_APP_NODE_ID and s.EXTERNAL_DATABASE_RELEASE_ID = ed.EXTERNAL_DATABASE_RELEASE_ID @@ -117,12 +117,12 @@ , ed.DATASET_PRESENTER_DISPLAY_NAME from apidb.nafeaturelist fl , webready.GeneAttributes_p ga - , study.studylink sl + , study.nodenodeset sl , study.protocolappnode pan - , study.study s + , study.nodeset s , APIDBTUNING.EXTERNALDBDATASETPRESENTER ed where sl.protocol_app_node_id = fl.protocol_app_node_id - and sl.study_id= s.study_id + and sl.node_set_id= s.node_set_id and fl.na_feature_id = ga.na_feature_id and sl.PROTOCOL_APP_NODE_ID = pan.PROTOCOL_APP_NODE_ID and s.EXTERNAL_DATABASE_RELEASE_ID = ed.EXTERNAL_DATABASE_RELEASE_ID @@ -164,6 +164,7 @@ AND ts.SPECIES_TAXON_ID = t.taxon_id AND ss.ncbi_tax_id = t.ncbi_tax_id and ga.org_abbrev IN (%%PARTITION_KEYS%%) + and ts.org_abbrev IN (%%PARTITION_KEYS%%) ) SELECT ta.gene_source_id AS source_id , ta.project_id @@ -512,6 +513,7 @@ AND ga.genus_species = sn.name AND dds.category in ('RNASeq','DNA Microarray Assay', 'SAGE', 'RT PCR') AND ga.org_abbrev IN (%%PARTITION_KEYS%%) + AND ts.org_abbrev IN (%%PARTITION_KEYS%%) GROUP BY ga.source_id, ga.project_id, ga.organism, ga.genus_species, graph_descrip.dataset, tn.name, dp.dataset_presenter_id, module,x_axis,y_axis, is_graph_custom,order_num, dds.category,dp.short_attribution --,ga.paralog_number @@ -623,6 +625,7 @@ AND ga.genus_species = sn.name AND dds.category = 'Protein expression (quantitative)' AND ga.org_abbrev IN (%%PARTITION_KEYS%%) + AND ts.org_abbrev IN (%%PARTITION_KEYS%%) ) g ]]> @@ -726,6 +729,7 @@ AND dds.name NOT LIKE '%CDS%' -- TODO: this is here for the horn dataset AND ga.genus_species = sn.name AND ga.org_abbrev IN (%%PARTITION_KEYS%%) + AND ts.org_abbrev IN (%%PARTITION_KEYS%%) ) g ]]> @@ -937,6 +941,7 @@ AND ga.genus_species = sn.name AND dds.category = 'Immunology' AND ga.org_abbrev IN (%%PARTITION_KEYS%%) + AND ts.org_abbrev IN (%%PARTITION_KEYS%%) ) g ) h , apidbtuning.datasetpresenter datapres @@ -1158,6 +1163,7 @@ from ( AND ga.genus_species = sn.name AND dds.category = 'Phenotype' AND ga.org_abbrev IN (%%PARTITION_KEYS%%) + AND ts.org_abbrev IN (%%PARTITION_KEYS%%) ) g ]]> @@ -1365,9 +1371,9 @@ from ( , CASE WHEN property = 'Tissue' THEN value END AS tissue , CASE WHEN property = 'Vegetative spores' THEN value END AS vegetativespores FROM APIDB.NAFEATUREPHENOTYPE r, webready.GeneAttributes_p ga, - study.protocolappnode pan, study.study s, study.studylink sl + study.protocolappnode pan, study.nodeset s, study.nodenodeset sl WHERE pan.PROTOCOL_APP_NODE_ID = r.PROTOCOL_APP_NODE_ID - and s.study_id = sl.study_id + and s.node_set_id = sl.node_set_id and sl.protocol_app_node_id = pan.protocol_app_node_id and s.name LIKE '%PHI-base_curated_phenotype_NAFeaturePhenotypeGeneric_RSRC' AND r.NA_FEATURE_ID = ga.NA_FEATURE_ID @@ -1445,9 +1451,9 @@ from ( , CASE WHEN property = 'Virulence Model' THEN value AS virulencemodel , CASE WHEN property = 'Species' THEN value AS species from apidb.nafeaturephenotype r, webready.GeneAttributes_p ga, - study.protocolappnode pan, study.study s , study.studyLink sl + study.protocolappnode pan, study.nodeset s , study.nodenodeset sl where pan.protocol_app_node_id = r.protocol_app_node_id - and s.study_id = sl.study_id + and s.node_set_id = sl.node_set_id and sl.protocol_app_node_id = pan.protocol_app_node_id and s.name LIKE '%_CGD_pheno_NAFeaturePhenotypeGeneric_RSRC' and r.na_feature_id = ga.na_feature_id @@ -1556,7 +1562,7 @@ from ( WHERE ga.na_feature_id = r.na_feature_id AND r.ROW_ALG_INVOCATION_ID IN ( SELECT DISTINCT s.ROW_ALG_INVOCATION_ID - FROM study.study s, sres.externaldatabase ed, sres.externaldatabaserelease edr + FROM study.nodeset s, sres.externaldatabase ed, sres.externaldatabaserelease edr WHERE ed.EXTERNAL_DATABASE_ID = edr.EXTERNAL_DATABASE_ID AND s.EXTERNAL_DATABASE_RELEASE_ID = edr.EXTERNAL_DATABASE_RELEASE_ID AND ed.name = 'pfal3D7_phenotype_pB_mutagenesis_MIS_MFS_RSRC' @@ -1578,7 +1584,7 @@ from ( where ga.na_feature_id = r.na_feature_id and r.row_alg_invocation_id in (select distinct s.row_alg_invocation_id - from study.study s, sres.externaldatabase ed, sres.externaldatabaserelease edr + from study.nodeset s, sres.externaldatabase ed, sres.externaldatabaserelease edr where ed.external_database_id = edr.external_database_id and s.external_database_release_id=edr.external_database_release_id and ed.name='pknoH_phenotype_piggyBac_mutagenesis_HME_MIS_OIS_RSRC') @@ -1603,7 +1609,7 @@ from ( where ga.na_feature_id = r.na_feature_id and r.row_alg_invocation_id in (select distinct s.row_alg_invocation_id - from study.study s, sres.externaldatabase ed, sres.externaldatabaserelease edr + from study.nodeset s, sres.externaldatabase ed, sres.externaldatabaserelease edr where ed.external_database_id = edr.external_database_id and s.external_database_release_id=edr.external_database_release_id and ed.name='pknoA1H1_phenotype_piggyBac_mutagenesis_MIS_MFS_RSRC') @@ -1698,6 +1704,7 @@ from ( AND ga.genus_species = sn.name AND dds.category = 'Phenotype' AND ga.org_abbrev IN (%%PARTITION_KEYS%%) + AND ts.org_abbrev IN (%%PARTITION_KEYS%%) ) g ]]> @@ -2410,9 +2417,9 @@ from ( + ]]> @@ -4428,11 +4430,14 @@ where org_abbrev in (%%PARTITION_KEYS%%) FROM webready.TranscriptAttributes_p ta INNER JOIN webready.TranscriptSequence_p tx_seq ON ta.source_id = tx_seq.source_id + AND tx_seq.org_abbrev IN (%%PARTITION_KEYS%%) INNER JOIN webready.TranscriptGenomicSequence_p gseq ON ta.source_id = gseq.source_id + AND gseq.org_abbrev IN (%%PARTITION_KEYS%%) LEFT JOIN webready.ProteinSequence_p ps ON ta.protein_source_id = ps.source_id + AND ps.org_abbrev IN (%%PARTITION_KEYS%%) LEFT JOIN webready.IntronUtrCoords_p iuc ON ta.na_feature_id = iuc.na_feature_id + AND iuc.org_abbrev IN (%%PARTITION_KEYS%%) WHERE ta.org_abbrev IN (%%PARTITION_KEYS%%) - AND gseq.org_abbrev IN (%%PARTITION_KEYS%%) ]]> @@ -4536,10 +4541,9 @@ where org_abbrev in (%%PARTITION_KEYS%%) results.nafeatureexpression nfe , webready.GeneAttributes_p ga , study.protocolappnode pan - , study.studylink sl - , study.study ps + , study.nodenodeset sl + , study.nodeset ps LEFT JOIN apidbtuning.profilesetdisplayinfo psdi ON ps.name = psdi.profile_set_name - , study.study i , sres.externaldatabaserelease r , sres.externaldatabase d , apidbtuning.datasetdatasource dd @@ -4555,9 +4559,8 @@ where org_abbrev in (%%PARTITION_KEYS%%) AND d.name = ggp.dataset_name AND nfe.protocol_app_node_id = pan.protocol_app_node_id AND pan.protocol_app_node_id = sl.protocol_app_node_id - AND sl.study_id = ps.study_id - AND ps.investigation_id = i.study_id - AND i.external_database_release_id = r.external_database_release_id + AND sl.node_set_id = ps.node_set_id + AND ps.external_database_release_id = r.external_database_release_id AND r.external_database_id = d.external_database_id AND d.name = dd.name AND dd.dataset_presenter_id = 'DS_98fb258539' -- this is the TriTryp RNA-Seq phenotype dataset id @@ -4651,10 +4654,9 @@ where org_abbrev in (%%PARTITION_KEYS%%) results.nafeaturehostresponse nfe , webready.GeneAttributes_p ga , study.protocolappnode pan - , study.studylink sl - , study.study ps + , study.nodenodeset sl + , study.nodeset ps LEFT JOIN apidbtuning.profilesetdisplayinfo psdi ON ps.name = psdi.profile_set_name - , study.study i , sres.externaldatabaserelease r , sres.externaldatabase d , apidbtuning.datasetdatasource dd @@ -4669,9 +4671,8 @@ where org_abbrev in (%%PARTITION_KEYS%%) AND d.name = ggp.dataset_name AND nfe.protocol_app_node_id = pan.protocol_app_node_id AND pan.protocol_app_node_id = sl.protocol_app_node_id - AND sl.study_id = ps.study_id - AND ps.investigation_id = i.study_id - AND i.external_database_release_id = r.external_database_release_id + AND sl.node_set_id = ps.node_set_id + AND ps.external_database_release_id = r.external_database_release_id AND r.external_database_id = d.external_database_id AND d.name = dd.name AND ga.org_abbrev IN (%%PARTITION_KEYS%%) @@ -4746,10 +4747,9 @@ SELECT genes.string_value AS gene, ag.display_name AS variable, av.string_value, apidb.phenotypescore cp , webready.GeneAttributes_p ga , study.protocolappnode pan - , study.studylink sl - , study.study ps + , study.nodenodeset sl + , study.nodeset ps LEFT JOIN apidbtuning.profilesetdisplayinfo psdi ON ps.name = psdi.profile_set_name - , study.study i , sres.externaldatabaserelease r , sres.externaldatabase d , apidbtuning.datasetdatasource dd @@ -4765,9 +4765,8 @@ SELECT genes.string_value AS gene, ag.display_name AS variable, av.string_value, AND d.name = p.dataset_name AND cp.protocol_app_node_id = pan.protocol_app_node_id AND pan.protocol_app_node_id = sl.protocol_app_node_id - AND sl.study_id = ps.study_id - AND ps.investigation_id = i.study_id - AND i.external_database_release_id = r.external_database_release_id + AND sl.node_set_id = ps.node_set_id + AND ps.external_database_release_id = r.external_database_release_id AND r.external_database_id = d.external_database_id AND d.name = dd.name AND ggp.profile_graph_id = ga.source_id @@ -4788,10 +4787,9 @@ SELECT genes.string_value AS gene, ag.display_name AS variable, av.string_value, apidb.phenotypegrowthrate cp , webready.GeneAttributes_p ga , study.protocolappnode pan - , study.studylink sl - , study.study ps + , study.nodenodeset sl + , study.nodeset ps LEFT JOIN apidbtuning.profilesetdisplayinfo psdi ON ps.name = psdi.profile_set_name - , study.study i , sres.externaldatabaserelease r , sres.externaldatabase d , apidbtuning.datasetdatasource dd @@ -4807,9 +4805,8 @@ SELECT genes.string_value AS gene, ag.display_name AS variable, av.string_value, AND d.name = p.dataset_name AND cp.protocol_app_node_id = pan.protocol_app_node_id AND pan.protocol_app_node_id = sl.protocol_app_node_id - AND sl.study_id = ps.study_id - AND ps.investigation_id = i.study_id - AND i.external_database_release_id = r.external_database_release_id + AND sl.node_set_id = ps.node_set_id + AND ps.external_database_release_id = r.external_database_release_id AND r.external_database_id = d.external_database_id AND d.name = dd.name AND ggp.profile_graph_id = ga.source_id diff --git a/Model/lib/wdk/model/records/genomicAttributeQueries.xml b/Model/lib/wdk/model/records/genomicAttributeQueries.xml index 0e7f0a6a8..6287c4e15 100644 --- a/Model/lib/wdk/model/records/genomicAttributeQueries.xml +++ b/Model/lib/wdk/model/records/genomicAttributeQueries.xml @@ -328,20 +328,20 @@ - SELECT ns.source_id, gs.project_id, - ns.source_id as gff_seqid, + SELECT gs.source_id, gs.project_id, + gs.source_id as gff_seqid, gs.project_id as gff_source, s.name as gff_type, 1 as gff_fstart, - ns.length as gff_fend, + gs.length as gff_fend, '.' as gff_score, '+' as gff_strand, '.' as gff_phase, - ns.source_id as gff_attr_id, - ns.source_id as gff_attr_web_id, - ns.source_id as gff_attr_name, - ns.description as gff_attr_description, - ns.length as gff_attr_size, + gs.source_id as gff_attr_id, + gs.source_id as gff_attr_web_id, + gs.source_id as gff_attr_name, + gs.sequence_description as gff_attr_description, + gs.length as gff_attr_size, 'dsDNA' as gff_attr_molecule_type, --TODO add this back --SUBSTR(tn.name, 1, regexp_instr(tn.name || ' ', ' ', 1, 2) - 1) as gff_attr_organism_name, @@ -352,17 +352,11 @@ WHEN s.name = 'apicoplast_chromosome' THEN 'plastid' ELSE 'nuclear' END) as gff_attr_localization FROM webready.GenomicSeqAttributes_p gs, - dots.NaSequence ns, - sres.externaldatabase ed, - sres.externaldatabaserelease edr, sres.TaxonName tn, sres.Taxon t, sres.GeneticCode g, sres.OntologyTerm s - WHERE ns.na_sequence_id = gs.na_sequence_id - AND ns.external_database_release_id = edr.external_database_release_id - AND edr.external_database_id = ed.external_database_id - AND ns.taxon_id = tn.taxon_id + WHERE gs.taxon_id = tn.taxon_id AND tn.name_class = 'scientific name' AND gs.taxon_id = t.taxon_id AND gs.so_id = s.source_id diff --git a/Model/lib/wdk/model/records/junctionAttributeQueries.xml b/Model/lib/wdk/model/records/junctionAttributeQueries.xml index 09cc38b4f..469fe0351 100644 --- a/Model/lib/wdk/model/records/junctionAttributeQueries.xml +++ b/Model/lib/wdk/model/records/junctionAttributeQueries.xml @@ -60,7 +60,7 @@ --> - SELECT count(*) FROM ApidbTuning.GeneIntronJunction + SELECT count(*) FROM webready.GeneIntronJunction_p @@ -73,7 +73,7 @@ @@ -96,7 +96,7 @@ diff --git a/Model/lib/wdk/model/records/pathwayAttributeQueries.xml b/Model/lib/wdk/model/records/pathwayAttributeQueries.xml index 5ef350790..d7452a0a9 100644 --- a/Model/lib/wdk/model/records/pathwayAttributeQueries.xml +++ b/Model/lib/wdk/model/records/pathwayAttributeQueries.xml @@ -1,5 +1,5 @@ - + ec00626 diff --git a/Model/lib/wdk/model/records/pathwayRecord.xml b/Model/lib/wdk/model/records/pathwayRecord.xml index df05f3cb3..746c9798c 100644 --- a/Model/lib/wdk/model/records/pathwayRecord.xml +++ b/Model/lib/wdk/model/records/pathwayRecord.xml @@ -1,5 +1,5 @@ - + diff --git a/Model/lib/wdk/model/records/pathwayTableQueries.xml b/Model/lib/wdk/model/records/pathwayTableQueries.xml index 6cfbd1e9d..f076d094f 100644 --- a/Model/lib/wdk/model/records/pathwayTableQueries.xml +++ b/Model/lib/wdk/model/records/pathwayTableQueries.xml @@ -1,6 +1,6 @@ - + ec00626 @@ -37,18 +37,22 @@ , pr.PRODUCTS_TEXT , CASE WHEN pr.ENZYME = '-.-.-.-' THEN 'N/A' - ELSE CONCAT('', pn.GENE_COUNT, '') + ELSE CONCAT('', gc.GENE_COUNT, '') END AS GENE_COUNT FROM webready.PathwayAttributes pa , webready.PathwayCompounds pc , webready.PathwayReactions pr , webready.PathwayNodes pn + , (select pathway_source_id, count(gene_source_id) as gene_count + from apidbtuning.PathwayGenesThin + group by pathway_source_id) as gc WHERE pc.pathway_id = pa.PATHWAY_ID AND pn.SOURCE_ID = pa.SOURCE_ID AND pr.REACTION_ID = pc.REACTION_ID AND pr.EXT_DB_NAME = pc.EXT_DB_NAME AND pr.ENZYME = pn.DISPLAY_LABEL + AND gc.pathway_source_id = pa.source_id ORDER BY pr.ENZYME ]]> diff --git a/Model/lib/wdk/model/records/popsetTableQueries.xml b/Model/lib/wdk/model/records/popsetTableQueries.xml index 5f6ccc084..02bddd1e9 100644 --- a/Model/lib/wdk/model/records/popsetTableQueries.xml +++ b/Model/lib/wdk/model/records/popsetTableQueries.xml @@ -341,10 +341,10 @@ and bc.ontology_entry_id = oe.ontology_entry_id CASE WHEN title IS NULL then 'N/A' WHEN title = 'Direct Submission' then 'N/A' ELSE CONCAT('view') end AS studyLink - FROM ApidbTuning.PopsetAttributes ia, Study.StudyLink sl, - Study.StudyBibRef bib, sres.BibliographicReference ref + FROM ApidbTuning.PopsetAttributes ia, Study.nodenodeset sl, + Study.StudyBibRef bib, sres.BibliographicReference ref WHERE ia.protocol_app_node_id = sl.protocol_app_node_id - AND sl.study_id = bib.study_id + AND sl.node_set_id = bib.node_set_id AND bib.bibliographic_reference_id = ref.bibliographic_reference_id ]]> diff --git a/Model/lib/wdk/model/records/sampleTableQueries.xml b/Model/lib/wdk/model/records/sampleTableQueries.xml index f19b732e4..df9747986 100644 --- a/Model/lib/wdk/model/records/sampleTableQueries.xml +++ b/Model/lib/wdk/model/records/sampleTableQueries.xml @@ -80,12 +80,12 @@ , edp.dataset_presenter_id FROM apidbtuning.SampleProcess sd , apidbTuning.PanResults panr - , study.Study s - , study.StudyLink sl + , study.nodeset s + , study.nodenodeset sl , apidbTuning.ExternalDbDatasetPresenter edp WHERE sd.output_pan_id = panr.pan_id AND panr.pan_id = sl.protocol_app_node_id - AND sl.study_id = s.study_id + AND sl.node_set_id = s.node_set_id AND s.external_database_release_id = edp.external_database_release_id) q WHERE q.dataset_presenter_id = dsp.dataset_presenter_id ]]> diff --git a/Model/lib/wdk/model/records/transcriptAttributeQueries.xml b/Model/lib/wdk/model/records/transcriptAttributeQueries.xml index 0e4a97192..7d4f529e0 100644 --- a/Model/lib/wdk/model/records/transcriptAttributeQueries.xml +++ b/Model/lib/wdk/model/records/transcriptAttributeQueries.xml @@ -96,8 +96,9 @@ ta.project_id AS project_id, ta.gene_source_id, a.ID as old_gene_source_id, ta.source_id as old_source_id, ta.project_id AS old_project_id - FROM webready.GeneId_p a, webready.TranscriptAttributes_p ta + FROM webready.GeneId_p a, apidbtuning.TranscriptAttributes ta WHERE ta.gene_source_id = a.gene + AND (ta.project_id = '@PROJECT_ID@' or 'UniDB' = '@PROJECT_ID@') -- AND a.unique_mapping = 1 ]]> @@ -112,7 +113,8 @@ SELECT ta.source_id, ta.gene_source_id, ta.project_id AS project_id - FROM webready.TranscriptAttributes_p ta + FROM apidbtuning.TranscriptAttributes ta + AND (ta.project_id = '@PROJECT_ID@' or 'UniDB' = '@PROJECT_ID@') ]]> @@ -126,7 +128,7 @@ @@ -459,8 +460,9 @@ replace(bfmv.predicted_go_id_component, 'GO_', 'GO:') as predicted_go_id_component, replace(bfmv.predicted_go_id_function, 'GO_', 'GO:') as predicted_go_id_function, replace(bfmv.predicted_go_id_process, 'GO_', 'GO:') as predicted_go_id_process - FROM webready.TranscriptAttributes_p bfmv - WHERE bfmv.org_abbrev in (%%PARTITION_KEYS%%) + FROM apidbtuning.TranscriptAttributes bfmv + -- FROM webready.TranscriptAttributes_p bfmv + -- WHERE bfmv.org_abbrev in (%%PARTITxxxxxxxION_KEYS%%) ]]> @@ -1077,6 +1079,7 @@ ELSE 'N/A' end as apollo_link_out ) AND ds.taxon_id = ts.taxon_id AND ts.species_taxon_id = tn.taxon_id + AND ts.org_abbrev in (%%PARTITION_KEYS%%) ) d RIGHT JOIN webready.GeneAttributes_p ga ON ga.species = d.species WHERE ga.org_abbrev in (%%PARTITION_KEYS%%) ]]> @@ -1694,16 +1697,15 @@ AND ta.org_abbrev in (%%PARTITION_KEYS%%) string_agg(DISTINCT interpro_primary_id, ', ') FILTER (WHERE interpro_db_name = 'SUPERFAMILY') AS superfamily_id, max(interpro_desc) FILTER (WHERE interpro_db_name = 'SUPERFAMILY') AS superfamily_description FROM webready.InterproResults_p i - RIGHT JOIN webready.TranscriptAttributes_p ta ON ta.source_id = i.transcript_source_id + RIGHT JOIN webready.TranscriptAttributes_p ta ON ta.source_id = i.transcript_source_id AND i.org_abbrev in (%%PARTITION_KEYS%%) WHERE ta.org_abbrev in (%%PARTITION_KEYS%%) - AND i.org_abbrev in (%%PARTITION_KEYS%%) GROUP BY ta.source_id, ta.gene_source_id ]]> - + @@ -1718,39 +1720,83 @@ AND ta.org_abbrev in (%%PARTITION_KEYS%%) = 1 THEN round(greatest(1,bfd3_cds) / greatest(1,no_tet_cds), 1) - ELSE round(-1 * greatest(1,no_tet_cds) / greatest(1,bfd3_cds), 1) END, - CASE WHEN (bfd3_cds < 1 or no_tet_cds < 1) then '*' else '' END) AS fc_bfd3_cds - , CONCAT(CASE WHEN greatest(1,bfd6_cds) / greatest(1,no_tet_cds) >= 1 THEN round(greatest(1,bfd6_cds) / greatest(1,no_tet_cds), 1) - ELSE round(-1 * greatest(1,no_tet_cds) / greatest(1,bfd6_cds), 1) END, - CASE WHEN (bfd6_cds < 1 or no_tet_cds < 1) then '*' else '' END) AS fc_bfd6_cds - , CONCAT(CASE WHEN greatest(1,pf_cds) / greatest(1,no_tet_cds) >= 1 THEN round(greatest(1,pf_cds) / greatest(1,no_tet_cds), 1) - ELSE round(-1 * greatest(1,no_tet_cds) / greatest(1,pf_cds), 1) END, - CASE WHEN (pf_cds < 1 or no_tet_cds < 1) then '*' else '' END) AS fc_pf_cds - , CONCAT(CASE WHEN greatest(1,dif_cds) / greatest(1,no_tet_cds) >= 1 THEN round(greatest(1,dif_cds) / greatest(1,no_tet_cds), 1) - else round(-1 * greatest(1,no_tet_cds) / greatest(1,dif_cds), 1) end, - case when (dif_cds < 1 or no_tet_cds < 1) then '*' else '' end) as fc_dif_cds - FROM webready.TranscriptAttributes_p ta, ( - select ta.gene_source_id as gene_id, ps.protocol_app_node_name, round(nfe.value,2) as value - from apidbtuning.profilesamples ps, results.nafeatureexpression nfe, webready.TranscriptAttributes_p ta - where ps.study_name = 'T.brucei paired end RNA Seq data from Horn aligned with cds coordinates [htseq-union - unstranded - tpm - unique]' - and ps.protocol_app_node_id = nfe.protocol_app_node_id - and ps.profile_type='values' - and ps.protocol_app_node_id = nfe.protocol_app_node_id - and ta.gene_na_feature_id = nfe.na_feature_id(+) - AND ta.org_abbrev IN (%%PARTITION_KEYS%%) - ) pivot ( - max(value) as cds - for protocol_app_node_name in ('No_Tet' no_tet, 'BFD3' bfd3, 'BFD6' bfd6, 'PF' pf, 'DIF' dif) - ) res - WHERE ta.gene_source_id = res.gene_id (+) - AND ta.org_abbrev in (%%PARTITION_KEYS%%) +SELECT + ta.source_id, + ta.gene_source_id, + ta.project_id, + res.*, + + CONCAT( + CASE + WHEN greatest(1, bfd3_cds) / greatest(1, no_tet_cds) >= 1 + THEN round(greatest(1, bfd3_cds) / greatest(1, no_tet_cds), 1) + ELSE + round(-1 * greatest(1, no_tet_cds) / greatest(1, bfd3_cds), 1) + END, + CASE WHEN (bfd3_cds < 1 OR no_tet_cds < 1) THEN '*' ELSE '' END + ) AS fc_bfd3_cds, + + CONCAT( + CASE + WHEN greatest(1, bfd6_cds) / greatest(1, no_tet_cds) >= 1 + THEN round(greatest(1, bfd6_cds) / greatest(1, no_tet_cds), 1) + ELSE + round(-1 * greatest(1, no_tet_cds) / greatest(1, bfd6_cds), 1) + END, + CASE WHEN (bfd6_cds < 1 OR no_tet_cds < 1) THEN '*' ELSE '' END + ) AS fc_bfd6_cds, + + CONCAT( + CASE + WHEN greatest(1, pf_cds) / greatest(1, no_tet_cds) >= 1 + THEN round(greatest(1, pf_cds) / greatest(1, no_tet_cds), 1) + ELSE + round(-1 * greatest(1, no_tet_cds) / greatest(1, pf_cds), 1) + END, + CASE WHEN (pf_cds < 1 OR no_tet_cds < 1) THEN '*' ELSE '' END + ) AS fc_pf_cds, + + CONCAT( + CASE + WHEN greatest(1, dif_cds) / greatest(1, no_tet_cds) >= 1 + THEN round(greatest(1, dif_cds) / greatest(1, no_tet_cds), 1) + ELSE + round(-1 * greatest(1, no_tet_cds) / greatest(1, dif_cds), 1) + END, + CASE WHEN (dif_cds < 1 OR no_tet_cds < 1) THEN '*' ELSE '' END + ) AS fc_dif_cds + +FROM webready.transcriptattributes_p ta + +LEFT JOIN ( + SELECT + ta.gene_source_id AS gene_id, + + MAX(value::numeric) FILTER (WHERE protocol_app_node_name = 'No_Tet') AS no_tet_cds, + MAX(value::numeric) FILTER (WHERE protocol_app_node_name = 'BFD3') AS bfd3_cds, + MAX(value::numeric) FILTER (WHERE protocol_app_node_name = 'BFD6') AS bfd6_cds, + MAX(value::numeric) FILTER (WHERE protocol_app_node_name = 'PF') AS pf_cds, + MAX(value::numeric) FILTER (WHERE protocol_app_node_name = 'DIF') AS dif_cds + + FROM apidbtuning.profilesamples ps + JOIN results.nafeatureexpression nfe + ON ps.protocol_app_node_id = nfe.protocol_app_node_id + JOIN webready.transcriptattributes_p ta + ON ta.gene_na_feature_id = nfe.na_feature_id + WHERE ps.study_name = + 'T.brucei paired end RNA Seq data from Horn aligned with cds coordinates [htseq-union - unstranded - tpm - unique]' + AND ps.profile_type = 'values' + AND ta.org_abbrev IN (%%PARTITION_KEYS%%) + GROUP BY ta.gene_source_id +) res +ON ta.gene_source_id = res.gene_id + +WHERE ta.org_abbrev IN (%%PARTITION_KEYS%%) ]]> - + @@ -1765,34 +1811,78 @@ AND ta.org_abbrev in (%%PARTITION_KEYS%%) = 1 THEN round(greatest(1,bfd3_model) / greatest(1,no_tet_model), 1) - ELSE round(-1 * greatest(1,no_tet_model) / greatest(1,bfd3_model), 1) END, - CASE WHEN (bfd3_model < 1 or no_tet_model < 1) then '*' else '' END) AS fc_bfd3_model - , CONCAT(CASE WHEN greatest(1,bfd6_model) / greatest(1,no_tet_model) >= 1 THEN round(greatest(1,bfd6_model) / greatest(1,no_tet_model), 1) - ELSE round(-1 * greatest(1,no_tet_model) / greatest(1,bfd6_model), 1) END, - CASE WHEN (bfd6_model < 1 or no_tet_model < 1) then '*' else '' END) AS fc_bfd6_model - , CONCAT(CASE WHEN greatest(1,pf_model) / greatest(1,no_tet_model) >= 1 THEN round(greatest(1,pf_model) / greatest(1,no_tet_model), 1) - ELSE round(-1 * greatest(1,no_tet_model) / greatest(1,pf_model), 1) END, - CASE WHEN (pf_model < 1 or no_tet_model < 1) then '*' else '' END) AS fc_pf_model - , CONCAT(CASE WHEN greatest(1,dif_model) / greatest(1,no_tet_model) >= 1 THEN round(greatest(1,dif_model) / greatest(1,no_tet_model), 1) - else round(-1 * greatest(1,no_tet_model) / greatest(1,dif_model), 1) end, - case when (dif_model < 1 or no_tet_model < 1) then '*' else '' end) as fc_dif_model - FROM webready.TranscriptAttributes_p ta, ( - select ta.gene_source_id as gene_id, ps.protocol_app_node_name, round(nfe.value,2) as value - from apidbtuning.profilesamples ps, results.nafeatureexpression nfe, webready.TranscriptAttributes_p ta - where ps.study_name = 'T.brucei paired end RNA Seq data from Horn [htseq-union - unstranded - tpm - unique]' - and ps.protocol_app_node_id = nfe.protocol_app_node_id - and ps.profile_type='values' - and ps.protocol_app_node_id = nfe.protocol_app_node_id - and ta.gene_na_feature_id = nfe.na_feature_id(+) - AND ta.org_abbrev IN (%%PARTITION_KEYS%%) - ) pivot ( - max(value) as model - for protocol_app_node_name in ('No_Tet' no_tet, 'BFD3' bfd3, 'BFD6' bfd6, 'PF' pf, 'DIF' dif) - ) res - WHERE ta.gene_source_id = res.gene_id (+) - AND ta.org_abbrev in (%%PARTITION_KEYS%%) +SELECT + ta.source_id, + ta.gene_source_id, + ta.project_id, + res.*, + + CONCAT( + CASE + WHEN greatest(1, bfd3_model) / greatest(1, no_tet_model) >= 1 + THEN round((greatest(1, bfd3_model)::numeric / greatest(1, no_tet_model)::numeric), 1) + ELSE + round((-1 * greatest(1, no_tet_model)::numeric / greatest(1, bfd3_model)::numeric), 1) + END, + CASE WHEN (bfd3_model < 1 OR no_tet_model < 1) THEN '*' ELSE '' END + ) AS fc_bfd3_model, + + CONCAT( + CASE + WHEN greatest(1, bfd6_model) / greatest(1, no_tet_model) >= 1 + THEN round((greatest(1, bfd6_model)::numeric / greatest(1, no_tet_model)::numeric), 1) + ELSE + round((-1 * greatest(1, no_tet_model)::numeric / greatest(1, bfd6_model)::numeric), 1) + END, + CASE WHEN (bfd6_model < 1 OR no_tet_model < 1) THEN '*' ELSE '' END + ) AS fc_bfd6_model, + + CONCAT( + CASE + WHEN greatest(1, pf_model) / greatest(1, no_tet_model) >= 1 + THEN round((greatest(1, pf_model)::numeric / greatest(1, no_tet_model)::numeric), 1) + ELSE + round((-1 * greatest(1, no_tet_model)::numeric / greatest(1, pf_model)::numeric), 1) + END, + CASE WHEN (pf_model < 1 OR no_tet_model < 1) THEN '*' ELSE '' END + ) AS fc_pf_model, + + CONCAT( + CASE + WHEN greatest(1, dif_model) / greatest(1, no_tet_model) >= 1 + THEN round((greatest(1, dif_model)::numeric / greatest(1, no_tet_model)::numeric), 1) + ELSE + round((-1 * greatest(1, no_tet_model)::numeric / greatest(1, dif_model)::numeric), 1) + END, + CASE WHEN (dif_model < 1 OR no_tet_model < 1) THEN '*' ELSE '' END + ) AS fc_dif_model + +FROM webready.transcriptattributes_p ta + +LEFT JOIN ( + SELECT + ta.gene_source_id AS gene_id, + + MAX(value::numeric) FILTER (WHERE protocol_app_node_name = 'No_Tet') AS no_tet_model, + MAX(value::numeric) FILTER (WHERE protocol_app_node_name = 'BFD3') AS bfd3_model, + MAX(value::numeric) FILTER (WHERE protocol_app_node_name = 'BFD6') AS bfd6_model, + MAX(value::numeric) FILTER (WHERE protocol_app_node_name = 'PF') AS pf_model, + MAX(value::numeric) FILTER (WHERE protocol_app_node_name = 'DIF') AS dif_model + + FROM apidbtuning.profilesamples ps + JOIN results.nafeatureexpression nfe + ON ps.protocol_app_node_id = nfe.protocol_app_node_id + JOIN webready.transcriptattributes_p ta + ON ta.gene_na_feature_id = nfe.na_feature_id + WHERE ps.study_name = + 'T.brucei paired end RNA Seq data from Horn [htseq-union - unstranded - tpm - unique]' + AND ps.profile_type = 'values' + AND ta.org_abbrev IN (%%PARTITION_KEYS%%) + GROUP BY ta.gene_source_id +) res +ON ta.gene_source_id = res.gene_id + +WHERE ta.org_abbrev IN (%%PARTITION_KEYS%%); ]]> diff --git a/Model/lib/wdk/model/records/transcriptRecord.xml b/Model/lib/wdk/model/records/transcriptRecord.xml index 5ecafdc94..f5c1c4993 100644 --- a/Model/lib/wdk/model/records/transcriptRecord.xml +++ b/Model/lib/wdk/model/records/transcriptRecord.xml @@ -1187,8 +1187,7 @@ - diff --git a/Model/lib/wdk/model/stepAnalysisParams.xml b/Model/lib/wdk/model/stepAnalysisParams.xml index 6aa9357ef..cdfc154ac 100644 --- a/Model/lib/wdk/model/stepAnalysisParams.xml +++ b/Model/lib/wdk/model/stepAnalysisParams.xml @@ -224,7 +224,7 @@ The ontologies are three structured, controlled vocabularies that describe gene select organism as term, organism as display, organism as internal from (SELECT distinct ga.organism -FROM webready.GeneAttributes_p ga, +FROM apidbtuning.GeneAttributes ga, ($$answerIdSql$$) r where ga.source_id = r.gene_source_id and ga.gene_type in ('protein coding gene','pseudogene') @@ -243,7 +243,7 @@ order by ga.organism asc) q select ontology as term, ontology as display, ontology as internal from ( select distinct gts.ontology - from webready.GoTermSummary_p gts, + from apidbtuning.GoTermSummary gts, ($$answerIdSql$$) r where gts.gene_source_id = r.gene_source_id and gts.ontology is not null diff --git a/Model/lib/xml/dataPlotter/queries.xml b/Model/lib/xml/dataPlotter/queries.xml index 40f8688f0..fae593b61 100644 --- a/Model/lib/xml/dataPlotter/queries.xml +++ b/Model/lib/xml/dataPlotter/queries.xml @@ -70,16 +70,16 @@ = stats.min_annot_percent_max) AND gij.intron_feature_id not in ( select gij.intron_feature_id - from ApidbTuning.GeneIntronJunction gij, ApidbTuning.GeneIntJuncStats stats + from webready.GeneIntronJunction_p gij, webready.GenomicSeqJunctionStats_p stats where gij.na_sequence_id = $srcfeature_id AND gij.segment_start <= $rend AND gij.segment_end >= $base_start @@ -2645,7 +2645,7 @@ WHERE loc.na_sequence_id = $srcfeature_id ANNOTATED_INTRON, to_char(segment_start - 10) || ',' || to_char(segment_end + 1) as tstarts, to_char(10) || ',' || to_char(10) as blocksizes - from ApidbTuning.GeneIntronJunction gij, ApidbTuning.GeneIntJuncStats stats + from webready.GeneIntronJunction_p gij, webready.GenomicSeqJunctionStats_p stats where gij.na_sequence_id= $srcfeature_id AND gij.segment_start <= $rend AND gij.segment_end >= $base_start @@ -2671,7 +2671,7 @@ WHERE loc.na_sequence_id = $srcfeature_id ANNOTATED_INTRON, to_char(segment_start - 10) || ',' || to_char(segment_end + 1) as tstarts, to_char(10) || ',' || to_char(10) as blocksizes - from ApidbTuning.GeneIntronJunction gij, ApidbTuning.GeneIntJuncStats stats + from webready.GeneIntronJunction_p gij, webready.GenomicSeqJunctionStats_p stats where gij.na_sequence_id = $srcfeature_id AND gij.segment_start <= $rend AND gij.segment_end >= $base_start @@ -2698,7 +2698,7 @@ WHERE loc.na_sequence_id = $srcfeature_id ANNOTATED_INTRON, to_char(segment_start - 10) || ',' || to_char(segment_end + 1) as tstarts, to_char(10) || ',' || to_char(10) as blocksizes - from ApidbTuning.GeneIntronJunction gij, ApidbTuning.GeneIntJuncStats stats + from webready.GeneIntronJunction_p gij, webready.GenomicSeqJunctionStats_p stats where gij.na_sequence_id = $srcfeature_id AND gij.segment_start <= $rend AND gij.segment_end >= $base_start @@ -2710,7 +2710,7 @@ WHERE loc.na_sequence_id = $srcfeature_id AND (gij.contained = 0 or gij.percent_max >= stats.min_annot_percent_max) AND gij.intron_feature_id not in ( select gij.intron_feature_id - from ApidbTuning.GeneIntronJunction gij, ApidbTuning.GeneIntJuncStats stats + from webready.GeneIntronJunction_p gij, webready.GenomicSeqJunctionStats_p stats where gij.na_sequence_id = $srcfeature_id AND gij.segment_start <= $rend AND gij.segment_end >= $base_start diff --git a/Model/lib/xml/tuningManager/apiTuningManager.xml b/Model/lib/xml/tuningManager/apiTuningManager.xml index 42d8cba58..fd14f9c1b 100644 --- a/Model/lib/xml/tuningManager/apiTuningManager.xml +++ b/Model/lib/xml/tuningManager/apiTuningManager.xml @@ -41,11 +41,36 @@ CREATE UNIQUE INDEX transcriptattr_sourceId&1 ON TranscriptAttributes&1 (source_id); ]]> + + + + + + + + + + + + + + + + + @@ -68,6 +93,33 @@ + + + + + + + + + + + + + + + + + @@ -78,6 +130,21 @@ + + + + + + + + + + + @@ -243,6 +310,7 @@ The trick sql was cribbed and modified from: nuijten.blogspot.com/2011/08/splitting-comma-delimited-string-regexp.html --> + @@ -929,7 +997,7 @@ create index Organism_projectId_idx&1 ON OrganismAttributes&1 (project_id, sourc - + - + + @@ -1588,14 +1657,14 @@ create index Organism_projectId_idx&1 ON OrganismAttributes&1 (project_id, sourc @@ -1620,6 +1689,7 @@ create index Organism_projectId_idx&1 ON OrganismAttributes&1 (project_id, sourc + @@ -1629,9 +1699,9 @@ create index Organism_projectId_idx&1 ON OrganismAttributes&1 (project_id, sourc na_feature_id numeric(10,0), node_type character varying(200), profile_as_string_value text, + profile_as_string_stderr text, profile_as_string_percentile1 text, - profile_as_string_percentile2 text, - profile_as_string_stderr text + profile_as_string_percentile2 text ) ]]> @@ -2313,7 +2383,7 @@ create index Organism_projectId_idx&1 ON OrganismAttributes&1 (project_id, sourc - + Text for PreferredProduct table on gene record page. @@ -2453,7 +2523,7 @@ create index Organism_projectId_idx&1 ON OrganismAttributes&1 (project_id, sourc - + all products for each gene diff --git a/Model/src/main/java/org/apidb/apicommon/model/datasetInjector/RNASeq.java b/Model/src/main/java/org/apidb/apicommon/model/datasetInjector/RNASeq.java index da6c925a7..d4b892c2f 100644 --- a/Model/src/main/java/org/apidb/apicommon/model/datasetInjector/RNASeq.java +++ b/Model/src/main/java/org/apidb/apicommon/model/datasetInjector/RNASeq.java @@ -50,6 +50,7 @@ protected void setGraphYAxisDescription() { @Override public void injectTemplates() { setShortAttribution(); + setProfileSamplesHelp(); String projectName = getPropValue("projectName"); //String presenterId = getPropValue("presenterId"); diff --git a/Model/src/main/java/org/apidb/apicommon/model/datasetInjector/RNASeqWGCNA.java b/Model/src/main/java/org/apidb/apicommon/model/datasetInjector/RNASeqWGCNA.java index 694af19b0..509cc784b 100644 --- a/Model/src/main/java/org/apidb/apicommon/model/datasetInjector/RNASeqWGCNA.java +++ b/Model/src/main/java/org/apidb/apicommon/model/datasetInjector/RNASeqWGCNA.java @@ -5,10 +5,13 @@ public class RNASeqWGCNA extends RNASeqEbi { @Override public void injectTemplates() { + setPropValue("datasetClassCategoryIri", "http://purl.obolibrary.org/obo/OBI_0001271"); super.injectTemplates(); + + injectTemplate("rnaSeqWGCNAModulesQuestion"); setPropValue("searchCategory", "searchCategory-transcriptomics-iterativeWGCNA"); setPropValue("questionName", "GeneQuestions.GenesByRNASeq" + getDatasetName() + "WGCNAModules"); diff --git a/Model/src/main/java/org/apidb/apicommon/model/maintain/BasketFixer2.java b/Model/src/main/java/org/apidb/apicommon/model/maintain/BasketFixer2.java index 0640b52a4..a35badebf 100644 --- a/Model/src/main/java/org/apidb/apicommon/model/maintain/BasketFixer2.java +++ b/Model/src/main/java/org/apidb/apicommon/model/maintain/BasketFixer2.java @@ -17,8 +17,8 @@ import org.apache.log4j.Logger; import org.gusdb.fgputil.BaseCLI; import org.gusdb.fgputil.db.SqlUtils; -import org.gusdb.fgputil.db.runner.BasicResultSetHandler; import org.gusdb.fgputil.db.runner.SQLRunner; +import org.gusdb.fgputil.db.runner.handler.BasicResultSetHandler; import org.gusdb.wdk.model.Utilities; import org.gusdb.wdk.model.WdkModel; import org.gusdb.wdk.model.WdkModelException; @@ -306,7 +306,7 @@ private void updateTranscripts(WdkModel wdkModel, String projectId) throws WdkMo // get a snapshot of largest basket id. any newer ids are added by users during this run. we can ignore them. String sql = "select max(basket_id) as max_basket_id from " + userSchema + "user_baskets"; BasicResultSetHandler handler = new SQLRunner(userDbDataSource, sql, - "invalid-step-report-summary").executeQuery(new Object[]{}, new BasicResultSetHandler()); + "invalid-step-report-summary").executeQuery(new BasicResultSetHandler()); List> results = handler.getResults(); Map row = results.get(0); BigDecimal maxBasketId = (BigDecimal)row.get("MAX_BASKET_ID");