-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UniProt: make a 'fasta' for a chain sequence annotation
- Loading branch information
1 parent
e3c7e98
commit ffcaff4
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
examples/UniProt/111_uniprot_make_chain_sequence_fasta.ttl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/> . | ||
|