almaan / stereoscope

Spatial mapping of cell types by integration of transcriptomics data
MIT License
87 stars 26 forks source link

Would stereoscope look be compatible with barcode of 10X visium? #36

Closed QuinceyLv closed 1 year ago

QuinceyLv commented 1 year ago

I was running stereoscope look and got this error:

Traceback (most recent call last): File "foo/bar/stereoscope/bin/stereoscope", line 33, in sys.exit(load_entry_point('stereoscope==0.3.1', 'console_scripts', 'stereoscope')()) File "foo/bar/python3.9/site-packages/stereoscope-0.3.1-py3.9.egg/stsc/main.py", line 16, in main look(args) File "foo/bar/python3.9/site-packages/stereoscope-0.3.1-py3.9.egg/stsc/look.py", line 436, in look crdlist = [get_crd(w,as_he = args.image_orientation) for w in wlist] File "foo/bar/python3.9/site-packages/stereoscope-0.3.1-py3.9.egg/stsc/look.py", line 436, in crdlist = [get_crd(w,as_he = args.image_orientation) for w in wlist] File "foo/bar/python3.9/site-packages/stereoscope-0.3.1-py3.9.egg/stsc/look.py", line 362, in get_crd crd = np.array(crd).astype(float) ValueError: could not convert string to float: 'AAACAAGTATCTCCCA-1'

I checked test data and found the rownames were like 4.83x31.08,19.98x24.93, and

def get_crd(w,as_he = False):
    crd = [x.replace('X','').split('x') for x in w.index.values]
    crd = np.array(crd).astype(float)
    if as_he:
        crd = crd[:,[1,0]]
        crd[:,1] = crd[:,1].max() - crd[:,1] + crd[:,1].min()
    return crd

seems specially deal with these rownames.

How could I use stereoscope look with 10X visium barcodes?