|
417 | 417 | <column name="product"/> |
418 | 418 | <sql> |
419 | 419 | <![CDATA[ |
420 | | - select 'dots.GeneFeature' as source, source_id, product |
421 | | - from dots.GeneFeature |
422 | | - where product is not null |
423 | | - union |
424 | | - select 'dots.TranscriptFeature' as source, gf.source_id, t.product |
425 | | - from dots.GeneFeature gf, dots.Transcript t |
426 | | - where gf.na_feature_id = t.parent_id |
427 | | - and t.product is not null |
428 | | - union |
429 | | - select 'apidb.GeneFeatureProduct' as source, gf.source_id, gfp.product |
430 | | - from dots.GeneFeature gf, apidb.GeneFeatureProduct gfp |
431 | | - where gfp.na_feature_id = gf.na_feature_id |
432 | | - union |
433 | | - select 'apidb.TranscriptProduct' as source, gf.source_id, tp.product |
434 | | - from dots.GeneFeature gf, dots.Transcript t, |
435 | | - apidb.TranscriptProduct tp |
436 | | - where t.parent_id = gf.na_feature_id |
437 | | - and tp.na_feature_id = t.na_feature_id |
| 420 | + select source_id, product |
| 421 | + from apidbTuning.AllGeneProducts |
438 | 422 | ]]> |
439 | 423 | </sql> |
440 | 424 | </sqlQuery> |
441 | 425 |
|
442 | | - |
443 | | -<!-- |
444 | | - <sqlQuery name="PreferredProducts" isCacheable="false" > |
445 | | - <column name="source_id"/> |
446 | | - <column name="transcript_ids"/> |
447 | | - <column name="project_id"/> |
448 | | - <column name="product"/> |
449 | | - <column name="reference" includeProjects="FungiDB,TriTrypDB"/> |
450 | | - <column name="evidence_code" includeProjects="FungiDB,TriTrypDB"/> |
451 | | - <column name="evidence_code_parameter" includeProjects="FungiDB,TriTrypDB"/> |
452 | | - <sql> |
453 | | - <![CDATA[ |
454 | | - /* PreferredProducts: check apidb.TranscriptProduct and |
455 | | - apidb.GeneFeatureProduct for records with IS_PREFERRED set. If |
456 | | - (and only if) that turns up nothing, check the PRODUCT column of |
457 | | - dots.GeneFeature and dots.Transcript */ |
458 | | - with evids |
459 | | - as (select distinct gaiec.go_evidence_code_id, ot.name |
460 | | - from dots.GoAssocInstEvidCode gaiec, sres.OntologyTerm ot |
461 | | - where ot.ontology_term_id = gaiec.go_evidence_code_id) |
462 | | - select ta.gene_source_id as source_id, tp.product, ta.project_id, |
463 | | - listagg(source_id, ', ' on overflow truncate) within group(order by source_id) |
464 | | - as transcript_ids, |
465 | | - listagg(publication, ', ' on overflow truncate) within group(order by source_id) |
466 | | - as reference, |
467 | | - e.name as evidence_code, |
468 | | - tp.with_from AS evidence_code_parameter |
469 | | - from apidb.TranscriptProduct tp, |
470 | | - apidbTuning.TranscriptAttributes ta, evids e |
471 | | - where ta.na_feature_id = tp.na_feature_id |
472 | | - and tp.is_preferred = 1 |
473 | | - and tp.evidence_code = e.go_evidence_code_id(+) |
474 | | - group by gene_source_id, ta.project_id, tp.product, |
475 | | - e.name, tp.with_from |
476 | | - union |
477 | | - select ga.source_id, gfp.product, ga.project_id, |
478 | | - cast (null as varchar2(1)) as transcript_ids, |
479 | | - cast (null as varchar2(1)) as reference, |
480 | | - cast (null as varchar2(1)) as evidence_code, |
481 | | - cast (null as varchar2(1)) as evidence_code_parameter |
482 | | - from apidb.GeneFeatureProduct gfp, |
483 | | - apidbTuning.GeneAttributes ga |
484 | | - where ga.na_feature_id = gfp.na_feature_id |
485 | | - and gfp.is_preferred = 1 |
486 | | - group by source_id, ga.project_id, gfp.product |
487 | | - union |
488 | | - select * |
489 | | - from (select ta.gene_source_id as source_id, ta.transcript_product, ta.project_id, |
490 | | - listagg(source_id, ', ' on overflow truncate) within group(order by source_id) |
491 | | - as transcript_ids, |
492 | | - cast (null as varchar2(1)) as reference, |
493 | | - cast (null as varchar2(1)) as evidence_code, |
494 | | - cast (null as varchar2(1)) as evidence_code_parameter |
495 | | - from apidbTuning.TranscriptAttributes ta |
496 | | - where ta.transcript_product is not null |
497 | | - group by ta.gene_source_id, ta.transcript_product, ta.project_id |
498 | | - ) |
499 | | - where source_id |
500 | | - in ( select * |
501 | | - from ( select source_id |
502 | | - from dots.GeneFeature |
503 | | - where product is not null |
504 | | - union |
505 | | - select ga.source_id |
506 | | - from dots.Transcript t, apidbTuning.GeneAttributes ga |
507 | | - where t.product is not null |
508 | | - and t.parent_id = ga.na_feature_id |
509 | | - ) |
510 | | - minus |
511 | | - select * |
512 | | - from ( select ta.gene_source_id |
513 | | - from apidb.TranscriptProduct tp, apidbTuning.TranscriptAttributes ta |
514 | | - where tp.na_feature_id = ta.na_feature_id |
515 | | - union |
516 | | - select ga.source_id |
517 | | - from apidb.GeneFeatureProduct gfp, apidbTuning.GeneAttributes ga |
518 | | - where gfp.na_feature_id = ga.na_feature_id |
519 | | - ) |
520 | | - ) |
521 | | - ]]> |
522 | | - </sql> |
523 | | - </sqlQuery> |
524 | | -
|
525 | | - <sqlQuery name="AlternateProducts" > |
526 | | - <column name="source_id"/> |
527 | | - <column name="product"/> |
528 | | - <column name="reference"/> |
529 | | - <sql> |
530 | | - <![CDATA[ |
531 | | - select ta.gene_source_id as source_id, |
532 | | - tp.product, |
533 | | - listagg(tp.publication, ', ') |
534 | | - within group(order by tp.publication) as reference |
535 | | - from apidbTuning.TranscriptAttributes ta, apidb.TranscriptProduct tp |
536 | | - where ta.na_feature_id = tp.na_feature_id |
537 | | - and tp.is_preferred = 0 |
538 | | - group by ta.gene_source_id, ta.source_id, tp.product |
539 | | - union |
540 | | - select gf.source_id, |
541 | | - gfp.product, |
542 | | - cast (null as varchar2(12)) as reference |
543 | | - from dots.GeneFeature gf, apidb.GeneFeatureProduct gfp |
544 | | - where gf.na_feature_id = gfp.na_feature_id |
545 | | - and gfp.is_preferred = 0 |
546 | | - group by gf.source_id, gfp.product |
547 | | - ]]> |
548 | | - </sql> |
549 | | - </sqlQuery> |
550 | | ---> |
551 | | - |
552 | 426 | <sqlQuery name="gene_dbrefs"> |
553 | 427 | <column name="source_id"/> |
554 | 428 | <column name="dataset"/> |
|
0 commit comments