Skip to content

Instantly share code, notes, and snippets.

@agrueneberg
Last active October 8, 2015 17:08
Show Gist options
  • Save agrueneberg/3363331 to your computer and use it in GitHub Desktop.
Save agrueneberg/3363331 to your computer and use it in GitHub Desktop.
Federating Patient Data From RPPA Data
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
PREFIX tcga:<http://purl.org/tcga/core#>
PREFIX tcgameta:<http://purl.org/tcga/metadata#>
PREFIX tcgaclin:<http://purl.org/tcga/clin#>
PREFIX tcgaclinProp:<http://purl.org/tcga/clin#property/>
SELECT ?patientId ?tumorTissueSite ?ageAtInitialDiagnosis ?gender ?race ?vitalStatus
WHERE {
SERVICE <http://agalpha.mathbiol.org:10035/repositories/tcga> {
?file tcga:platform ?platform .
?platform rdfs:label "mda_rppa_core" .
?file tcga:diseaseStudy ?diseaseStudy .
?diseaseStudy rdfs:label "gbm" .
?file rdfs:label ?name .
FILTER contains(?name, "Level_3")
MINUS {
?file rdfs:label ?name .
filter contains(?name, "Control")
}
BIND(STRBEFORE(?name, ".txt") AS ?nameWithoutExtension)
BIND(STRAFTER(?nameWithoutExtension, "mdanderson.org_GBM.MDA_RPPA_Core.protein_expression.Level_3.") AS ?sampleId)
}
SERVICE <http://agalpha.mathbiol.org:10035/repositories/tcga-metadata> {
?sample rdfs:label ?sampleId .
?sample tcgameta:barcode ?barcode .
BIND(SUBSTR(?barcode, 1, 12) AS ?patientId)
}
SERVICE <http://agalpha.mathbiol.org:10035/repositories/tcga-patient> {
?patient tcgaclinProp:bcr_patient_barcode ?patientId .
?patient tcgaclinProp:tumor_tissue_site ?tumorTissueSite .
?patient tcgaclinProp:age_at_initial_pathologic_diagnosis ?ageAtInitialDiagnosis .
?patient tcgaclinProp:gender ?gender .
?patient tcgaclinProp:race ?race .
?patient tcgaclinProp:vital_status ?vitalStatus .
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment