# Path: xenoGI/parameters.py
# def createParametersD(baseParamStr,paramFN):
# def addParametersToD(paramL,paramD):
# def loadFileNameMapD(fileNameMapFN,genbankFileList=None):
# 
# Path: xenoGI/trees.py
# def prepareTree(bpTree,outGroupTaxaL):
# def rootTree(bpTree,outGroupTaxaL):
# def makeRootBifurcation(bpTree,outGroupTaxaL):
# def tipsInOutgroupL(clade,outGroupTaxaL):
# def cladeTipNames(clade):
# def nameInternalNodes(bpTree,nameStem):
# def makeSpeciesTree(paramD,aabrhHardCoreL,genesO):
# def makeGeneFamilyTrees(paramD,genesO,familiesO,gtFileStem = 'fam'):
# def makeGeneTrees(paramD,strainHeader,genesO,workDir,gtFileStem,orthoTL):
# def makeOneGeneTreeGroup(argT):
# def makeOneGeneTree(orthoGroupNumStr,orthoT,strainHeader,genesO,protSeqD,dnaSeqD,workDir,gtFileStem,musclePath,fastTreePath):
# def alignOneOrthoT(orthoT,strainHeader,musclePath,inProtFN,outAlignFN,protSeqD,dnaSeqD,genesO):
# def writeFasta(inProtFN,orthoT,strainHeader,genesO,seqD):
# def backAlign(outAlignFN,protAlignL,dnaSeqD,genesO):
# def fixSeq(sequence, protAlignment):
#     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/scores.py
# def calcRawScores(paramD,scoresO):
# def rawScoreGroup(argT):
# def rawScore(s1,s2,gapOpen, gapExtend, matrix):
# def calcSynScores(scoresO,geneOrderD,paramD):
# def createNeighborD(geneOrderD,synWSize):
# def synScoreGroupInit(rawScoreAr,hasEdgeAr,hashAr,lenOfRegionAr,colGn1Ar,colGn2Ar,colEdgeAr,hashArrayLen):
# def synScoreGroup(argsT):
# def synScore(sharedScoresO,gn1,gn2,neighborTD,numSynToTake):
# def topScore(L1,L2,sharedScoresO):
# def createAabrhL(blastFilePath,strainNamesL,evalueThresh,alignCoverThresh,percIdentThresh,aabrhFN):
# def loadOrthos(aabrhFN):
# def getAllReciprocalHits(blastDir,strainNamesL,evalueThresh,alignCoverThresh,percIdentThresh):
# def getReciprocalHits(strainName1,strainName2,blastDir,evalueThresh,alignCoverThresh,percIdentThresh):
# def getHits(fileName, evalueThresh,alignCoverThresh,percIdentThresh):
# def getPossibleGenesD(rHitsL):
# def getAllAroundBRHL(possibleGenesD, rHitsL):
# def calcCoreSynScores(scoresO,strainNamesL,paramD,geneOrderD):
# def createGeneToAabrhD(aabrhHardCoreL):
# def createCoreSyntenyD(geneToAabrhD,geneOrderD,coreSynWsize):
# def getAabrhContext(pos,aabrhNumT,coreSynWsize):
# def iterateGeneAabrhPairsOnContig(geneToAabrhD,geneOrderD):
# def convertGeneToAabrhTuple(geneNumT,geneToAabrhD):
# def coreSynScore(synT1,synT2):
# def plotScoreHists(paramD):
#     def scoreHists(outFN,scoresO,numBins,scoreType,genesO,aabrhHardCoreL=None):
# def getScoresStrainPair(scoresO,strainPair,scoreType,genesO,aabrhHardCoreL):
# def getGenesFromStrainT(geneT,strainT,genesO):
# def writeScores(scoresO,strainNamesT,scoresFN,genesO=None,geneInfoFN=None):
# def readScores(strainNamesT,scoresFN):
#                 L = list(geneNumT[st:end])
#     L1 = list(neighborTD[gn1])
#     L2 = list(neighborTD[gn2])
#         L=s.rstrip().split('\t')


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


if __name__ == "__main__":

    paramFN=sys.argv[1]
    dnaOrProt = sys.argv[2]
    orthosFN = sys.argv[3]
    alignDirName = sys.argv[4]


