Ejemplo n.º 1
0
def main():
    ######################
    # Parse command line #
    ######################
    args = argumentsParser()
    ##########
    # Logger #
    ##########
    common.parametersLogger(args)
    #############
    # Constants #
    #############
    common.global_dict['dataDirectory'] = '.'
    boxName = common.global_dict['boxName']['GetINSDCFiles']
    common.global_dict.setdefault('files', {}).setdefault(
        boxName,
        {}).setdefault('inputClusteringStep',
                       '{}_correspondences.tsv'.format(args.OutputName))
    common.global_dict.setdefault('files', {}).setdefault(
        boxName,
        {}).setdefault('report',
                       '{}_{}_report.txt'.format(args.OutputName, boxName))
    #######
    # Run #
    #######
    run(args.UniProtACList)
Ejemplo n.º 2
0
def main():
    ######################
    # Parse command line #
    ######################
    args, parser = argumentsParser()
    for key, value in {
            'Identity': args.Identity,
            'Coverage': args.Coverage
    }.items():
        if not (0 < value <= 1):
            parser.error(
                'ValueError: value of --{} option must be a float number according to the condition: 0 < value <= 1'
                .format(key))
    ##########
    # Logger #
    ##########
    common.parametersLogger(args)
    #########################
    # Dependancies checking #
    #########################
    common.dependenciesChecking()
    #############
    # Constants #
    #############
    common.global_dict['dataDirectory'] = '.'
    boxName = common.global_dict['boxName']['ClusteringIntoFamilies']
    common.global_dict.setdefault('files', {}).setdefault(
        boxName,
        {}).setdefault('proteins_2',
                       '{}_proteins_familiesStep.json'.format(args.outputName))
    common.global_dict.setdefault('files', {}).setdefault(
        boxName, {}).setdefault(
            'families', '{}_families.tsv'.format(
                os.path.join(common.global_dict['dataDirectory'], boxName,
                             args.outputName)))
    common.global_dict.setdefault('files', {}).setdefault(
        boxName,
        {}).setdefault('report',
                       '{}_{}_report.txt'.format(args.outputName, boxName))
    #######
    # Run #
    #######
    run(args.FastaFile, args.inputProteins, args.Identity, args.Coverage,
        args.MMseqsAdvancedSettings)
Ejemplo n.º 3
0
def main():
    ######################
    # Parse command line #
    ######################
    args = argumentsParser()
    ##########
    # Logger #
    ##########
    common.parametersLogger(args)
    #############
    # Constants #
    #############
    common.global_dict['dataDirectory'] = '.'
    boxName = common.global_dict['boxName']['SyntenyFinder']
    common.global_dict.setdefault('files',
                                  {}).setdefault(boxName, {}).setdefault(
                                      'nodes',
                                      '{}_nodes.json'.format(args.outputName))
    common.global_dict.setdefault('files',
                                  {}).setdefault(boxName, {}).setdefault(
                                      'edges',
                                      '{}_edges.json'.format(args.outputName))
    common.global_dict.setdefault('files', {}).setdefault(
        boxName,
        {}).setdefault('proteins',
                       '{}_proteins_syntenyStep.json'.format(args.outputName))
    common.global_dict.setdefault('files', {}).setdefault(
        boxName,
        {}).setdefault('report',
                       '{}_{}_report.txt'.format(args.outputName, boxName))
    #######
    # Run #
    #######
    run(args.inputProteins, args.inputTargets, args.WindowSize,
        args.SyntenyGap, args.SyntenyScoreCutoff,
        args.ClusteringAdvancedSettings)
Ejemplo n.º 4
0
def main():
    ######################
    # Parse command line #
    ######################
    args = argumentsParser()
    ##########
    # Logger #
    ##########
    common.parametersLogger(args)
    #########################
    # Dependancies checking #
    #########################
    common.dependenciesChecking()
    #############
    # Constants #
    #############
    common.global_dict['dataDirectory'] = '.'
    boxName = common.global_dict['boxName']['ParseINSDCFiles_GetTaxonomy']
    common.global_dict.setdefault('files', {}).setdefault(boxName, {}).setdefault(
        'faa', '{}.faa'.format(os.path.join(common.global_dict['dataDirectory'], boxName, args.outputName)))
    common.global_dict.setdefault('files', {}).setdefault(boxName, {}).setdefault(
        'organisms_1', '{}_organisms_parsingStep.json'.format(os.path.join(common.global_dict['dataDirectory'], boxName, args.outputName)))
    common.global_dict.setdefault('files', {}).setdefault(boxName, {}).setdefault(
        'organisms_2', '{}_organisms_taxonomyStep.json'.format(args.outputName))
    common.global_dict.setdefault('files', {}).setdefault(boxName, {}).setdefault(
        'proteins_1', '{}_proteins_parsingStep.json'.format(os.path.join(common.global_dict['dataDirectory'], boxName, args.outputName)))
    common.global_dict.setdefault('files', {}).setdefault(boxName, {}).setdefault(
        'targets_1', '{}_targets_parsingStep.json'.format(os.path.join(common.global_dict['dataDirectory'], boxName, args.outputName)))
    common.global_dict.setdefault('files', {}).setdefault(boxName, {}).setdefault(
        'targets_2', '{}_targets_taxonomyStep.json'.format(args.outputName))
    common.global_dict.setdefault('files', {}).setdefault(boxName, {}).setdefault(
        'report', '{}_{}_report.txt'.format(args.outputName, boxName))
    #######
    # Run #
    #######
    run(args.CorrespondencesFile, args.IncludedPseudogenes)
