derive_masks: keep pysam's downloaded tabix indexes in data/pgx/cache, not the working directory
This commit is contained in:
1 parent
2ca0f44da6
commit
675eea4855
1 file changed
+6
@@ -38,6 +38,7 @@ def main() -> int:
|
||||
ap.add_argument("--manifest", required=True)
|
||||
ap.add_argument("--min-concordance", type=float, default=0.95)
|
||||
ap.add_argument("--out", required=True, type=Path)
|
||||
ap.add_argument("--cache", type=Path, default=Path("data/pgx/cache"), help="where pysam keeps remote .tbi files")
|
||||
a = ap.parse_args()
|
||||
ident = {}
|
||||
with a.identity.open() as fh:
|
||||
@@ -86,6 +87,11 @@ def main() -> int:
|
||||
for c, p, r, al, g in keys:
|
||||
by_gene[(g, c)].append((p, r, al))
|
||||
inds = sorted(set(use.values()))
|
||||
import os
|
||||
|
||||
a.out = a.out.resolve()
|
||||
a.cache.mkdir(parents=True, exist_ok=True)
|
||||
os.chdir(a.cache) # pysam downloads the remote tabix indexes into the working directory
|
||||
for (g, c), vs in sorted(by_gene.items()):
|
||||
core = c.removeprefix("chr")
|
||||
chrom = "chrM" if core in ("MT", "M") else f"chr{core}"
|
||||
|
||||
Reference in new issue
Block a user