Skip to content
Permalink
201a4969a0
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
20 lines (12 sloc) 759 Bytes
import pandas as pd
import argparse
parser = argparse.ArgumentParser(prog='extract_network_module_genes.py')
parser.add_argument('-r', '--result_path', type=str, default='survival_network/', help='path to the NetCore network propagation result directory')
parser.add_argument('-o', '--output_file', type=str, default='survival_network/network_module_genes.txt', help='file name where the network module genes are written to')
args = parser.parse_args()
result_path = args.result_path
output_file = args.output_file
module_df = pd.read_csv("%s/core_norm_subnetworks.txt" % result_path)
module_df['nodes'] = module_df['nodes'].str.split('\t')
module_genes = module_df.explode('nodes')['nodes']
module_genes.to_csv(output_file, header=False, index=False)