Ejemplo n.º 5
0
def main():
    ######################
    # Parse command line #
    ######################
    args = argumentsParser()
    ##########
    # Logger #
    ##########
    common.parametersLogger(args)
    logger = logging.getLogger('main')
    #########################
    # Dependancies checking #
    #########################
    common.dependenciesChecking()
    ##############
    # Constantes #
    ##############
    args.OutputDirName = args.OutputDirName.strip('/')
    common.constantsInitialization(args.OutputDirName, args.UniProtACList,
                                   args.CorrespondencesFile)
    ORDERBOX = orderDefinition(args.UniProtACList, args.CorrespondencesFile)
    logger.debug('ORDERBOX: {}'.format(ORDERBOX))
    ############
    # Switches #
    ############
    if args.newProject and os.path.isdir(
            common.global_dict['workingDirectory']):
        shutil.rmtree(common.global_dict['workingDirectory'])
    checkSameVersion(common.global_dict['versionFileName'])
    if not os.path.isfile(common.global_dict['settingsFileName']):
        if os.path.isdir(common.global_dict['workingDirectory']):
            logger.error(
                '{} already existing directory and not dedicated to NetSyn project. Please change your project name or use --newProject option'
                .format(common.global_dict['workingDirectory']))
            logger.error(
                'Project name already used. Please change your project name or use --newProject.'
            )
            exit(1)
        '''Pas de dernier setting == premiere analyse'''
        logger.info('New NetSyn project: {}'.format(
            common.global_dict['workingDirectory']))
        os.mkdir(common.global_dict['workingDirectory'])
        os.mkdir(common.global_dict['dataDirectory'])
        analysisNumber, resultsDirectory = getAnalysisNumber(
            args.OutputDirName)
        common.filesNameInitialization(resultsDirectory, args.OutputDirName,
                                       analysisNumber)
        try:
            saveInputFiles(args.UniProtACList, args.CorrespondencesFile)
        except:
            shutil.rmtree(common.global_dict['workingDirectory'])
            exit(1)
        runFromBox = ORDERBOX[0]
        nameBoxToResum = None
        nameBoxDone = None
    else:
        '''Fichier de setting == analyse deja lance'''
        nameBoxToResum = getBoxToResum(args)
        if nameBoxToResum == 'General informations':
            logger.error(
                'Already existing project. Please start a new project')
            exit(1)
        else:
            inputFilesModificationChecking(args.UniProtACList,
                                           args.CorrespondencesFile)
            logger.info('NetSyn project recovery: {}'.format(
                common.global_dict['workingDirectory']))
        nameBoxDone = getLastBoxDone(ORDERBOX)
        runFromBox = resumptionFrom(nameBoxToResum, nameBoxDone, ORDERBOX)
        analysisNumber, resultsDirectory = getAnalysisNumber(
            args.OutputDirName)
        common.filesNameInitialization(resultsDirectory, args.OutputDirName,
                                       analysisNumber)
    createYamlSettingsFile(args, ORDERBOX)
    if runFromBox:
        '''Execution a partir de la boite x'''
        runFromBoxIndex = ORDERBOX.index(runFromBox)
        updateLastBoxDone(ORDERBOX[runFromBoxIndex -
                                   1] if runFromBoxIndex - 1 >= 0 else '')
        logger.debug('Box from which resume: {}'.format(nameBoxToResum))
        logger.debug('Last box done: {}'.format(nameBoxDone))
        logger.debug('Run from: {}'.format(runFromBox))
        writeCurrentVersion(common.global_dict['version'],
                            common.global_dict['versionFileName'])
        boxesManager(runFromBox, resultsDirectory, analysisNumber, ORDERBOX,
                     args)
    else:
        '''Nous avons deja des resultats'''
        logger.debug('Box from which resume: {}'.format(nameBoxToResum))
        logger.debug('Last box done: {}'.format(nameBoxDone))
        logger.debug('Run from: {}'.format(runFromBox))
        logger.info('This analysis already exists')