# Path: xenoGI/parameters.py
# def createParametersD(baseParamStr,paramFN):
# def addParametersToD(paramL,paramD):
# def loadFileNameMapD(fileNameMapFN,genbankFileList=None):
# 
# Path: xenoGI/blast.py
# def runBlast(dbFileL_1,dbFileL_2,paramD):
# def getDbFileL(fastaFilePath,strainNamesT):
# def formatDb(dbFileL,blastExecutDirPath):
# def makeBlastClineList(dbFileL_1, dbFileL_2,paramD):
# def processCline(cline):
# def determineShouldBlast(dbFile1,dbFile2,blastFilePath,blastFileJoinStr):
# def subprocessWrapper(cline):
# def parseBlastFile(blastFN,evalueThresh,alignCoverThresh,percIdentThresh):
#                 L = list(blastCLineT) + ['-query',query,'-db',db,'-out',outFN]
#     L = cline.split('"') # " make emacs happy.
#     L=[]
# 
# Path: xenoGI/genomes.py
# def loadSeq(paramD,fileEnding,genesS=None):
#     def __init__(self, geneInfoFN):
#     def initializeGeneRangeByStrainD(self,geneInfoFN):
#     def initializeStrainGeneRangeT(self):
#     def initializeGeneNumToNameD(self,geneInfoFN,strainNamesL=None):
#     def initializeGeneInfoD(self,geneInfoFN,strainNamesL=None):
#     def loadDictFromGeneInfoFile(self,geneInfoFN,strainNamesL,onlyNames):
#     def numToStrainName(self,geneNum):
#     def numToName(self,geneNumber):
#     def iterGenes(self,strainL=None):
#     def iterGenesStrain(self,strainName):
#     def numToGeneInfo(self,geneNumber):
#     def __len__(self):
#     def __repr__(self):
# def getProximityInWindow(geneWinT,geneProximityD):
# def createGeneProximityD(geneOrderD,geneProximityForGroup):
# def createGeneOrderD(geneOrderFN,strainNamesL):
# class genes:
#         D = {}
#         L=s.split('\t')
# 
# Path: xenoGI/xenoGI.py
# def main():
# def parseGenbankWrapper(paramD):
# def writeStrainInfoFN(strainNamesT,paramD):
# def readStrainInfoFN(strainInfoFN):
# def runBlastWrapper(paramD):
# def loadGenomeRelatedData(paramD):
# def calcScoresWrapper(paramD,blastFnL):
# def makeSpeciesTreeWrapper(paramD):
# def loadTreeRelatedData(speciesTreeFN):
# def makeFamiliesWrapper(paramD):
# def makeIslandsWrapper(paramD):
# def refineWrapper(paramD):
# def printAnalysisWrapper(paramD,speciesTreeFN,rootFocalClade):
# def createIslandBedWrapper(paramD):
# def interactiveAnalysisWrapper(paramD):
#     def printFam(familyNum,familiesO,fileF=sys.stdout):
#     def findGene(searchStr,fileF=sys.stdout):
#     def printLocusIsland(locusIslandNum,synWSize,fileF=sys.stdout):
#     def printLocusIslandsAtNode(node,fileF=sys.stdout):
# def debugWrapper(paramD):
#         L=matchFamilyIsland(genesO,gene2FamIslandD,searchStr)


import sys,os
from xenoGI import parameters,blast,genomes,xenoGI
sys.path.insert(0,os.path.join(sys.path[0],'..'))

# Identifies xenoGI proteins with significant similarity to a provided
# protein multifasta, printing their xenoGI gene names to
# standard out, one per line. Expects to be run in a xenoGI working
# directory.

if __name__ == "__main__":

    paramFN = sys.argv[1]
    strainInfoFN = sys.argv[2] # include as argument so can pass in scaffold only set in xlMode case
    proteinMultiFastaPath = sys.argv[3]


