@@ -103,13 +103,13 @@ 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 ("counts_for_tpm_conversion.csv" )
106+ transciptomics_data .to_csv ("/tmp/ counts_for_tpm_conversion.csv" )
107107
108108 # run tpmFromCounts.py to convert counts to tpm
109- os .system ("python tpmFromCounts.py --counts 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 transcriptomics_tpm.tsv" )
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" )
110110
111111 # get output from script (in tsv format) and average across organoids from each patient ]
112- tpm_transciptomics_data = pd .read_csv ("transcriptomics_tpm.tsv" , sep = "\t " )
112+ tpm_transciptomics_data = pd .read_csv ("/tmp/ transcriptomics_tpm.tsv" , sep = "\t " )
113113 tpm_transciptomics_data .index = tpm_transciptomics_data ['stable_id' ]
114114 tpm_transciptomics_data = tpm_transciptomics_data .drop (columns = ['stable_id' ])
115115 transpose_transcriptomics = tpm_transciptomics_data .T
@@ -226,7 +226,7 @@ def map_copy_number(copy_number_data, improve_id_data, entrez_data):
226226 if args .parse :
227227 print ("Parsing excel file." )
228228 # Download parse excel file to get mutation data and the copy num data
229- mutation_df , copy_num_df = parse_mmc2 ("/tmp/mmc2.xlsx" )
229+ mutation_df , copy_num_df = parse_mmc2 ("/tmp/mmc2.xlsx/mmc2.xlsx " )
230230 # Save mutation and copy number data into csv format
231231 mutation_df .to_csv ("/tmp/mutation_data.csv" )
232232 copy_num_df .to_csv ("/tmp/copy_num_data.csv" )
@@ -241,7 +241,7 @@ def map_copy_number(copy_number_data, improve_id_data, entrez_data):
241241 exit ()
242242 else :
243243 print ("Starting transcriptomics data." )
244- transcriptomics_df = map_transcriptomics (transciptomics_data = "/tmp/GSE65253_col_tum_org_merge.csv.gz" , improve_id_data = "/tmp/crc_samples .csv" , entrez_data = "/tmp/genes.csv" )
244+ transcriptomics_df = map_transcriptomics (transciptomics_data = "/tmp/GSE65253_col_tum_org_merge.csv.gz" , improve_id_data = "/tmp/crc_organoids_samples .csv" , entrez_data = "/tmp/genes.csv" )
245245 transcriptomics_df .to_csv ("/tmp/crc_organoids_transcriptomics.csv" , index = False )
246246
247247 if args .mutations :
@@ -253,7 +253,7 @@ def map_copy_number(copy_number_data, improve_id_data, entrez_data):
253253 exit ()
254254 else :
255255 print ("Starting mutations data." )
256- mutation_df = map_mutations (mutation_data = "/tmp/mutation_data.csv" , improve_id_data = "/tmp/crc_samples .csv" , entrez_data = "/tmp/genes.csv" )
256+ mutation_df = map_mutations (mutation_data = "/tmp/mutation_data.csv" , improve_id_data = "/tmp/crc_organoids_samples .csv" , entrez_data = "/tmp/genes.csv" )
257257 mutation_df .to_csv ("/tmp/crc_organoids_mutations.csv" , index = False )
258258
259259 if args .copy_number :
@@ -265,6 +265,6 @@ def map_copy_number(copy_number_data, improve_id_data, entrez_data):
265265 exit ()
266266 else :
267267 print ("Starting copy number data." )
268- mutation_df = map_copy_number (copy_number_data = "/tmp/copy_num_data.csv" , improve_id_data = "/tmp/crc_samples .csv" , entrez_data = "/tmp/genes.csv" )
268+ 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" )
269269 mutation_df .to_csv ("/tmp/crc_organoids_copynumber.csv" , index = False )
270270
0 commit comments