added script for formatting mcsm_na results
This commit is contained in:
parent
656639e871
commit
7c0824d0f2
2 changed files with 183 additions and 0 deletions
48
mcsm_na/run_format_results_mcsm_na.py
Normal file
48
mcsm_na/run_format_results_mcsm_na.py
Normal file
|
@ -0,0 +1,48 @@
|
|||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Created on Fri Feb 12 12:15:26 2021
|
||||
|
||||
@author: tanu
|
||||
"""
|
||||
#%% load packages
|
||||
import os
|
||||
homedir = os.path.expanduser('~')
|
||||
os.chdir (homedir + '/git/LSHTM_analysis/mcsm_na')
|
||||
from format_results_mcsm_na import *
|
||||
########################################################################
|
||||
# variables
|
||||
|
||||
# TODO: add cmd line args
|
||||
|
||||
#gene = 'gid'
|
||||
drug = 'streptomycin'
|
||||
datadir = homedir + '/git/Data'
|
||||
indir = datadir + '/' + drug + '/input'
|
||||
outdir = datadir + '/' + drug + '/output'
|
||||
outdir_na = outdir + '/mcsm_na_results/'
|
||||
|
||||
# Input file
|
||||
infile_mcsm_na = outdir_na + 'gid_output_combined_clean.tsv'
|
||||
|
||||
# Formatted output file
|
||||
outfile_mcsm_na_f = outdir_na + 'gid_complex_mcsm_na_norm.csv'
|
||||
|
||||
#==========================
|
||||
# CALL: format_results_mcsm_na()
|
||||
# Data: gid+streptomycin
|
||||
#==========================
|
||||
print('Formatting results for:', infile_mcsm_na)
|
||||
mcsm_na_df_f = format_mcsm_na_output(mcsm_na_output_tsv = infile_mcsm_na)
|
||||
|
||||
# writing file
|
||||
print('Writing formatted df to csv')
|
||||
mcsm_na_df_f.to_csv(outfile_mcsm_na_f, index = False)
|
||||
|
||||
print('Finished writing file:'
|
||||
, '\nFile:', outfile_mcsm_na_f
|
||||
, '\nExpected no. of rows:', len(mcsm_na_df_f)
|
||||
, '\nExpected no. of cols:', len(mcsm_na_df_f.columns)
|
||||
, '\n=============================================================')
|
||||
|
||||
#%%#####################################################################
|
Loading…
Add table
Add a link
Reference in a new issue