示例#1
0
 def test_load(self):
     """envmod.load function loads specified module
     """
     envmod.load('app1')
     self.assertEqual(envmod.loaded(), ['app1'])
     envmod.load('app2')
     self.assertEqual(envmod.loaded(), ['app1', 'app2'])
示例#2
0
 def test_unload_all(self):
     """envmod.unload_all function unloads all modules
     """
     envmod.load('app1', 'app2')
     self.assertEqual(envmod.loaded(), ['app1', 'app2'])
     envmod.unload_all()
     self.assertEqual(envmod.loaded(), [])
 def test_load(self):
     """envmod.load function loads specified module
     """
     envmod.load('app1')
     self.assertEqual(envmod.loaded(),['app1'])
     envmod.load('app2')
     self.assertEqual(envmod.loaded(),['app1','app2'])
 def test_unload_all(self):
     """envmod.unload_all function unloads all modules
     """
     envmod.load('app1','app2')
     self.assertEqual(envmod.loaded(),['app1','app2'])
     envmod.unload_all()
     self.assertEqual(envmod.loaded(),[])
示例#5
0
 def test_unload(self):
     """envmod.unload function unloads specified module
     """
     envmod.load('app1', 'app2')
     loaded = envmod.loaded()
     loaded.sort()
     self.assertEqual(loaded, ['app1', 'app2'])
     envmod.unload('app1')
     loaded = envmod.loaded()
     loaded.sort()
     self.assertEqual(loaded, ['app2'])
 def test_unload(self):
     """envmod.unload function unloads specified module
     """
     envmod.load('app1','app2')
     loaded = envmod.loaded()
     loaded.sort()
     self.assertEqual(loaded,['app1','app2'])
     envmod.unload('app1')
     loaded = envmod.loaded()
     loaded.sort()
     self.assertEqual(loaded,['app2'])
                       "(don't execute them)")
    args = parser.parse_args()
    print "command: %s" % args.command

    # Deal with environment modules
    if args.command in ("mkfastq", "count", "count-atac"):
        modulefiles = args.modulefiles
        if modulefiles is None:
            try:
                modulefiles = __settings.modulefiles['process_10xgenomics']
            except KeyError:
                # No environment modules specified
                pass
        if modulefiles is not None:
            for modulefile in modulefiles.split(','):
                envmod.load(modulefile)

    # Check for underlying programs
    if args.command == "mkfastq":
        required = ["cellranger", "bcl2fastq"]
    elif args.command == "count":
        required = ["cellranger"]
    else:
        required = []
    for prog in required:
        if find_program(prog) is None:
            logger.critical("couldn't find '%s'" % prog)
            sys.exit(1)

    # Run the requested command
    if args.command == "mkfastq":
    # Set up environment modules
    modulefiles = None
    try:
        modulefiles = options.modulefiles
    except AttributeError:
        pass
    if modulefiles is None:
        try:
            modulefiles = __settings.modulefiles[cmd]
        except KeyError:
            # No environment modules specified
            pass
    if modulefiles is not None:
        for modulefile in modulefiles.split(','):
            envmod.load(modulefile)

    # Setup the processing object and run the requested command
    if cmd == 'config':
        if options.init:
            # Create new settings file and reload
            auto_process_ngs.settings.locate_settings_file()
            __settings = auto_process_ngs.settings.Settings()
        if options.key_value or options.new_section:
            if options.new_section is not None:
                # Add new sections
                for new_section in options.new_section:
                    try:
                        new_section = new_section.strip("'").strip('"')
                        print "Adding section '%s'" % new_section
                        __settings.add_section(new_section)