Commit 7a429de1 by Eric Coissac

Checks for very old format of seeds

parent 7e7c2f13
......@@ -15,10 +15,37 @@ def getOutput(config):
@param config: a configuration object
@return: the path for the output files
'''
logger = config['orgasm']['logger']
dirname = "%s.oas" % config['orgasm']['outputfilename']
if not os.path.exists(dirname):
os.makedirs(dirname)
if os.path.exists('%s.oax' % config['orgasm']['outputfilename']):
if config['buildgraph']['reformat']:
#
# Reformating outpout according to the new format
#
os.makedirs(dirname)
for extension in ['oax','omx','gml','stats',
'intermediate.gml','.intermediate.oax']:
if os.path.exists('%s.%s' % (config['orgasm']['outputfilename'],
extension)):
os.renames('%s.%s' % (config['orgasm']['outputfilename'],
extension),
'%s.oas/assembling.%s' % (config['orgasm']['outputfilename'],
extension))
sys.exit(0)
else:
#
# Exit with an error because the format is obsolete.
#
logger.error("The %s assembly is not stored according to new format" % config['orgasm']['outputfilename'])
logger.error('Run the oa buildgraph command with the --reformat option')
sys.exit(1)
else:
os.makedirs(dirname)
return "%s/assembling" % dirname
......@@ -120,7 +147,7 @@ def getSeeds(index,config):
forceseeds=config['buildgraph']['forceseeds']
filename="%s.oas/assembling.omx"
filename="%s.oas/assembling.omx" % output
#
# Check if the seeds are not correctly placed in the oas directory
......@@ -154,6 +181,13 @@ def getSeeds(index,config):
probes = pickle.load(fseeds)
logger.info("Load matches from previous run : %d probe sets restored" % len(probes))
if not isinstance(list(probes.values())[0][0], dict):
logger.error("Too old version of probes matches that cannot be reformated")
logger.error("Generate a new probe match set using the command oa seeds --seeds command")
logger.error("The old unsuable seed match has been erased")
os.remove(filename)
sys.exit(1)
oldversion=False
for probename in probes:
s = probes[probename][1]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment