Skip to content

Commit

Permalink
add setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
JiaShun-Xiao committed Jun 12, 2023
1 parent 902d880 commit b9832d0
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 22 deletions.
20 changes: 16 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,20 @@
url='https://github.com/YangLabHKUST/SpatialScope',
author='Xiaomeng Wan ([email protected]), Jiashun Xiao ([email protected])',
license='GPLv3',
packages=find_packages(['src','SCGrad']),
scripts=['src/Cell_Type_Identification.py'],#'src/Nuclei_Segmentation.py', 'Singlet_Doublet_Classification.py', 'Decomposition.py'],
packages=find_packages(),
scripts=['src/Cell_Type_Identification.py','src/Nuclei_Segmentation.py', 'src/Singlet_Doublet_Classification.py', 'src/Decomposition.py','src/Train_scRef.py'],
include_package_data=True, # 启用清单文件MANIFEST.in
exclude_package_date={'':['.gitignore']}
)
exclude_package_date={'':['.gitignore']},
install_requires = ['scanpy',
'squidpy',
'stardist',
'tensorflow',
'qpsolvers',
'torch',
'scikit-learn',
'pandas',
'matplotlib',
'scipy',
'ray']
)

20 changes: 6 additions & 14 deletions src/Cell_Type_Identification.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
import warnings
warnings.filterwarnings('ignore')

# from WaveGrad.utils import configure_logging
from src.utils import *
from src.utils_CTI import *
import sys
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
from utils import *
from utils_CTI import *
num_cpus = psutil.cpu_count(logical=False)
os.environ["PYTHONPATH"] = os.getcwd()+ ":" + os.environ.get("PYTHONPATH", "")
ray.shutdown()
Expand Down Expand Up @@ -277,16 +278,7 @@ def CellTypeIdentification(self, nu = 10, n_neighbo = 10, hs_ST = False, VisiumC
--SC_Data ./Ckpts_scRefs/Heart_D2/Ref_Heart_sanger_D2.h5ad
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
"""
def str2bool(v):
if isinstance(v, bool):
return v
if v.lower() in ("yes", "true", "t", "y", "1"):
return True
elif v.lower() in ("no", "false", "f", "n", "0"):
return False
else:
raise argparse.ArgumentTypeError("Boolean value expected.")


parser = argparse.ArgumentParser(description='simulation sour_sep')
parser.add_argument('--tissue', type=str, help='tissue name', default=None)
parser.add_argument('--out_dir', type=str, help='output path', default=None)
Expand All @@ -296,7 +288,7 @@ def str2bool(v):
parser.add_argument('--SC_Data', type=str, help='single cell reference data path', default=None)
parser.add_argument('--cell_class_column', type=str, help='input cell class label column in scRef file', default = 'cell_type')
parser.add_argument('--hs_ST', action="store_true", help='high resolution ST data such as Slideseq, DBiT-seq, and HDST, MERFISH etc.')
parser.add_argument("--VisiumCellsPlot", type=str2bool, const=True, default=True, nargs="?", help="whether to plot in VisiumCells mode or just scatter plot")
parser.add_argument("--VisiumCellsPlot", action="store_true", help="whether to plot in VisiumCells mode or just scatter plot")
parser.add_argument('--UMI_min_sigma', type=int, help='WarmStart parameter', default=300)
parser.add_argument('--InitProp', type=str, help='whether to run warmstart', default = None)
args = parser.parse_args()
Expand Down
3 changes: 2 additions & 1 deletion src/Decomposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
import logging
import scipy
import json
import sys
sys.path.append(os.path.dirname(os.path.realpath(__file__)))

from SCGrad import SCGradNN, EMAHelper


import warnings
warnings.filterwarnings('ignore')

Expand Down
3 changes: 3 additions & 0 deletions src/Nuclei_Segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
import pandas as pd
from PIL import Image
Image.MAX_IMAGE_PIXELS = 1000000000
import sys
import os
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
from utils import *


Expand Down
3 changes: 2 additions & 1 deletion src/Singlet_Doublet_Classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@

import warnings
warnings.filterwarnings('ignore')

import sys
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
from utils import *
from utils_CTI import *
num_cpus = psutil.cpu_count(logical=False)
Expand Down
3 changes: 2 additions & 1 deletion src/Train_scRef.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
from torch import nn
from torch.utils.data import DataLoader


import sys
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
from SCGrad import SCGradNN, EMAHelper
from utils import configure_logging,ConfigWrapper
import tqdm
Expand Down
3 changes: 2 additions & 1 deletion src/utils_CTI.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
import seaborn as sns
import warnings
warnings.filterwarnings('ignore')
from src.utils_pyRCTD import *
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
from utils_pyRCTD import *


def find_neighbors(position, q=0.004, p=1):
Expand Down

0 comments on commit b9832d0

Please sign in to comment.