added dynamut results formatting scripts, althouh needs to be rerun once b7 completes
This commit is contained in:
parent
64669eb05f
commit
5529fbf63d
2 changed files with 214 additions and 0 deletions
53
dynamut/run_format_results_dynamut.py
Normal file
53
dynamut/run_format_results_dynamut.py
Normal file
|
@ -0,0 +1,53 @@
|
|||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Created on Fri Feb 12 12:15:26 2021
|
||||
|
||||
@author: tanu
|
||||
"""
|
||||
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
# FIXME
|
||||
# RE RUN when B07 completes!!!! as norm gets affected!
|
||||
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
#%% load packages
|
||||
import os
|
||||
homedir = os.path.expanduser('~')
|
||||
os.chdir (homedir + '/git/LSHTM_analysis/dynamut')
|
||||
from format_results_dynamut import *
|
||||
########################################################################
|
||||
# variables
|
||||
|
||||
# TODO: add cmd line args
|
||||
|
||||
gene = 'gid'
|
||||
drug = 'streptomycin'
|
||||
datadir = homedir + '/git/Data'
|
||||
indir = datadir + '/' + drug + '/input'
|
||||
outdir = datadir + '/' + drug + '/output'
|
||||
outdir_dynamut = outdir + '/dynamut_results/'
|
||||
|
||||
# Input file
|
||||
infile_dynamut = outdir_dynamut + gene + '_dynamut_all_output_clean.csv'
|
||||
|
||||
# Formatted output filename
|
||||
outfile_dynamut_f = outdir_dynamut + gene + '_complex_dynamut_norm.csv'
|
||||
|
||||
#==========================
|
||||
# CALL: format_results_mcsm_na()
|
||||
# Data: gid+streptomycin
|
||||
#==========================
|
||||
print('Formatting results for:', infile_dynamut)
|
||||
dynamut_df_f = format_dynamut_output(dynamut_output_csv = infile_dynamut)
|
||||
|
||||
# writing file
|
||||
print('Writing formatted dynamut df to csv')
|
||||
dynamut_df_f.to_csv(outfile_dynamut_f, index = False)
|
||||
|
||||
print('Finished writing file:'
|
||||
, '\nFile:', outfile_dynamut_f
|
||||
, '\nExpected no. of rows:', len(dynamut_df_f)
|
||||
, '\nExpected no. of cols:', len(dynamut_df_f.columns)
|
||||
, '\n=============================================================')
|
||||
|
||||
#%%#####################################################################
|
Loading…
Add table
Add a link
Reference in a new issue