Skip to content

Commit 4076b5a

Browse files
committed
added fix to eperiemnts
1 parent 07d8825 commit 4076b5a

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

build/broad_sanger/03a-nci60Drugs.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
conc_data = 'https://wiki.nci.nih.gov/download/attachments/147193864/DOSERESP.zip?version=11&modificationDate=1712351454136&api=v2'
2020

2121

22-
23-
24-
2522
def main():
2623
parser = argparse.ArgumentParser()
2724
parser.add_argument('--test',action='store_true',default=False,help='Test script by sampling 100 chemicals')
@@ -51,7 +48,7 @@ def main():
5148
arr = set(pubchems['CID'])
5249

5350
print("Querying pubchem from CIDs")
54-
pr.update_dataframe_and_write_tsv(arr,opts.output,'/tmp/ignore_chems.txt',batch_size=400,isname=False)
51+
pr.update_dataframe_and_write_tsv(arr,opts.output,'/tmp/ignore_chems.txt',batch_size=400,isname=False,time_limit=10*60*60)
5552

5653
##then make sure to paste `nsc` in front of all nsc idds
5754
res = pl.read_csv(opts.output,separator='\t')

build/broad_sanger/04-drug_dosage_and_curves.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
import os
1414
import argparse
15+
import pandas as pd
1516

1617
parser = argparse.ArgumentParser()
1718
parser.add_argument('--curSampleFile',dest='samplefile',default=None,help='DepMap sample file')
@@ -45,7 +46,12 @@
4546
os.system('/opt/venv/bin/python fit_curve.py --input '+a+' --output '+a)
4647

4748
###step 4c concatenate all files
49+
outfiles = [a for a in os.listdir("./") if ".0" in a]
50+
final_file = []
51+
for of in outfiles:
52+
final_file.append(pd.read_csv(of,sep='\t'))
4853

49-
os.system('cat *.0 > /tmp/broad_sanger_experiments.tsv')
54+
pd.concat(final_file).to_csv('/tmp/broad_sanger_experiments.tsv',index=False,sep='\t')
55+
#os.system('cat *.0 > /tmp/broad_sanger_experiments.tsv')
5056
#os.system('gzip -f /tmp/experiments.tsv')
5157

build/utils/pubchem_retrieval.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,9 @@ def timeout_handler(signum, frame):
150150
should_continue = False
151151

152152
# Call this function from other scripts.
153-
def update_dataframe_and_write_tsv(unique_names, output_filename="drugs.tsv",ignore_chems="ignore_chems.txt", batch_size=1,isname=True):
153+
def update_dataframe_and_write_tsv(unique_names, output_filename="drugs.tsv",ignore_chems="ignore_chems.txt", batch_size=1,isname=True,time_limit=5*60*60):
154154
global should_continue, existing_synonyms, existing_pubchemids
155-
time_limit=5*60*60 # 5 hours
155+
#time_limit=5*60*60 # 5 hours
156156
signal.signal(signal.SIGALRM, timeout_handler)
157157
signal.alarm(time_limit)
158158
print('starting with '+str(len(unique_names))+' drug names/ids')

0 commit comments

Comments
 (0)