Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Andrew Stirn
commited on
Commit
·
6727689
1
Parent(s):
f311bf4
corrections
Browse files
tiger.py
CHANGED
|
@@ -168,6 +168,7 @@ def find_off_targets(top_guides: pd.DataFrame):
|
|
| 168 |
# progress update
|
| 169 |
print('\rPercent complete: {:.2f}%'.format(100 * min(i / len(reference_transcripts), 1)), end='')
|
| 170 |
print('')
|
|
|
|
| 171 |
|
| 172 |
return off_targets
|
| 173 |
|
|
@@ -238,19 +239,15 @@ if __name__ == '__main__':
|
|
| 238 |
df_transcripts = load_transcripts([os.path.join(args.fasta_path, f) for f in os.listdir(args.fasta_path)])
|
| 239 |
|
| 240 |
# process in batches
|
| 241 |
-
df_on_target = pd.DataFrame()
|
| 242 |
-
df_off_target = pd.DataFrame()
|
| 243 |
batch = 1
|
| 244 |
num_batches = len(df_transcripts) // BATCH_SIZE_TRANSCRIPTS
|
| 245 |
num_batches += (len(df_transcripts) % BATCH_SIZE_TRANSCRIPTS > 0)
|
| 246 |
for t in range(0, len(df_transcripts), BATCH_SIZE_TRANSCRIPTS):
|
| 247 |
print('Batch {:d} of {:d}'.format(batch, num_batches))
|
| 248 |
t_stop = min(t + BATCH_SIZE_TRANSCRIPTS, len(df_transcripts))
|
| 249 |
-
|
| 250 |
-
df_on_target
|
| 251 |
-
df_off_target
|
|
|
|
| 252 |
batch += 1
|
| 253 |
|
| 254 |
-
# save results
|
| 255 |
-
df_on_target.to_csv('on_target.csv')
|
| 256 |
-
df_off_target.to_csv('off_target.csv')
|
|
|
|
| 168 |
# progress update
|
| 169 |
print('\rPercent complete: {:.2f}%'.format(100 * min(i / len(reference_transcripts), 1)), end='')
|
| 170 |
print('')
|
| 171 |
+
del reference_transcripts
|
| 172 |
|
| 173 |
return off_targets
|
| 174 |
|
|
|
|
| 239 |
df_transcripts = load_transcripts([os.path.join(args.fasta_path, f) for f in os.listdir(args.fasta_path)])
|
| 240 |
|
| 241 |
# process in batches
|
|
|
|
|
|
|
| 242 |
batch = 1
|
| 243 |
num_batches = len(df_transcripts) // BATCH_SIZE_TRANSCRIPTS
|
| 244 |
num_batches += (len(df_transcripts) % BATCH_SIZE_TRANSCRIPTS > 0)
|
| 245 |
for t in range(0, len(df_transcripts), BATCH_SIZE_TRANSCRIPTS):
|
| 246 |
print('Batch {:d} of {:d}'.format(batch, num_batches))
|
| 247 |
t_stop = min(t + BATCH_SIZE_TRANSCRIPTS, len(df_transcripts))
|
| 248 |
+
df_on_target, df_off_target = tiger_exhibit(df_transcripts[t:t_stop])
|
| 249 |
+
df_on_target.to_csv('on_target_{:d}.csv'.format(batch), index=False)
|
| 250 |
+
df_off_target.to_csv('off_target_{:d}.csv'.format(batch), index=False)
|
| 251 |
+
del df_on_target, df_off_target
|
| 252 |
batch += 1
|
| 253 |
|
|
|
|
|
|
|
|
|