Git Product home page Git Product logo

Comments (8)

chenyang1999 avatar chenyang1999 commented on July 21, 2024 1

Maybe you need to preprocess the dataset, I wrote a code to preprocess it and put it under ./data

import os
import glob
file_path="./hist2tscript"
for img in glob.glob(file_path+"/*"):
    if "HE_" in img:
        fn=img.replace("HE_","")
        command=f"mv {img} {fn}"
        print(command)
        os.system(command)
    if "_stdata" in img:
        fn=img.replace("_stdata","")
        command=f"mv {img} {fn}"
        print(command)
        os.system(command)
    if "spots" in img:
        fn=img.replace("spots_","").replace(".csv",".spots.txt")
        command=f"mv {img} {fn}"
        print(command)
        os.system(command)
file_list=glob.glob(file_path+"/*.jpg")
# print(file_list)
sample_id=[]
for f in file_list:
    sample_id.append(f.split("/")[-1].split(".")[0].split("_")[0])
# print(sample_id)
# sample_id=[x[2:] for x in sample_id]
print(sample_id)
# print(glob.glob(file_path+"/*"))
for sid in sample_id:
    print(sid)
    temp_path=file_path+"/BRCA/"+sid
    print(temp_path)
    os.makedirs(file_path+"/BRCA/"+sid,exist_ok=True)
    for f in glob.glob(file_path+"/*"):
        if sid[2:] in f:
            print(f)

            command=f"mv {f} {temp_path}"
            print(command)
            os.system(command)

for img in glob.glob(file_path+"/*/*/*"):
    patient_id=img.split("/")[-2]
    # print(patient_id)
    stdata = img.split("/")[-1]
    # print(stdata)
    if patient_id not in stdata:
        fn=img.replace("BC","BT")
        command = f"mv {img} {fn}"
        print(command)
        os.system(command)

from st-net.

chenyang1999 avatar chenyang1999 commented on July 21, 2024

BUT, I still lack "*_croods.tsv", if anybody has a solution? @OnkarMulay

from st-net.

OnkarMulay avatar OnkarMulay commented on July 21, 2024

I am trying running it manually not using any functions

from st-net.

Greywan avatar Greywan commented on July 21, 2024

run sudo apt install python-openslide

from st-net.

andrewbrown1022 avatar andrewbrown1022 commented on July 21, 2024

Thanks @chenyang1999, I am also missing the "_Coords.tsv". @bryanhe any chance you could provide it? Thank you!

from st-net.

chenyang1999 avatar chenyang1999 commented on July 21, 2024

@andrewbrown1022 我没有这个肿瘤标记数据,我现在是直接拿全部 spots 的基因表达训练

from st-net.

DecodeGenome avatar DecodeGenome commented on July 21, 2024

I got the same error message "
OSError: libopenslide.so.0: cannot open shared object file: No such file or directory
" after run "python3 -m stnet prepare spatial" command at virtual env python3. I also preprocess the images in ./data/hist2tscript" as suggested here by chanyang1999, the same error. Any one has suggestions?

from st-net.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.