Skip to content

Commit

Permalink
UniProt: make a 'fasta' for a chain sequence annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
JervenBolleman committed Nov 1, 2024
1 parent e3c7e98 commit ffcaff4
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions examples/UniProt/111_uniprot_make_chain_sequence_fasta.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@prefix ex: <https://sparql.uniprot.org/.well-known/sparql-examples/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema: <https://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .

ex:111_uniprot_make_chain_sequence_fasta a sh:SPARQLExecutable,
sh:SPARQLSelectExecutable ;
rdfs:comment "Given an UniProt chain identifier, generate the matching sequence as a FASTA"@en ;
sh:prefixes _:sparql_examples_prefixes ;
sh:select """PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX up: <http://purl.uniprot.org/core/>
PREFIX faldo: <http://biohackathon.org/resource/faldo#>
SELECT (CONCAT('>', ?chainSeqId, '\\n', (SUBSTR(?iupacAA, ?begin, (?end-?begin+1)))) AS ?chainFasta)
WHERE {
BIND("PRO_0000268053" AS ?chainSeqId)
BIND(IRI(CONCAT("http://purl.uniprot.org/annotation/", ?chainSeqId)) AS ?annId)
?annId up:range ?range .
?range faldo:begin [ faldo:reference ?reference ; faldo:position ?begin ] ;
faldo:end [ faldo:position ?end ] .
?reference rdf:value ?iupacAA .
}""" ;
schema:keywords "chain", "sequence", "fasta" ;
schema:target <https://sparql.uniprot.org/sparql/> .

0 comments on commit ffcaff4

Please sign in to comment.