#script for converting combined sda ensemble predictions to features #input: (1) directory of feature files in the format targetname_otherinfo.feat #(2) directory of sda ensemble prediction files (.combinedPred) to be converted into features #note: please ensure that the pred files contain the target name to match with the features #important: must be in same directory as convertSdaScoresToFeatures.py #IMPORTANT: will write multiple '.sdaConvertedFeat' files to the pred directory #created 1/25/2017 Joseph Luttrell import os import sys import subprocess featDir = sys.argv[1] #contains .feat files predDir = sys.argv[2] #contains .combinedPred files if not featDir.endswith('/'): featDir += '/' if not predDir.endswith('/'): predDir += '/' predList = [] #list of the file names in predDir with the directory appended for file in os.listdir(predDir): if not file.endswith('.combinedPred'): continue predList.append(predDir + file) for file in os.listdir(featDir): if not file.endswith('.feat'): continue targetName = file[:file.find('_')] for predf in predList: if targetName in predf: cmd = ['python', 'convertSdaScoresToFeatures.py', predf, (featDir + file)] subprocess.call(cmd)