Skip to content

Commit

Permalink
Remove commented-out calls to R scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
iainrb committed Jan 31, 2025
1 parent dfc552e commit 06537df
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 58 deletions.
45 changes: 0 additions & 45 deletions src/lib/djerba/plugins/wgts/cnv_purple/purple_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,6 @@ def __init__(self, work_dir, log_level=logging.WARNING, log_path=None, plot9_ver
self.data_dir = directory_finder(log_level, log_path).get_data_dir()
self.plot9_verbose = plot9_verbose

# def analyze_segments(self, cnvfile, segfile, whizbam_url, purity, ploidy):
# dir_location = os.path.dirname(__file__)
# centromeres_file = os.path.join(self.data_dir, pc.CENTROMERES)
# genebedpath = os.path.join(self.data_dir, pc.GENEBED)
# cmd = [
# 'Rscript', os.path.join(self.r_script_dir, "process_segment_data.r"),
# '--outdir', self.work_dir,
# '--cnvfile', cnvfile,
# '--segfile', segfile,
# '--centromeres', centromeres_file,
# '--purity', str(purity),
# '--ploidy', str(ploidy),
# '--whizbam_url', whizbam_url,
# '--genefile', genebedpath
# ]
# runner = subprocess_runner()
# result = runner.run(cmd, "segments R script")
# return result.stdout.split('"')[1]

# rewrite analyze_segments in python
def analyze_segments(self, cnvfile, segfile, whizbam_url, purity, ploidy):
centromeres_file = os.path.join(self.data_dir, pc.CENTROMERES)
Expand Down Expand Up @@ -177,17 +158,6 @@ def analyze_segments(self, cnvfile, segfile, whizbam_url, purity, ploidy):

return b64txt

# def consider_purity_fit(self, purple_range_file):
# dir_location = os.path.dirname(__file__)
# cmd = [
# 'Rscript', os.path.join(self.r_script_dir, "process_fit.r"),
# '--range_file', purple_range_file,
# '--outdir', self.work_dir
# ]
# runner = subprocess_runner()
# result = runner.run(cmd, "fit R script")
# return result
# rewrite in python
def consider_purity_fit(self, purple_range_file):
range_df = pd.read_csv(purple_range_file, sep="\t", comment='!')
output = os.path.join(self.work_dir, "purple.range.png")
Expand Down Expand Up @@ -365,21 +335,6 @@ def construct_whizbam_links(self, df, whizbam_url):

return df

# def convert_purple_to_gistic(self, purple_gene_file, tumour_id, ploidy):
# dir_location = os.path.dirname(__file__)
# oncolistpath = os.path.join(self.data_dir, pc.ONCOLIST)
# cmd = [
# 'Rscript', os.path.join(self.r_script_dir, "process_CNA_data.r"),
# '--genefile', purple_gene_file,
# '--outdir', self.work_dir,
# '--oncolist', oncolistpath,
# '--tumourid', tumour_id,
# '--ploidy', str(ploidy)
# ]
# runner = subprocess_runner()
# result = runner.run(cmd, "CNA R script")
# return result
# rewrite in python
def convert_purple_to_gistic(self, purple_gene_file, tumour_id, ploidy):
oncolistpath = os.path.join(self.data_dir, pc.ONCOLIST)
cna_output = os.path.join(self.work_dir, "purple.data_CNA.txt")
Expand Down
13 changes: 0 additions & 13 deletions src/lib/djerba/plugins/wgts/snv_indel/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,19 +504,6 @@ def run_data_rscript(self, whizbam_url, maf_input_path):
runner = subprocess_runner(self.log_level, self.log_path)
result = runner.run(cmd, "main snv/indel R script")
return result

# def write_vaf_plot(self):
# """Run the R script to write the VAF plot"""
# dir_location = os.path.dirname(__file__)
# # TODO make the ensembl conversion file specific to this plugin?
# cmd = [
# 'Rscript', os.path.join(dir_location, 'R', 'vaf_plot.r'),
# '--dir', self.work_dir,
# '--output', os.path.join(self.work_dir, sic.VAF_PLOT_FILENAME)
# ]
# runner = subprocess_runner(self.log_level, self.log_path)
# result = runner.run(cmd, "VAF plot R script")
# return result

def write_vaf_plot(self):
""""Create VAF plot with matplotlib"""
Expand Down

0 comments on commit 06537df

Please sign in to comment.