Skip to content

Instantly share code, notes, and snippets.

@jctoledo
jctoledo / gist:9762533
Created March 25, 2014 14:04
get the counts of backbones in my data
select ?a count (distinct ?backbone) as ?c
from <http://bio2rdf.org/rna_cycles_pdb>
where{
?a a <http://bio2rdf.org/pdb_vocabulary:Experiment>.
?mcb <http://bio2rdf.org/narf_vocabulary:derived_from> ?a.
?a <http://bio2rdf.org/pdb_vocabulary:hasPart> ?cse.
?cse a <http://bio2rdf.org/pdb_vocabulary:ChemicalSubstanceExtraction>.
?cse <http://bio2rdf.org/pdb_vocabulary:hasProduct> ?polymer.
?polymer a <http://bio2rdf.org/pdb_vocabulary:Polymer>.
?residue <http://bio2rdf.org/pdb_vocabulary:isPartOf> ?polymer.
@jctoledo
jctoledo / gist:9762002
Created March 25, 2014 13:40
get the total number of chains in my dataset
select count (distinct ?chain)
from <http://bio2rdf.org/rna_cycles_pdb>
where{
?a a <http://bio2rdf.org/pdb_vocabulary:Experiment>.
?mcb <http://bio2rdf.org/narf_vocabulary:derived_from> ?a.
?a <http://bio2rdf.org/pdb_vocabulary:hasPart> ?cse.
?cse a <http://bio2rdf.org/pdb_vocabulary:ChemicalSubstanceExtraction>.
?cse <http://bio2rdf.org/pdb_vocabulary:hasProduct> ?polymer.
?polymer a <http://bio2rdf.org/pdb_vocabulary:Polymer>.
?residue <http://bio2rdf.org/pdb_vocabulary:isPartOf> ?polymer.
@jctoledo
jctoledo / gist:9761850
Created March 25, 2014 13:34
count the number of pdb structures in my study for which I computed MCBs
select count (distinct ?a)
from <http://bio2rdf.org/rna_cycles_pdb>
where{
?a a <http://bio2rdf.org/pdb_vocabulary:Experiment>.
?mcb <http://bio2rdf.org/narf_vocabulary:derived_from> ?a.
}
@jctoledo
jctoledo / gist:9652461
Created March 19, 2014 22:06
list the name of all ligands used
select distinct ?ares_label
from <http://bio2rdf.org/rna_cycles_pdb>
where{
?ares a <http://bio2rdf.org/lighood_vocabulary:ligand>.
?ares a <http://bio2rdf.org/pdb_vocabulary:Residue>.
?ares <http://bio2rdf.org/pdb_vocabulary:isPartOf> ?cc.
?extraction <http://bio2rdf.org/pdb_vocabulary:hasProduct> ?cc.
?pdb_record <http://bio2rdf.org/pdb_vocabulary:hasPart> ?extraction.
?ares rdfs:label ?ares_label
}
@jctoledo
jctoledo / gist:9517428
Created March 12, 2014 22:03
find the pdbids of all structure files where the cycle 445c69d2714e43b727182b7496657eb1 occurs. Filter by resolution
select distinct ?pdb_record
from <http://bio2rdf.org/rna_cycles_pdb>
where{
?mcb <http://bio2rdf.org/narf_vocabulary:derived_from> ?pdb_record.
?mcb <http://bio2rdf.org/narf_vocabulary:has_member> ?acycle.
?acycle <http://bio2rdf.org/narf_vocabulary:has_attribute> ?a.
?a <http://bio2rdf.org/narf_vocabulary:has_md5hash> ?ahash.
FILTER regex(?ahash, "445c69d2714e43b727182b7496657eb1").
?pdb_record <http://bio2rdf.org/pdb_vocabulary:hasPart> ?struct_deter.
?struct_deter <http://bio2rdf.org/pdb_vocabulary:hasPart> ?refinement.
@jctoledo
jctoledo / gist:9394011
Created March 6, 2014 16:47
get the cycle size distribution of level 1 cycles extracted from Aptamer base data
select STR(?size) as ?cycle_size COUNT(?a) as ?frequency
from <http://bio2rdf.org/narf:ab_rna_cycles>
where{
?a a <http://bio2rdf.org/narf_vocabulary:cycle>.
?a <http://bio2rdf.org/narf_vocabulary:has_attribute> ?c.
?a <http://bio2rdf.org/narf_vocabulary:has_attribute> ?d.
?d a <http://bio2rdf.org/narf_vocabulary:cycle_size>.
?d <http://bio2rdf.org/narf_vocabulary:has_value> ?size.
?c a <http://bio2rdf.org/narf_vocabulary:cycle_profile_level_1> .
?c <http://bio2rdf.org/narf_vocabulary:has_md5hash> ?ahash .
@jctoledo
jctoledo / gist:9357375
Created March 4, 2014 22:47
find the resolution of all pdbids in a graph
select ?pdb_record ?aResolution
from <http://bio2rdf.org/narf:rna_cycles_nr>
where{
?pdb_record <http://bio2rdf.org/pdb_vocabulary:hasPart> ?struct_deter.
?struct_deter <http://bio2rdf.org/pdb_vocabulary:hasPart> ?refinement.
?refinement <http://bio2rdf.org/pdb_vocabulary:hasLsDResHigh> ?res.
?res a <http://bio2rdf.org/pdb_vocabulary:LsDResHigh>.
?res <http://bio2rdf.org/pdb_vocabulary:hasValue> ?aResolution
}
@jctoledo
jctoledo / gist:9222051
Created February 26, 2014 02:07
get the cycle uris of all cycles that have a part in a ligand neighbourhood
select distinct ?a as ?cycle_uri
from <http://bio2rdf.org/narf:rna_cycles_nr>
where{
?a a <http://bio2rdf.org/narf_vocabulary:cycle>.
?a <http://bio2rdf.org/narf_vocabulary:has_part> ?b.
?b a <http://bio2rdf.org/lighood_vocabulary:neighbor>.
?lh <http://bio2rdf.org/lighood_vocabulary:has_member> ?b.
}
@jctoledo
jctoledo / gist:9104054
Created February 19, 2014 23:50
findall bioassays that have as target uniprot:Q15835 #chemblquery
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 xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX cco: <http://rdf.ebi.ac.uk/terms/chembl#>
@jctoledo
jctoledo / gist:9103820
Created February 19, 2014 23:30
get all assay uris that contain "kinase" in their descriptions
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 xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX cco: <http://rdf.ebi.ac.uk/terms/chembl#>