|
| 1 | +select AG.symbol, AV.name, count(*) from svip_curationentry CE |
| 2 | +inner join api_disease AD on AD.id = CE.disease_id |
| 3 | +inner join api_variant AV on AV.id = CE.variant_id |
| 4 | +inner join api_gene AG on AG.id = AV.gene_id |
| 5 | +where CE.status='unreviewed' |
| 6 | +group by AG.symbol, AV.name; |
| 7 | + |
| 8 | +select count(*) from svip_curationentry CE where CE.status='unreviewed'; |
| 9 | + |
| 10 | +select * from ( |
| 11 | + select |
| 12 | + symbol, |
| 13 | + sum(compiled.civic_counts) as civic_counts, |
| 14 | + sum(compiled.oncokb_counts) as oncokb_counts, |
| 15 | + sum(compiled.clinvar_counts) as clinvar_counts, |
| 16 | + sum(compiled.cosmic_counts) as cosmic_counts |
| 17 | + from ( |
| 18 | + select |
| 19 | + symbol, |
| 20 | + (select cnt where name='civic') as civic_counts, |
| 21 | + (select cnt where name='oncokb') as oncokb_counts, |
| 22 | + (select cnt where name='clinvar') as clinvar_counts, |
| 23 | + (select cnt where name='cosmic') as cosmic_counts |
| 24 | + from ( |
| 25 | + select AG.symbol, AVS.name, count(*) as cnt from api_variantinsource VIS |
| 26 | + inner join api_variant AV on VIS.variant_id = AV.id |
| 27 | + inner join api_gene AG on AV.gene_id = AG.id |
| 28 | + inner join api_source AVS on VIS.source_id = AVS.id |
| 29 | + group by AG.symbol, AVS.name |
| 30 | + ) as var_counts |
| 31 | + ) as compiled |
| 32 | + group by symbol |
| 33 | +) as Z |
| 34 | +order by civic_counts + oncokb_counts + clinvar_counts + cosmic_counts; |
0 commit comments