Preliminary implementation of trackDb generation.
[htsworkflow.git] / htsworkflow / templates / trackhub_samples.sparql
1 PREFIX libraryOntology: <http://jumpgate.caltech.edu/wiki/LibraryOntology#>
2 PREFIX submissionOntology: <http://jumpgate.caltech.edu/wiki/UcscSubmissionOntology#>
3 PREFIX ucscDaf: <http://jumpgate.caltech.edu/wiki/UcscDaf#>
4 PREFIX ncbiTaxon: <http://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id=>
5 PREFIX geoSoft: <http://www.ncbi.nlm.nih.gov/geo/info/soft2.html#>
6 PREFIX cells: <http://encodewiki.ucsc.edu/EncodeDCC/index.php/Cell_lines#>
7
8 select distinct ?name ?bam ?cell ?antibody ?sex ?control ?strain ?controlId ?library_id ?treatment ?protocol ?readType ?insertLength ?replicate ?mapAlgorithm ?species_name ?taxon_id ?extractMolecule ?growthProtocol ?extractProtocol ?dataProtocol ?tier ?experiment_type ?library_selection ?library_source ?input_quantity
9 WHERE {
10   <{{submission}}> a submissionOntology:submission ;
11                    submissionOntology:library ?library ;
12                    submissionOntology:name ?name ;
13                    ucscDaf:has_file ?file .
14   ?file ucscDaf:filename ?bam .
15   OPTIONAL { <{{submission}}> ucscDaf:control ?control }
16   OPTIONAL { <{{submission}}> ucscDaf:controlId ?controlId }
17   OPTIONAL { ?library libraryOntology:antibody ?antibody }
18   OPTIONAL { ?library libraryOntology:cell_line ?cell .
19              OPTIONAL { ?cell_line cells:cell ?cell .
20                         OPTIONAL { ?cell_line cells:documents ?growthProtocol . }
21                         OPTIONAL { ?cell_line cells:tier ?tier . } } }
22   OPTIONAL { ?library ucscDaf:sex ?sex }
23   OPTIONAL { ?library libraryOntology:library_id ?library_id }
24   OPTIONAL { ?library libraryOntology:replicate ?replicate }
25   OPTIONAL { ?library libraryOntology:species ?species_name .
26              ?species libraryOntology:species ?species_name ;
27                       libraryOntology:taxon_id ?taxon_id . }
28   OPTIONAL { ?library libraryOntology:condition_term ?treatment }
29   OPTIONAL { ?library libraryOntology:experiment_type ?experiment_type }
30   OPTIONAL { ?library libraryOntology:librarySelection ?library_selection }
31   OPTIONAL { ?library libraryOntology:librarySource ?library_source }
32   OPTIONAL { <{{submissionSet}}> geoSoft:data_processing ?dataProtocol }
33   OPTIONAL { ?library libraryOntology:extractMolecule ?extractMolecule }
34   OPTIONAL { ?library libraryOntology:extractProtocol ?extractProtocol }
35   OPTIONAL { ?library ucscDaf:protocol ?protocol }
36   OPTIONAL { ?library ucscDaf:readType ?readType }
37   OPTIONAL { ?library ucscDaf:strain ?strain }
38   OPTIONAL { ?library libraryOntology:insert_size ?insertLength }
39   OPTIONAL { ?library libraryOntology:inputQuantity ?input_quantity }
40   OPTIONAL { ?library ucscDaf:mapAlgorithm ?mapAlgorithm }
41
42 }