# Path: xenoGI/parameters.py
# def createParametersD(baseParamStr,paramFN):
# def addParametersToD(paramL,paramD):
# def loadFileNameMapD(fileNameMapFN,genbankFileList=None):
# 
# Path: xenoGI/blast.py
# def runBlast(dbFileL_1,dbFileL_2,paramD):
# def getDbFileL(fastaFilePath,strainNamesT):
# def formatDb(dbFileL,blastExecutDirPath):
# def makeBlastClineList(dbFileL_1, dbFileL_2,paramD):
# def processCline(cline):
# def determineShouldBlast(dbFile1,dbFile2,blastFilePath,blastFileJoinStr):
# def subprocessWrapper(cline):
# def parseBlastFile(blastFN,evalueThresh,alignCoverThresh,percIdentThresh):
#                 L = list(blastCLineT) + ['-query',query,'-db',db,'-out',outFN]
#     L = cline.split('"') # " make emacs happy.
#     L=[]
# 
# Path: xenoGI/genomes.py
# def loadSeq(paramD,fileEnding,genesS=None):
#     def __init__(self, geneInfoFN):
#     def initializeGeneRangeByStrainD(self,geneInfoFN):
#     def initializeStrainGeneRangeT(self):
#     def initializeGeneNumToNameD(self,geneInfoFN,strainNamesL=None):
#     def initializeGeneInfoD(self,geneInfoFN,strainNamesL=None):
#     def loadDictFromGeneInfoFile(self,geneInfoFN,strainNamesL,onlyNames):
#     def numToStrainName(self,geneNum):
#     def numToName(self,geneNumber):
#     def iterGenes(self,strainL=None):
#     def iterGenesStrain(self,strainName):
#     def numToGeneInfo(self,geneNumber):
#     def __len__(self):
#     def __repr__(self):
# def getProximityInWindow(geneWinT,geneProximityD):
# def createGeneProximityD(geneOrderD,geneProximityForGroup):
# def createGeneOrderD(geneOrderFN,strainNamesL):
# class genes:
#         D = {}
#         L=s.split('\t')
# 
# Path: xenoGI/xenoGI.py
# def main():
# def parseGenbankWrapper(paramD):
# def writeStrainInfoFN(strainNamesT,paramD):
# def readStrainInfoFN(strainInfoFN):
# def runBlastWrapper(paramD):
# def loadGenomeRelatedData(paramD):
# def calcScoresWrapper(paramD,blastFnL):
# def makeSpeciesTreeWrapper(paramD):
# def loadTreeRelatedData(speciesTreeFN):
# def makeFamiliesWrapper(paramD):
# def makeIslandsWrapper(paramD):
# def refineWrapper(paramD):
# def printAnalysisWrapper(paramD,speciesTreeFN,rootFocalClade):
# def createIslandBedWrapper(paramD):
# def interactiveAnalysisWrapper(paramD):
#     def printFam(familyNum,familiesO,fileF=sys.stdout):
#     def findGene(searchStr,fileF=sys.stdout):
#     def printLocusIsland(locusIslandNum,synWSize,fileF=sys.stdout):
#     def printLocusIslandsAtNode(node,fileF=sys.stdout):
# def debugWrapper(paramD):
#         L=matchFamilyIsland(genesO,gene2FamIslandD,searchStr)


# Path: misc/getProteinsWithBlastHitsVsMultifasta.py
import sys,os
from xenoGI import parameters,blast,genomes,xenoGI

sys.path.insert(0,os.path.join(sys.path[0],'..'))

# Identifies xenoGI proteins with significant similarity to a provided
# protein multifasta, printing their xenoGI gene names to
# standard out, one per line. Expects to be run in a xenoGI working
# directory.

if __name__ == "__main__":

    paramFN = sys.argv[1]
    strainInfoFN = sys.argv[2] # include as argument so can pass in scaffold only set in xlMode case
    proteinMultiFastaPath = sys.argv[3]


    paramD = parameters.createParametersD(parameters.baseParamStr,paramFN)