Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
UNLOCK
scripts
Commits
16167999
Commit
16167999
authored
3 years ago
by
Jasper Koehorst
Browse files
Options
Downloads
Patches
Plain Diff
fixed label issue of sample and assay metadata fields
parent
317b710c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ngtax_to_biom.py
+7
-4
7 additions, 4 deletions
ngtax_to_biom.py
with
7 additions
and
4 deletions
ngtax_to_biom.py
+
7
−
4
View file @
16167999
...
@@ -106,7 +106,7 @@ def process_rdf_files(rdf_file):
...
@@ -106,7 +106,7 @@ def process_rdf_files(rdf_file):
}
"""
)
}
"""
)
for
row
in
qres
:
for
row
in
qres
:
predicate
=
row
.
predicate
.
split
(
"
/
"
)[
-
1
]
predicate
=
"
assay_
"
+
row
.
predicate
.
split
(
"
/
"
)[
-
1
]
identifier
=
"
Sample1_
"
+
row
.
id
+
"
_1.fastq.gz
"
identifier
=
"
Sample1_
"
+
row
.
id
+
"
_1.fastq.gz
"
print
(
identifier
+
"
\t
"
+
predicate
+
f
"
\t
{
row
.
object
}
"
,
file
=
output
)
print
(
identifier
+
"
\t
"
+
predicate
+
f
"
\t
{
row
.
object
}
"
,
file
=
output
)
...
@@ -118,18 +118,21 @@ def process_rdf_files(rdf_file):
...
@@ -118,18 +118,21 @@ def process_rdf_files(rdf_file):
PREFIX unlock: <http://m-unlock.nl/ontology/>
PREFIX unlock: <http://m-unlock.nl/ontology/>
PREFIX jerm: <http://jermontology.org/ontology/JERMOntology#>
PREFIX jerm: <http://jermontology.org/ontology/JERMOntology#>
PREFIX schema: <http://schema.org/>
PREFIX schema: <http://schema.org/>
SELECT DISTINCT ?id ?predicate ?object
SELECT DISTINCT ?id ?predicate ?object
?predicate_label
WHERE {
WHERE {
?sample a jerm:Sample .
?sample a jerm:Sample .
?sample ?predicate ?object .
?sample ?predicate ?object .
?sample unlock:assay ?assay .
OPTIONAL { ?predicate rdfs:label ?predicate_label}
?sample jerm:hasPart ?assay .
?assay a unlock:AmpliconAssay .
?assay a unlock:AmpliconAssay .
?assay schema:identifier ?id .
?assay schema:identifier ?id .
FILTER(!ISIRI(?object))
FILTER(!ISIRI(?object))
}
"""
)
}
"""
)
for
row
in
qres
:
for
row
in
qres
:
predicate
=
row
.
predicate
.
split
(
"
/
"
)[
-
1
]
predicate
=
"
sample_
"
+
row
.
predicate
.
split
(
"
/
"
)[
-
1
]
if
type
(
row
.
predicate_label
)
==
rdflib
.
term
.
Literal
:
predicate
=
"
sample_
"
+
row
.
predicate_label
.
replace
(
"
"
,
"
_
"
)
identifier
=
"
Sample1_
"
+
row
.
id
+
"
_1.fastq.gz
"
identifier
=
"
Sample1_
"
+
row
.
id
+
"
_1.fastq.gz
"
print
(
identifier
+
"
\t
"
+
predicate
+
f
"
\t
{
row
.
object
}
"
,
file
=
output
)
print
(
identifier
+
"
\t
"
+
predicate
+
f
"
\t
{
row
.
object
}
"
,
file
=
output
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment