download_bundle.py: match bwa/minibwa index by suffix
Browse files- bin/download_bundle.py +11 -10
bin/download_bundle.py
CHANGED
|
@@ -10,8 +10,9 @@ Always downloaded:
|
|
| 10 |
|
| 11 |
Optional:
|
| 12 |
--index bwa|minibwa|all aligner index (default: none)
|
| 13 |
-
|
| 14 |
-
|
|
|
|
| 15 |
--extract-vep extract the VEP cache into <outdir>/vep (default: no)
|
| 16 |
|
| 17 |
Examples:
|
|
@@ -25,6 +26,7 @@ import argparse, fnmatch, os, sys, tarfile
|
|
| 25 |
|
| 26 |
REPO = "pzweuj/SchemaBio_Bundle"
|
| 27 |
BWA_EXT = (".amb", ".ann", ".bwt", ".pac", ".sa")
|
|
|
|
| 28 |
|
| 29 |
|
| 30 |
def select(files, genome, index):
|
|
@@ -32,14 +34,13 @@ def select(files, genome, index):
|
|
| 32 |
f"{genome}/homo_sapiens_merged_vep_*.tar.gz",
|
| 33 |
f"{genome}/bed/*", f"{genome}/schema_bundle/*"]
|
| 34 |
out = [f for f in files if any(fnmatch.fnmatch(f, p) for p in pats)]
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
out += mb
|
| 43 |
return sorted(set(out))
|
| 44 |
|
| 45 |
|
|
|
|
| 10 |
|
| 11 |
Optional:
|
| 12 |
--index bwa|minibwa|all aligner index (default: none)
|
| 13 |
+
matched by file suffix under {genome}/:
|
| 14 |
+
bwa -> .amb .ann .bwt .pac .sa
|
| 15 |
+
minibwa -> .l2b .mbw (incl. .meth.mbw)
|
| 16 |
--extract-vep extract the VEP cache into <outdir>/vep (default: no)
|
| 17 |
|
| 18 |
Examples:
|
|
|
|
| 26 |
|
| 27 |
REPO = "pzweuj/SchemaBio_Bundle"
|
| 28 |
BWA_EXT = (".amb", ".ann", ".bwt", ".pac", ".sa")
|
| 29 |
+
MINIBWA_EXT = (".l2b", ".mbw")
|
| 30 |
|
| 31 |
|
| 32 |
def select(files, genome, index):
|
|
|
|
| 34 |
f"{genome}/homo_sapiens_merged_vep_*.tar.gz",
|
| 35 |
f"{genome}/bed/*", f"{genome}/schema_bundle/*"]
|
| 36 |
out = [f for f in files if any(fnmatch.fnmatch(f, p) for p in pats)]
|
| 37 |
+
gfiles = [f for f in files if f.startswith(f"{genome}/")]
|
| 38 |
+
for name, ext in (("bwa", BWA_EXT), ("minibwa", MINIBWA_EXT)):
|
| 39 |
+
if index in (name, "all"):
|
| 40 |
+
hit = [f for f in gfiles if f.endswith(ext)]
|
| 41 |
+
if not hit:
|
| 42 |
+
print(f"[warn] no {name} index ({' '.join(ext)}) found for {genome}, skipped", file=sys.stderr)
|
| 43 |
+
out += hit
|
|
|
|
| 44 |
return sorted(set(out))
|
| 45 |
|
| 46 |
|