Skip to content

Commit 5cac6c9

Browse files
committed
v2.7.3
1 parent 06233c9 commit 5cac6c9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Scripts/RankGenes.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,11 @@ def GeneRankingAnalysis(sample):
249249
TimeStamp(sec_elapsed,'aRRA Computation')
250250
# Permutation
251251
start = time.time()
252-
print('Estimating aRRA null distribution ('+str(Np)+' Permutations)...')
252+
print('Estimating aRRA null distribution ('+str(Np)+' permutations)...')
253+
if L < Np*r:
254+
print('WARNING: Library too small for '+str(Np)+' permutations!')
255+
Np = int(numpy.floor(L/r))
256+
print('Auto-correcting permutation number to '+str(Np)+' ...')
253257
I_perm = numpy.random.choice(L,size=(Np,r),replace=False)
254258
metric_null = Parallel(n_jobs=num_cores)(delayed(compute_aRRA_nullx)(I) for I in I_perm)
255259
end = time.time()
@@ -284,7 +288,7 @@ def GeneRankingAnalysis(sample):
284288
os.chdir(ListDir)
285289
SortFlag = False
286290
# Running null distribution
287-
print('Estimating STARS null distribution ('+str(Np)+' Permutations)...')
291+
print('Estimating STARS null distribution ('+str(Np)+' permutations)...')
288292
STARS_input = open('STARS_input.txt','w')
289293
STARS_input.write('sgID\tcounts\n')
290294
STARS_chip = open('STARS_chip.txt','w')

0 commit comments

Comments
 (0)