Skip to content

Instantly share code, notes, and snippets.

@marco-brandizi
Created May 30, 2022 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marco-brandizi/b6566df6618bbd46bea3d41c805d3e18 to your computer and use it in GitHub Desktop.
Save marco-brandizi/b6566df6618bbd46bea3d41c805d3e18 to your computer and use it in GitHub Desktop.
PREFIX bk: <http://knetminer.org/data/rdf/terms/biokno/> PREFIX bkr: <http://knetminer.org/data/rdf/resources/>
PREFIX bka: <http://knetminer.org/data/rdf/terms/biokno/attributes/> PREFIX bkg: <http://knetminer.org/data/rdf/resources/graphs/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#> PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX dcterms: <http://purl.org/dc/terms/> PREFIX agri: <http://agrischemas.org/>
PREFIX bioschema: <http://bioschemas.org/> PREFIX schema: <http://schema.org/>
SELECT ?pubTitle ?geneName ?scoreStr ?condLabel ?condTerm
{
?pub a agri:ScholarlyPublication;
dcterms:title ?pubTitle;
schema:abstract ?pubAbstract;
.
FILTER ( CONTAINS ( LCASE ( ?pubAbstract ), "yellow rust" ) )
?pub schema:mentions ?gene.
?gene a bioschema:Gene;
schema:name ?geneName;
.
?gene bioschema:expressedIn ?condition.
?expStatement a rdfs:Statement;
rdf:subject ?gene;
rdf:predicate bioschema:expressedIn;
rdf:object ?condition;
agri:evidence ?study.
# Examples of scoring figures
{
?expStatement agri:pvalue ?pvalue; agri:log2FoldChange ?foldChange.
FILTER ( ?pvalue < 1e-3 && ABS ( ?foldChange ) > 1.5 )
BIND ( CONCAT ( "p-value: ", ?pvalue, ", log2 FC: ", ?foldChange ) AS ?scoreStr )
}
UNION
{
?expStatement agri:ordinalTpm ?ordinalTpm; agri:tpmCount ?tpm.
FILTER ( ?ordinalTpm in ('medium', 'high') )
BIND ( CONCAT ( ?tpm, " TPM" ) AS ?scoreStr )
}
?condition schema:name ?condLabel.
OPTIONAL { ?condition dc:type ?condTerm. }
}
ORDER BY ?geneName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment