ApytramNeeds.write_in_file(MafftResult,AliQueryFile) logger.debug("mafft --- %s seconds ---" % (time.time() - start_mafft_time)) # If the -pep option is used, the -q option must be precised if args.query_pep: if not os.path.isfile(args.query_pep): logger.error(args.query_pep+" (-pep) is not a file.") end(1) if not args.query: logger.error("-pep option must be accompanied of the query in nucleotide format (-q option)") end(1) #Get the available free space of the tmp dir FreeSpaceTmpDir = ApytramNeeds.get_free_space(TmpDirName) logger.debug("%s free space in %s" %(FreeSpaceTmpDir,TmpDirName)) ### Check that there is a database, otherwise build it DatabaseName = args.database CheckDatabase_BlastdbcmdProcess = BlastPlus.Blastdbcmd(DatabaseName, "", "") if not CheckDatabase_BlastdbcmdProcess.is_database(): logger.info("Database %s does not exist" % DatabaseName) DatabaseDirName = os.path.dirname(DatabaseName) if os.path.isdir(DatabaseDirName) or not DatabaseDirName : logger.info("Database directory exists") else: logger.info("Database directory does not exist, we create it") os.makedirs(DatabaseDirName)