Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 18 additions & 15 deletions Model/lib/perl/CannedQuery/ElementNamesWithMetaData.pm
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,24 @@ sub init {

$Self->setSql(<<Sql);

select rownum as element_order, ps.NAME, ps.FACET, ps.CONTXAXIS FROM (
SELECT distinct s.protocol_app_node_name AS name, s.NODE_ORDER_NUM, m1.string_value as facet, m2.string_value as contXAxis
FROM apidbtuning.ProfileSamples s
, apidbtuning.metadata m1
, apidbtuning.metadata m2
WHERE s.study_name = \'<<ProfileSet>>\'
AND s.profile_type = \'<<ProfileType>>\'
--AND m1.study_name(+) = s.study_name
and m1.PAN_ID(+) = s.PROTOCOL_APP_NODE_ID
and m1.property_source_id(+) = \'$facet1\'
--AND m2.study_name(+) = s.study_name
and m2.PAN_ID(+) = s.PROTOCOL_APP_NODE_ID
and m2.property_source_id(+) = \'<<ContXAxis>>\'
ORDER BY s.node_order_num
) ps
SELECT DISTINCT
s.protocol_app_node_name AS name,
s.NODE_ORDER_NUM,
m1.string_value AS facet,
m2.string_value AS contXAxis
FROM apidbtuning.ProfileSamples s
LEFT JOIN apidbtuning.metadata m1
ON m1.PAN_ID = s.PROTOCOL_APP_NODE_ID
AND m1.property_source_id = '$facet1'
--AND m1.study_name = s.study_name
LEFT JOIN apidbtuning.metadata m2
ON m2.PAN_ID = s.PROTOCOL_APP_NODE_ID
AND m2.property_source_id = '<<ContXAxis>>'
--AND m2.study_name = s.study_name
WHERE s.study_name = '<<ProfileSet>>'
AND s.profile_type = '<<ProfileType>>'
ORDER BY s.node_order_num;


Sql

Expand Down
12 changes: 8 additions & 4 deletions Model/lib/perl/CannedQuery/MultiProfile.pm
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,21 @@ sub init {

$Self->SUPER::init($Args);

$Self->setCollated(1);
$Self->setCollated(1);

$Self->setId ( $Args->{Id } );
$Self->setProfileSet ( $Args->{ProfileSet } );
$Self->setId ( $Args->{Id } );
$Self->setOrgAbbrev($Args->{OrgAbbrev});
$Self->setProfileSet ( $Args->{ProfileSet } );

$Self->setSql(<<Sql);
SELECT p.source_id
, profile_as_string
FROM apidb.Profile p
FROM apidb.Profile_p p
, apidb.ProfileSet ps
WHERE p.source_id in (<<IdList>>)
AND p.profile_set_id = ps.profile_set_id
AND ps.name = '<<ProfileSet>>'
AND p.org_abbrev = '<<OrgAbbrev>>'
Sql

return $Self;
Expand All @@ -72,6 +74,8 @@ sub setId { $_[0]->{'Id' } = $_[1]; $_[0] }
sub getProfileSet { $_[0]->{'ProfileSet' } }
sub setProfileSet { $_[0]->{'ProfileSet' } = $_[1]; $_[0] }

sub getOrgAbbrev { $_[0]->{'OrgAbbrev' } }
sub setOrgAbbrev { $_[0]->{'OrgAbbrev' } = $_[1]; $_[0] }
# ========================================================================
# --------------------------- Support Methods ----------------------------
# ========================================================================
Expand Down
7 changes: 3 additions & 4 deletions Model/lib/perl/CannedQuery/PathwayGeneraData.pm
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ from (select distinct genus
from dots.AaSequenceEnzymeClass asec, sres.EnzymeClass ec
where ec.enzyme_class_id = asec.enzyme_class_id
and ec.ec_number LIKE REPLACE(REPLACE(REPLACE(REPLACE(lower('<<Id>>'),' ',''),'-', '%'),'*','%'),'any','%')
) ec,
(
) ec
RIGHT JOIN (
<<Genera>>
) orgs
where orgs.genus = ec.genus (+)
) orgs ON orgs.genus = ec.genus
order by orgs.o asc
Sql

Expand Down
5 changes: 4 additions & 1 deletion Model/lib/perl/CannedQuery/PhenotypeRankedNthNames.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ sub init {
$Self->SUPER::init($Args);

$Self->setId($Args->{Id});
$Self->setOrgAbbrev($Args->{OrgAbbrev});
$Self->setSourceIdValueQuery($Args->{SourceIdValueQuery});
$Self->setN($Args->{N});

Expand All @@ -31,7 +32,7 @@ select t.value, rownum rn, source_id
from (select source_id, value from dat order by value) t
)
where ('<<Id>>' = 'ALL' AND (rn = 1 or rn = (select ct.m from ct) or mod(rn, round((select ct.m from ct)/<<N>>,0)) = 0))
OR '<<Id>>' = source_id
OR ('<<Id>>' = source_id and '<<OrgAbbrev>>' = org_abbrev)
Sql

return $Self;
Expand All @@ -47,6 +48,8 @@ sub getSourceIdValueQuery{ $_[0]->{_SourceIdValueQuery} }
sub setN { $_[0]->{_n} = $_[1] }
sub getN { $_[0]->{_n} }

sub getOrgAbbrev { $_[0]->{'OrgAbbrev' } }
sub setOrgAbbrev { $_[0]->{'OrgAbbrev' } = $_[1]; $_[0] }

sub prepareDictionary {
my $Self = shift;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ sub init {
$Self->SUPER::init($Args);

$Self->setId($Args->{Id});
$Self->setOrgAbbrev($Args->{OrgAbbrev});
$Self->setSourceIdValueQuery($Args->{SourceIdValueQuery});
$Self->setN($Args->{N});

Expand All @@ -31,7 +32,7 @@ select t.value, rownum rn, source_id
from (select source_id, value from dat order by value) t
)
where ('<<Id>>' = 'ALL' AND (rn = 1 or rn = (select ct.m from ct) or mod(rn, round((select ct.m from ct)/<<N>>,0)) = 0))
OR '<<Id>>' = source_id
OR ('<<Id>>' = source_id and '<<OrgAbbrev>>' = org_abbrev)
Sql

return $Self;
Expand All @@ -47,6 +48,8 @@ sub getSourceIdValueQuery{ $_[0]->{_SourceIdValueQuery} }
sub setN { $_[0]->{_n} = $_[1] }
sub getN { $_[0]->{_n} }

sub getOrgAbbrev { $_[0]->{'OrgAbbrev' } }
sub setOrgAbbrev { $_[0]->{'OrgAbbrev' } = $_[1]; $_[0] }

sub prepareDictionary {
my $Self = shift;
Expand Down
5 changes: 4 additions & 1 deletion Model/lib/perl/CannedQuery/PhenotypeRankedNthValues.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ sub init {
$Self->SUPER::init($Args);

$Self->setId($Args->{Id});
$Self->setOrgAbbrev($Args->{OrgAbbrev});
$Self->setSourceIdValueQuery($Args->{SourceIdValueQuery});
$Self->setN($Args->{N});

Expand All @@ -31,7 +32,7 @@ select t.value, rownum rn, source_id
from (select source_id, value from dat order by value) t
)
where ('<<Id>>' = 'ALL' AND (rn = 1 or rn = (select ct.m from ct) or mod(rn, round((select ct.m from ct)/<<N>>,0)) = 0))
OR '<<Id>>' = source_id
OR ('<<Id>>' = source_id AND '<<OrgAbbrev>>' = org_abbrev)
Sql

return $Self;
Expand All @@ -47,6 +48,8 @@ sub getSourceIdValueQuery{ $_[0]->{_SourceIdValueQuery} }
sub setN { $_[0]->{_n} = $_[1] }
sub getN { $_[0]->{_n} }

sub getOrgAbbrev { $_[0]->{'OrgAbbrev' } }
sub setOrgAbbrev { $_[0]->{'OrgAbbrev' } = $_[1]; $_[0] }

sub prepareDictionary {
my $Self = shift;
Expand Down
6 changes: 5 additions & 1 deletion Model/lib/perl/CannedQuery/Profile.pm
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ sub init {

$Self->setSql(<<Sql);
SELECT profile_AS_STRING
FROM apidbtuning.Profile p
FROM apidbtuning.Profile_p p
WHERE p.source_id = '<<Id>>'
AND p.profile_set_name = '<<ProfileSet>>'
AND p.profile_type = '<<ProfileType>>'
AND p.org_abbrev = '<<OrgAbbrev>>'
Sql

return $Self;
Expand All @@ -69,6 +70,9 @@ Sql
sub getId { $_[0]->{'Id' } }
sub setId { $_[0]->{'Id' } = $_[1]; $_[0] }

sub getOrgAbbrev { $_[0]->{'OrgAbbrev' } }
sub setOrgAbbrev { $_[0]->{'OrgAbbrev' } = $_[1]; $_[0] }

sub getSecondaryId { $_[0]->{'SecondaryId' } }
sub setSecondaryId { $_[0]->{'SecondaryId' } = $_[1]; $_[0] }

Expand Down
3 changes: 2 additions & 1 deletion Model/lib/perl/CannedQuery/ProfileByEC.pm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ sub init {

$Self->setSql(<<Sql);
select p.source_id, ec.ec_number, p.profile_as_string
from apidbtuning.profile p,
from apidbtuning.profile_p p,
(SELECT DISTINCT ta.gene_source_id, ec.ec_number
FROM dots.aaSequenceEnzymeClass asec, sres.enzymeClass ec,webready.TranscriptAttributes_p ta
WHERE ta.aa_sequence_id = asec.aa_sequence_id
Expand All @@ -22,6 +22,7 @@ sub init {
) ec
WHERE p.profile_set_name = '<<ProfileSet>>'
AND p.profile_type = '<<ProfileType>>'
AND p.org_abbrev = '<<OrgAbbrev>>'
AND p.source_id = ec.gene_source_id


Expand Down
10 changes: 7 additions & 3 deletions Model/lib/perl/CannedQuery/ProfileForOligoFromGene.pm
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,18 @@ sub init {

$Self->SUPER::init($Args);

$Self->setId ( $Args->{Id } );
$Self->setProfileSet ( $Args->{ProfileSet } );
$Self->setId ( $Args->{Id } );
$Self->setProfileSet ( $Args->{ProfileSet } );
$Self->setOrgAbbrev($Args->{OrgAbbrev});

$Self->setSql(<<Sql);
SELECT profile_AS_STRING
FROM apidb.Profile p
FROM apidb.Profile_p p
, apidb.ProfileSet ps
WHERE p.source_id = '<<Id>>'
AND p.profile_set_id = ps.profile_set_id
AND ps.name = '<<ProfileSet>>'
AND p.org_abbrev = '<<OrgAbbrev>>'
Sql

return $Self;
Expand All @@ -69,6 +71,8 @@ sub setId { $_[0]->{'Id' } = $_[1]; $_[0] }
sub getProfileSet { $_[0]->{'ProfileSet' } }
sub setProfileSet { $_[0]->{'ProfileSet' } = $_[1]; $_[0] }

sub getOrgAbbrev { $_[0]->{'OrgAbbrev' } }
sub setOrgAbbrev { $_[0]->{'OrgAbbrev' } = $_[1]; $_[0] }
# ========================================================================
# --------------------------- Support Methods ----------------------------
# ========================================================================
Expand Down
9 changes: 6 additions & 3 deletions Model/lib/perl/CannedQuery/ProfileSet.pm
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,17 @@ sub init {

$Self->setCollated(1);

$Self->setProfileSet ( $Args->{ProfileSet } );
$Self->setOrgAbbrev($Args->{OrgAbbrev});
$Self->setProfileSet ( $Args->{ProfileSet } );

$Self->setSql(<<Sql);
SELECT source_id as column_name
, profile_AS_STRING
FROM apidb.Profile p
FROM apidb.Profile_p p
, apidb.ProfileSet ps
WHERE p.profile_set_id = ps.profile_set_id
AND ps.name = '<<ProfileSet>>'
AND p.org_abbrev = '<<OrgAbbrev>>'
Sql

return $Self;
Expand All @@ -61,7 +63,8 @@ Sql

sub getId { $_[0]->{'Id' } }
sub setId { $_[0]->{'Id' } = $_[1]; $_[0] }

sub getOrgAbbrev { $_[0]->{'OrgAbbrev' } }
sub setOrgAbbrev { $_[0]->{'OrgAbbrev' } = $_[1]; $_[0] }
sub getProfileSet { $_[0]->{'ProfileSet' } }
sub setProfileSet { $_[0]->{'ProfileSet' } = $_[1]; $_[0] }

Expand Down
6 changes: 4 additions & 2 deletions Model/lib/perl/CannedQuery/RankedNthRatioValues.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ sub init {
$Self->SUPER::init($Args);

$Self->setId($Args->{Id});
$Self->setOrgAbbrev($Args->{OrgAbbrev});
$Self->setSourceIdValueQuery($Args->{SourceIdValueQuery});
$Self->setN($Args->{N});

Expand All @@ -31,7 +32,7 @@ select t.value, rownum rn, source_id, num, denom
from (select source_id, value, num, denom from dat order by value) t
)
where ('<<Id>>' = 'ALL' AND (rn = 1 or rn = (select ct.m from ct) or mod(rn, round((select ct.m from ct)/<<N>>,0)) = 0))
OR '<<Id>>' = source_id
OR ('<<Id>>' = source_id and '<<OrgAbbrev>>' = org_abbrev)
Sql

return $Self;
Expand All @@ -40,7 +41,8 @@ Sql

sub getId { $_[0]->{'Id' } }
sub setId { $_[0]->{'Id' } = $_[1]; $_[0] }

sub getOrgAbbrev { $_[0]->{'OrgAbbrev' } }
sub setOrgAbbrev { $_[0]->{'OrgAbbrev' } = $_[1]; $_[0] }
sub setSourceIdValueQuery { $_[0]->{_SourceIdValueQuery} = $_[1] }
sub getSourceIdValueQuery{ $_[0]->{_SourceIdValueQuery} }

Expand Down
4 changes: 3 additions & 1 deletion Model/lib/perl/CannedQuery/SenseAntisense.pm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ sub init {

$Self->setProfileSetId($Args->{ProfileSetId});
$Self->setId($Args->{Id});
$Self->setOrgAbbrev($Args->{OrgAbbrev});
$Self->setAntisenseFloor($Args->{AntisenseFloor});

return $Self;
Expand All @@ -24,7 +25,8 @@ sub getId { $_[0]->{'Id' } }
sub setId { $_[0]->{'Id' } = $_[1]; $_[0] }
sub getAntisenseFloor { $_[0]->{'AntisenseFloor' } }
sub setAntisenseFloor { $_[0]->{'AntisenseFloor' } = $_[1]; $_[0] }

sub getOrgAbbrev { $_[0]->{'OrgAbbrev' } }
sub setOrgAbbrev { $_[0]->{'OrgAbbrev' } = $_[1]; $_[0] }

sub prepareDictionary {
my $Self = shift;
Expand Down
4 changes: 3 additions & 1 deletion Model/lib/perl/CannedQuery/SenseAntisenseX.pm
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ with comp as (select ps.node_order_num,ps.protocol_app_node_name,na.value
and ps.profile_type = 'values'
and ps.protocol_app_node_id = na.protocol_app_node_id
and na.na_feature_id = ga.na_feature_id
and ga.org_abbrev ='<<OrgAbbrev>>'
and ga.source_id='<<Id>>')
, ref as (select ps.node_order_num,ps.protocol_app_node_name,na.value
from apidbtuning.ProfileSamples ps
Expand All @@ -30,7 +31,8 @@ with comp as (select ps.node_order_num,ps.protocol_app_node_name,na.value
and ps.profile_type = 'values'
and ps.protocol_app_node_id = na.protocol_app_node_id
and na.na_feature_id = ga.na_feature_id
and ga.source_id='<<Id>>')
and ga.org_abbrev ='<<OrgAbbrev>>'
and ga.source_id='<<Id>>')
select CONTXAXIS, NAME, ROW_NUMBER() OVER (order by NAME) as element_order
from ( select
ref.protocol_app_node_name || '->' || comp.protocol_app_node_name as NAME
Expand Down
4 changes: 3 additions & 1 deletion Model/lib/perl/CannedQuery/SenseAntisenseY.pm
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ with comp as (select ps.node_order_num,ps.protocol_app_node_name,na.value
and ps.profile_type = 'values'
and ps.protocol_app_node_id = na.protocol_app_node_id
and na.na_feature_id = ga.na_feature_id
and ga.org_abbrev ='<<OrgAbbrev>>'
and ga.source_id='<<Id>>')
, ref as (select ps.node_order_num,ps.protocol_app_node_name,na.value
from apidbtuning.ProfileSamples ps
Expand All @@ -30,7 +31,8 @@ with comp as (select ps.node_order_num,ps.protocol_app_node_name,na.value
and ps.profile_type = 'values'
and ps.protocol_app_node_id = na.protocol_app_node_id
and na.na_feature_id = ga.na_feature_id
and ga.source_id='<<Id>>')
and ga.org_abbrev ='<<OrgAbbrev>>'
and ga.source_id='<<Id>>')
select value, ROW_NUMBER() OVER (order by name) as element_order
from ( select
ref.protocol_app_node_name || '->' || comp.protocol_app_node_name as name
Expand Down
4 changes: 4 additions & 0 deletions Model/lib/perl/CannedQuery/UDProfileValues.pm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ sub init {
$Self->SUPER::init($Args);

$Self->setId($Args->{Id});
$Self->setOrgAbbrev($Args->{OrgAbbrev});
$Self->setProfileSetId($Args->{ProfileSetId});

$Self->setSql(<<Sql);
Expand All @@ -23,6 +24,7 @@ where pan.profile_set_id = '<<ProfileSetId>>'
and pan.protocol_app_node_id = e.protocol_app_node_id
and ga.na_feature_id = e.na_feature_id
and ga.source_id = '<<Id>>'
and ga.org_abbrev = '<<OrgAbbrev>>'
order by pan.node_order_num, pan.protocol_app_node_id
Sql

Expand All @@ -35,6 +37,8 @@ sub setId { $_[0]->{'Id' } = $_[1]; $_[0] }
sub getProfileSetId { $_[0]->{'ProfileSetId' } }
sub setProfileSetId { $_[0]->{'ProfileSetId' } = $_[1]; $_[0] }

sub getOrgAbbrev { $_[0]->{'OrgAbbrev' } }
sub setOrgAbbrev { $_[0]->{'OrgAbbrev' } = $_[1]; $_[0] }

sub prepareDictionary {
my $Self = shift;
Expand Down