aboutsummaryrefslogtreecommitdiff
path: root/workflows/pangenome-generate/from_sparql.py
diff options
context:
space:
mode:
authorPeter Amstutz2020-11-09 17:32:05 -0500
committerGitHub2020-11-09 17:32:05 -0500
commit74d46196ae69c0c557f64593910ada48d84b3654 (patch)
tree57c7df946e1aa1f2054eb49379439ebee4d4c0e6 /workflows/pangenome-generate/from_sparql.py
parentb311e2ec0f1d02cf16152855dd8bdd760ed4578b (diff)
parent98a80bd64d8a495b8fddffdef6e07e5a3fbea1e3 (diff)
downloadbh20-seq-resource-74d46196ae69c0c557f64593910ada48d84b3654.tar.gz
bh20-seq-resource-74d46196ae69c0c557f64593910ada48d84b3654.tar.lz
bh20-seq-resource-74d46196ae69c0c557f64593910ada48d84b3654.zip
Merge pull request #105 from arvados/fasta-subset-from-query
Extract subset of the all-sequences fasta by running a sparql query. Also includes some tweaks to the permalinks.
Diffstat (limited to 'workflows/pangenome-generate/from_sparql.py')
-rw-r--r--workflows/pangenome-generate/from_sparql.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/workflows/pangenome-generate/from_sparql.py b/workflows/pangenome-generate/from_sparql.py
new file mode 100644
index 0000000..4610cad
--- /dev/null
+++ b/workflows/pangenome-generate/from_sparql.py
@@ -0,0 +1,8 @@
+from rdflib import Graph
+import sys
+import subprocess
+g = Graph()
+g.parse(sys.argv[1], format="nt")
+res = g.query(sys.argv[3])
+for r in res:
+ subprocess.run(["samtools", "faidx", sys.argv[2], r[0]])