Mercurial > repos > wolma > rnastar_index_builder
annotate data_manager/rna_star_index_builder.py @ 1:6127cd38980b draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_star_index_builder commit 056ae20332ed001ad50a7e733df3595108172c6c-dirty
author | wolma |
---|---|
date | Mon, 24 Jun 2019 11:36:07 -0400 |
parents | |
children | 039890bdcb62 |
rev | line source |
---|---|
1
6127cd38980b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_star_index_builder commit 056ae20332ed001ad50a7e733df3595108172c6c-dirty
wolma
parents:
diff
changeset
|
1 #!/usr/bin/env python |
6127cd38980b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_star_index_builder commit 056ae20332ed001ad50a7e733df3595108172c6c-dirty
wolma
parents:
diff
changeset
|
2 |
6127cd38980b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_star_index_builder commit 056ae20332ed001ad50a7e733df3595108172c6c-dirty
wolma
parents:
diff
changeset
|
3 import argparse |
6127cd38980b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_star_index_builder commit 056ae20332ed001ad50a7e733df3595108172c6c-dirty
wolma
parents:
diff
changeset
|
4 import json |
6127cd38980b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_star_index_builder commit 056ae20332ed001ad50a7e733df3595108172c6c-dirty
wolma
parents:
diff
changeset
|
5 |
6127cd38980b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_star_index_builder commit 056ae20332ed001ad50a7e733df3595108172c6c-dirty
wolma
parents:
diff
changeset
|
6 |
6127cd38980b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_star_index_builder commit 056ae20332ed001ad50a7e733df3595108172c6c-dirty
wolma
parents:
diff
changeset
|
7 def main(): |
6127cd38980b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_star_index_builder commit 056ae20332ed001ad50a7e733df3595108172c6c-dirty
wolma
parents:
diff
changeset
|
8 parser = argparse.ArgumentParser() |
6127cd38980b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_star_index_builder commit 056ae20332ed001ad50a7e733df3595108172c6c-dirty
wolma
parents:
diff
changeset
|
9 parser.add_argument( '--config-file' ) |
6127cd38980b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_star_index_builder commit 056ae20332ed001ad50a7e733df3595108172c6c-dirty
wolma
parents:
diff
changeset
|
10 parser.add_argument( '--value' ) |
6127cd38980b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_star_index_builder commit 056ae20332ed001ad50a7e733df3595108172c6c-dirty
wolma
parents:
diff
changeset
|
11 parser.add_argument( '--dbkey' ) |
6127cd38980b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_star_index_builder commit 056ae20332ed001ad50a7e733df3595108172c6c-dirty
wolma
parents:
diff
changeset
|
12 parser.add_argument( '--name' ) |
6127cd38980b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_star_index_builder commit 056ae20332ed001ad50a7e733df3595108172c6c-dirty
wolma
parents:
diff
changeset
|
13 parser.add_argument( '--subdir' ) |
6127cd38980b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_star_index_builder commit 056ae20332ed001ad50a7e733df3595108172c6c-dirty
wolma
parents:
diff
changeset
|
14 parser.add_argument( '--data-table' ) |
6127cd38980b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_star_index_builder commit 056ae20332ed001ad50a7e733df3595108172c6c-dirty
wolma
parents:
diff
changeset
|
15 parser.add_argument( '--with-gene-model', action='store_true' ) |
6127cd38980b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_star_index_builder commit 056ae20332ed001ad50a7e733df3595108172c6c-dirty
wolma
parents:
diff
changeset
|
16 parser.add_argument( '--index-version' ) |
6127cd38980b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_star_index_builder commit 056ae20332ed001ad50a7e733df3595108172c6c-dirty
wolma
parents:
diff
changeset
|
17 |
6127cd38980b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_star_index_builder commit 056ae20332ed001ad50a7e733df3595108172c6c-dirty
wolma
parents:
diff
changeset
|
18 args = parser.parse_args() |
6127cd38980b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_star_index_builder commit 056ae20332ed001ad50a7e733df3595108172c6c-dirty
wolma
parents:
diff
changeset
|
19 |
6127cd38980b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_star_index_builder commit 056ae20332ed001ad50a7e733df3595108172c6c-dirty
wolma
parents:
diff
changeset
|
20 if args.dbkey in [ None, '', '?' ]: |
6127cd38980b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_star_index_builder commit 056ae20332ed001ad50a7e733df3595108172c6c-dirty
wolma
parents:
diff
changeset
|
21 raise Exception( '"%s" is not a valid dbkey. You must specify a valid dbkey.' % ( args.dbkey ) ) |
6127cd38980b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_star_index_builder commit 056ae20332ed001ad50a7e733df3595108172c6c-dirty
wolma
parents:
diff
changeset
|
22 |
6127cd38980b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_star_index_builder commit 056ae20332ed001ad50a7e733df3595108172c6c-dirty
wolma
parents:
diff
changeset
|
23 with_gene_model = "0" |
6127cd38980b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_star_index_builder commit 056ae20332ed001ad50a7e733df3595108172c6c-dirty
wolma
parents:
diff
changeset
|
24 if args.with_gene_model: |
6127cd38980b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_star_index_builder commit 056ae20332ed001ad50a7e733df3595108172c6c-dirty
wolma
parents:
diff
changeset
|
25 with_gene_model = "1" |
6127cd38980b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_star_index_builder commit 056ae20332ed001ad50a7e733df3595108172c6c-dirty
wolma
parents:
diff
changeset
|
26 |
6127cd38980b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_star_index_builder commit 056ae20332ed001ad50a7e733df3595108172c6c-dirty
wolma
parents:
diff
changeset
|
27 data_manager_dict = {'data_tables': {args.data_table: [dict({"value": args.value, "dbkey": args.dbkey, "name": args.name, "path": args.subdir, "with_gene_model": with_gene_model, "version": args.index_version} )]}} |
6127cd38980b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_star_index_builder commit 056ae20332ed001ad50a7e733df3595108172c6c-dirty
wolma
parents:
diff
changeset
|
28 open( args.config_file, 'w' ).write( json.dumps( data_manager_dict ) ) |
6127cd38980b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_star_index_builder commit 056ae20332ed001ad50a7e733df3595108172c6c-dirty
wolma
parents:
diff
changeset
|
29 |
6127cd38980b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_star_index_builder commit 056ae20332ed001ad50a7e733df3595108172c6c-dirty
wolma
parents:
diff
changeset
|
30 |
6127cd38980b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_star_index_builder commit 056ae20332ed001ad50a7e733df3595108172c6c-dirty
wolma
parents:
diff
changeset
|
31 if __name__ == "__main__": |
6127cd38980b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_star_index_builder commit 056ae20332ed001ad50a7e733df3595108172c6c-dirty
wolma
parents:
diff
changeset
|
32 main() |