def checkPangenomeFormerGraph(pangenome, force): """ checks pangenome status and .h5 files for former neighbors graph, delete it if allowed or raise an error """ if pangenome.status["neighborsGraph"] == "inFile" and force == False: raise Exception( "You are trying to make a neighbors graph that is already built. If you REALLY want to do that, use --force (it will erase everything except annotation data !)" ) elif pangenome.status["neighborsGraph"] == "inFile" and force == True: ErasePangenome(pangenome, graph=True)
def checkPangenomeFormerRGP(pangenome, force): """ checks pangenome status and .h5 files for former rgp, delete them if allowed or raise an error """ if pangenome.status["predictedRGP"] == "inFile" and force == False: raise Exception( "You are trying to predict RGPs in a pangenome that already have them predicted. If you REALLY want to do that, use --force (it will erase RGPs and every feature computed from them)." ) elif pangenome.status["predictedRGP"] == "inFile" and force == True: ErasePangenome(pangenome, rgp=True)
def checkPangenomeFormerSpots(pangenome, force): """ checks pangenome status and .h5 files for former spots, delete them if allowed or raise an error """ if pangenome.status["spots"] == "inFile" and force == False: raise Exception( "You are trying to detect spots on a pangenome which already has predicted spots. If you REALLY want to do that, use --force (it will erase spots previously predicted)." ) elif pangenome.status["spots"] == "inFile" and force == True: ErasePangenome(pangenome, spots=True)
def checkPangenomeFormerClustering(pangenome, force): """ checks pangenome status and .h5 files for former clusterings, delete them if allowed or raise an error """ if pangenome.status["genesClustered"] == "inFile" and force == False: raise Exception( "You are trying to cluster genes that are already clustered together. If you REALLY want to do that, use --force (it will erase everything except annotation data in your HDF5 file!)" ) elif pangenome.status["genesClustered"] == "inFile" and force == True: ErasePangenome(pangenome, geneFamilies=True)
def checkPangenomeFormerPartition(pangenome, force): """ checks pangenome status and .h5 files for former partitions, delete them if allowed or raise an error """ if pangenome.status["partitionned"] == "inFile" and not force: raise Exception( "You are trying to partition a pangenome already partitionned." " If you REALLY want to do that, " "use --force (it will erase partitions and every feature computed from them." ) elif pangenome.status["partitionned"] == "inFile" and force: ErasePangenome(pangenome, partition=True)