Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

float to int catching #10

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions STARCH.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ def init_params(self,d=1.3,nthreads=1):
diff = np.mean(diffs)
logger.info(str(diff))

pool = mp.Pool(nthreads)
pool = mp.Pool(int(nthreads))
results = pool.map(partial(init_helper, data=self.data, n_clusters=self.n_clusters,normal=self.normal,diff=diff,labels=self.labels,c=c), [x for x in range(self.data.shape[0])])
for i in range(len(results)):
labels[i,:] = results[i]
Expand Down Expand Up @@ -568,7 +568,7 @@ def HMM_estimate_states_parallel(self,t,maxiters=100,deltoamp=0,nthreads=1):
for chrom in set(chromosomes):
for k in range(self.n_clusters):
inds.append([np.asarray([i for i in range(len(chromosomes)) if chromosomes[i] == chrom]),np.asarray([i for i in range(len(self.labels)) if self.labels[i]==k]),k])
pool = mp.Pool(nthreads)
pool = mp.Pool(int(nthreads))
results = pool.map(partial(HMM_helper, data=self.data, means = self.means, sigmas = self.sigmas,t = self.t,num_states = self.num_states,model=self.model,normal=self.normal), inds)
score = 0
for i in range(len(results)):
Expand Down Expand Up @@ -612,7 +612,7 @@ def MAP_estimate_labels(self,beta_spots,nthreads,maxiters=20):
inds_spot.append(np.where(self.spot_network[j,:] >= .25)[0])
tmp_spot.append(self.spot_network[j,inds_spot[j]])
logger.debug(str(tmp_spot))
pool = mp.Pool(nthreads)
pool = mp.Pool(int(nthreads))
norms = [norm(self.means[0][0],np.sqrt(self.sigmas[0][0])),norm(self.means[1][0],np.sqrt(self.sigmas[1][0])),norm(self.means[2][0],np.sqrt(self.sigmas[2][0]))]
for m in range(maxiters):
posteriors = 0
Expand Down
2 changes: 1 addition & 1 deletion run_STARCH.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
parser.add_argument('-p','--platform',required=False,type=str,choices=["ST", "Visium"],default='ST',help='platform for spatial transcriptomcis data')
args = parser.parse_args()

nthreads = args.threads
nthreads = int(args.threads)
beta_spot = args.beta_spot
n_clusters = args.n_clusters
returnnormal = args.returnnormal
Expand Down