Skip to content

Commit 55ed694

Browse files
changes for docker build
1 parent 743e911 commit 55ed694

6 files changed

Lines changed: 9 additions & 9 deletions

File tree

build/crc_organoids/02-omics-crc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ def map_transcriptomics(transciptomics_data, improve_id_data, entrez_data):
103103
# move row names to a column called "stable_id" and format gene names to remove the chromosome num
104104
transciptomics_data['stable_id'] = transciptomics_data.index
105105
transciptomics_data['stable_id'] = transciptomics_data['stable_id'].str.split('__',n = 1,expand=True).iloc[:,0]
106-
transciptomics_data.to_csv("/tmp/counts_for_tpm_conversion.csv")
106+
transciptomics_data.to_csv("/tmp/counts_for_tpm_conversion.tsv", sep='\t')
107107

108108
# run tpmFromCounts.py to convert counts to tpm
109-
os.system("python3 tpmFromCounts.py --counts /tmp/counts_for_tpm_conversion.csv --genome_build https://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/001/405/GCF_000001405.13_GRCh37/GCF_000001405.13_GRCh37_genomic.gtf.gz --gene_col stable_id --exclude_col stable_id --out_file /tmp/transcriptomics_tpm.tsv")
109+
os.system("python3 tpmFromCounts.py --counts /tmp/counts_for_tpm_conversion.tsv --genome_build https://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/001/405/GCF_000001405.13_GRCh37/GCF_000001405.13_GRCh37_genomic.gtf.gz --gene_col stable_id --exclude_col stable_id --out_file /tmp/transcriptomics_tpm.tsv")
110110

111111
# get output from script (in tsv format) and average across organoids from each patient ]
112112
tpm_transciptomics_data = pd.read_csv("/tmp/transcriptomics_tpm.tsv", sep="\t")
@@ -266,5 +266,5 @@ def map_copy_number(copy_number_data, improve_id_data, entrez_data):
266266
else:
267267
print("Starting copy number data.")
268268
mutation_df = map_copy_number(copy_number_data = "/tmp/copy_num_data.csv", improve_id_data = "/tmp/crc_organoids_samples.csv", entrez_data = "/tmp/genes.csv")
269-
mutation_df.to_csv("/tmp/crc_organoids_copynumber.csv", index=False)
269+
mutation_df.to_csv("/tmp/crc_organoids_copy_number.csv", index=False)
270270

build/crc_organoids/03-drug-crc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def download_synapse_data(synID:str, save_path:str = None, synToken:str = None):
4646
def create_crc_drug_data(fitted_drug_data_path:str, prevDrugFilepath:str, output_drug_data_path:str):
4747
# import fitted drug data and get drug names from DRUG_NAME column
4848
fitted_drug_df = pd.read_csv(fitted_drug_data_path)
49-
crc_drugs_df = pd.DataFrame(columns={"DRUG_NAME":fitted_drug_df['DRUG_NAME'].unique()})
49+
crc_drugs_df = pd.DataFrame({"DRUG_NAME":fitted_drug_df['DRUG_NAME'].unique()})
5050
# if there is a prev drug file, check for new drugs
5151
if prevDrugFilepath != None and prevDrugFilepath != "":
5252
prev_drug_df = pd.read_csv(prevDrugFilepath)

build/crc_organoids/04-experiments-crc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ def create_experiments_data(experiment_data_path:str, samples_data_path:str, dru
6464
# get samples to only tumor organoid
6565
tumor_org_samples = samples_data[samples_data['other_id'].str.contains("Tumor-Organoid")]
6666
tumor_org_samples['patient_number'] = samples_data['other_id'].str.split("-",expand=True).iloc[:,0].str.replace("P","").str.replace("T","")
67+
sample_drug_experiment_merge = pd.merge(drug_experiment_merge,tumor_org_samples[['patient_number','improve_sample_id']], how='left', on='patient_number')
68+
6769
# clean up table by dropping and renaming columns
6870
sample_drug_experiment_merge = sample_drug_experiment_merge.rename(columns = {'CONC':'DOSE','viability':'GROWTH','improve_drug_id':'Drug','DURATION':'time','RESEARCH_PROJECT':'study'})
6971
sample_drug_experiment_merge['time_unit'] = "days"

build/crc_organoids/build_drugs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ echo "Running 03-drug-crc.py with token and PrevDrugs $1."
99
python3 03-drug-crc.py --Download --Drug --Token $SYNAPSE_AUTH_TOKEN --PrevDrugs $1
1010

1111
# running the drug descriptor python script
12-
python3 build_drug_desc.py --drugtable /tmp/crc_organoids_drugs.tsv --desctable /tmp/crc_drug_descriptors.csv.gz
12+
python3 build_drug_desc.py --drugtable /tmp/crc_organoids_drugs.tsv --desctable /tmp/crc_organoids_drug_descriptors.csv.gz

build/crc_organoids/build_exp.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,4 @@ echo "Running 04-experiments-crc.py with token, samples file $1 and drugs file $
88
python3 04-experiments-crc.py --Download --Experiment --Token $SYNAPSE_AUTH_TOKEN --Samples $1 --Drugs $2
99

1010
# running the drug descriptor python script
11-
python3 fit_curve.py --input /tmp/crc_experiments_for_curve_fitting.tsv --output /tmp/crc_experiment.tsv
12-
13-
# for some reason, the fit_curve.py script always outputs with .0 at the end, so remove that
14-
mv /tmp/crc_doserep.tsv.0 crc_doserep.tsv
11+
python3 fit_curve.py --input /tmp/crc_experiments_for_curve_fitting.tsv --output /tmp/crc_organoids_experiments.tsv

build/crc_organoids/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ numpy==1.23
55
requests
66
argparse
77
synapseclient
8+
matplotlib
89
#math
910
#time
1011
#threading

0 commit comments

Comments
 (0)