# Path: xenoGI/parameters.py
# def createParametersD(baseParamStr,paramFN):
# def addParametersToD(paramL,paramD):
# def loadFileNameMapD(fileNameMapFN,genbankFileList=None):
# 
# Path: xenoGI/trees.py
# def prepareTree(bpTree,outGroupTaxaL):
# def rootTree(bpTree,outGroupTaxaL):
# def makeRootBifurcation(bpTree,outGroupTaxaL):
# def tipsInOutgroupL(clade,outGroupTaxaL):
# def cladeTipNames(clade):
# def nameInternalNodes(bpTree,nameStem):
# def makeSpeciesTree(paramD,aabrhHardCoreL,genesO):
# def makeGeneFamilyTrees(paramD,genesO,familiesO,gtFileStem = 'fam'):
# def makeGeneTrees(paramD,strainHeader,genesO,workDir,gtFileStem,orthoTL):
# def makeOneGeneTreeGroup(argT):
# def makeOneGeneTree(orthoGroupNumStr,orthoT,strainHeader,genesO,protSeqD,dnaSeqD,workDir,gtFileStem,musclePath,fastTreePath):
# def alignOneOrthoT(orthoT,strainHeader,musclePath,inProtFN,outAlignFN,protSeqD,dnaSeqD,genesO):
# def writeFasta(inProtFN,orthoT,strainHeader,genesO,seqD):
# def backAlign(outAlignFN,protAlignL,dnaSeqD,genesO):
# def fixSeq(sequence, protAlignment):
#     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/scores.py
# def calcRawScores(paramD,scoresO):
# def rawScoreGroup(argT):
# def rawScore(s1,s2,gapOpen, gapExtend, matrix):
# def calcSynScores(scoresO,geneOrderD,paramD):
# def createNeighborD(geneOrderD,synWSize):
# def synScoreGroupInit(rawScoreAr,hasEdgeAr,hashAr,lenOfRegionAr,colGn1Ar,colGn2Ar,colEdgeAr,hashArrayLen):
# def synScoreGroup(argsT):
# def synScore(sharedScoresO,gn1,gn2,neighborTD,numSynToTake):
# def topScore(L1,L2,sharedScoresO):
# def createAabrhL(blastFilePath,strainNamesL,evalueThresh,alignCoverThresh,percIdentThresh,aabrhFN):
# def loadOrthos(aabrhFN):
# def getAllReciprocalHits(blastDir,strainNamesL,evalueThresh,alignCoverThresh,percIdentThresh):
# def getReciprocalHits(strainName1,strainName2,blastDir,evalueThresh,alignCoverThresh,percIdentThresh):
# def getHits(fileName, evalueThresh,alignCoverThresh,percIdentThresh):
# def getPossibleGenesD(rHitsL):
# def getAllAroundBRHL(possibleGenesD, rHitsL):
# def calcCoreSynScores(scoresO,strainNamesL,paramD,geneOrderD):
# def createGeneToAabrhD(aabrhHardCoreL):
# def createCoreSyntenyD(geneToAabrhD,geneOrderD,coreSynWsize):
# def getAabrhContext(pos,aabrhNumT,coreSynWsize):
# def iterateGeneAabrhPairsOnContig(geneToAabrhD,geneOrderD):
# def convertGeneToAabrhTuple(geneNumT,geneToAabrhD):
# def coreSynScore(synT1,synT2):
# def plotScoreHists(paramD):
#     def scoreHists(outFN,scoresO,numBins,scoreType,genesO,aabrhHardCoreL=None):
# def getScoresStrainPair(scoresO,strainPair,scoreType,genesO,aabrhHardCoreL):
# def getGenesFromStrainT(geneT,strainT,genesO):
# def writeScores(scoresO,strainNamesT,scoresFN,genesO=None,geneInfoFN=None):
# def readScores(strainNamesT,scoresFN):
#                 L = list(geneNumT[st:end])
#     L1 = list(neighborTD[gn1])
#     L2 = list(neighborTD[gn2])
#         L=s.rstrip().split('\t')


# Path: misc/createAlignments.py
import sys,os,glob
from xenoGI import parameters,trees,genomes,scores

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


if __name__ == "__main__":

    paramFN=sys.argv[1]
    dnaOrProt = sys.argv[2]
    orthosFN = sys.argv[3]
    alignDirName = sys.argv[4]


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