File size: 522 Bytes
7f50cd1
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
import os,sys
from pathlib import Path
from importlib.util import spec_from_file_location,module_from_spec
import numpy as np
core=Path(os.environ["CORE_DIR"])
spec=spec_from_file_location("embedding_io",core/"interface/io.py")
io=module_from_spec(spec);spec.loader.exec_module(io)
a=io.read_data(sys.argv[1])
import scanpy as sc
sc.pp.highly_variable_genes(a, n_top_genes=1000, flavor="cell_ranger")
y = sc.tl.pca(a[:, a.var["highly_variable"]].copy().X, n_comps=2, svd_solver="arpack")
io.write_embedding(sys.argv[2],y)