def handle(self, *args, **options):
     
     required = ['username', 'title', 'file_name', 'source_column_index', 'data_file_column']
     for arg in required:
         if not options[arg]:
             raise CommandError('%s was not provided.' % arg)
     
     
     parser = SingleFileColumnParser()
     parser.file_permanent = options['data_file_permanent']
     parser.file_column_index = int( options['data_file_column'] )
     parser.source_column_index = [int(x.strip()) for x in options['source_column_index'].split(",")]
     parser.column_index_separator = "/"
     parser.file_base_path = options['base_path']
     
     if options['auxiliary_file_column'] is not None:
         parser.auxiliary_file_column_index = int( options['auxiliary_file_column'] )
     
     if options['species_column'] is not None:
         parser.species_column_index = int( options['species_column'] )
     
     if options['genome_build_column'] is not None:
         parser.genome_build_column_index = int( options['genome_build_column'] )                
     
     if options['annotation_column'] is not None:
         parser.annotation_column_index = int( options['annotation_column'] )                
     
     investigation = parser.run(options['file_name'])
     investigation.title = options['title']
     investigation.save()
     
     create_dataset( investigation.uuid, options['username'], dataset_title=options['title'], slug=options['slug'], public=options['is_public'] )
    def handle(self, *args, **options):

        # set pre-defined options for the Refinery default tabular file format
        options['source_column_index'] = "0"  # source = filename
        options['data_file_column'] = "1"
        options['auxiliary_file_column'] = "2"
        options['species_column'] = "3"
        options['genome_build_column'] = "4"
        options['annotation_column'] = "5"
        options['data_file_permanent'] = True
        required = ['username', 'title', 'file_name']
        for arg in required:
            if not options[arg]:
                raise CommandError('%s was not provided.' % arg)

        parser = SingleFileColumnParser()
        parser.source_column_index = [
            int(x.strip()) for x in options['source_column_index'].split(",")
        ]
        parser.column_index_separator = "/"
        parser.file_base_path = options['base_path']
        # fixed settings
        parser.file_column_index = int(options['data_file_column'])
        parser.auxiliary_file_column_index = int(
            options['auxiliary_file_column'])
        parser.species_column_index = int(options['species_column'])
        parser.genome_build_column_index = int(options['genome_build_column'])
        parser.annotation_column_index = int(options['annotation_column'])
        parser.file_permanent = options['data_file_permanent']
        investigation = parser.run(options['file_name'])
        investigation.title = options['title']
        investigation.save()
        create_dataset(investigation.uuid,
                       options['username'],
                       dataset_title=options['title'],
                       slug=options['slug'],
                       public=options['is_public'])
    def handle(self, *args, **options):

        # set pre-defined options for the Refinery default tabular file format
        options["source_column_index"] = "0"  # source = filename
        options["data_file_column"] = "1"
        options["auxiliary_file_column"] = "2"
        options["species_column"] = "3"
        options["genome_build_column"] = "4"
        options["annotation_column"] = "5"
        options["data_file_permanent"] = True
        required = ["username", "title", "file_name"]
        for arg in required:
            if not options[arg]:
                raise CommandError("%s was not provided." % arg)

        parser = SingleFileColumnParser()
        parser.source_column_index = [int(x.strip()) for x in options["source_column_index"].split(",")]
        parser.column_index_separator = "/"
        parser.file_base_path = options["base_path"]
        # fixed settings
        parser.file_column_index = int(options["data_file_column"])
        parser.auxiliary_file_column_index = int(options["auxiliary_file_column"])
        parser.species_column_index = int(options["species_column"])
        parser.genome_build_column_index = int(options["genome_build_column"])
        parser.annotation_column_index = int(options["annotation_column"])
        parser.file_permanent = options["data_file_permanent"]
        investigation = parser.run(options["file_name"])
        investigation.title = options["title"]
        investigation.save()
        create_dataset(
            investigation.uuid,
            options["username"],
            dataset_title=options["title"],
            slug=options["slug"],
            public=options["is_public"],
        )