Mercurial > repos > bgruening > cp_export_to_spreadsheet
annotate starting_modules.py @ 6:f24c370e5ea4 draft default tip
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
author | bgruening |
---|---|
date | Sun, 05 Nov 2023 09:35:54 +0000 |
parents | d0178bdcd00e |
children |
rev | line source |
---|---|
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
1 import json |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
2 import sys |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
3 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
4 FOURSPACES = " " |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
5 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
6 input_json_path = sys.argv[1] |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
7 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
8 params = json.load(open(input_json_path, "r")) |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
9 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
10 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
11 def write_images(): |
6
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
12 filter_images = params["images"]["filter_images"] |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
13 |
5
d0178bdcd00e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 7d7a519c3a2cc612d38695b335d0f6c75a099de3"
bgruening
parents:
4
diff
changeset
|
14 _str = "\nImages:[module_num:1|svn_version:\\'Unknown\\'|variable_revision_number:2|show_window:False|notes:\\x5B\\'To begin creating your project, use the Images module to compile a list of files and/or folders that you want to analyze. You can also specify a set of rules to include only the desired files in your selected folders.\\'\\x5D|batch_state:array(\\x5B\\x5D, dtype=uint8)|enabled:True|wants_pause:False]\n" |
4
f8fa0f6718a3
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
3
diff
changeset
|
15 _str += FOURSPACES + ":\n" |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
16 _str += FOURSPACES + "Filter images?:%s\n" % filter_images |
6
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
17 _str += ( |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
18 FOURSPACES |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
19 + 'Select the rule criteria:and (extension does isimage) (directory doesnot startwith ".")\n' |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
20 ) |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
21 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
22 return _str |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
23 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
24 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
25 def write_metadata(): |
6
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
26 metadata_extraction = params["metadata"]["con_metadata_extraction"] |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
27 extract = metadata_extraction["extract"] |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
28 |
6
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
29 if "extraction_method" in metadata_extraction: |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
30 method_count = len(metadata_extraction["extraction_method"]) |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
31 else: |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
32 method_count = 1 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
33 |
5
d0178bdcd00e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 7d7a519c3a2cc612d38695b335d0f6c75a099de3"
bgruening
parents:
4
diff
changeset
|
34 _str = "\nMetadata:[module_num:2|svn_version:\\'Unknown\\'|variable_revision_number:4|show_window:False|notes:\\x5B\\'The Metadata module optionally allows you to extract information describing your images (i.e, metadata) which will be stored along with your measurements. This information can be contained in the file name and/or location, or in an external file.\\'\\x5D|batch_state:array(\\x5B\\x5D, dtype=uint8)|enabled:True|wants_pause:False]\n" |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
35 _str += FOURSPACES + "Extract metadata?:%s\n" % extract |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
36 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
37 if extract == "No": |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
38 _str += FOURSPACES + "Metadata data type:Text\n" |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
39 _str += FOURSPACES + "Metadata types:{}\n" |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
40 _str += FOURSPACES + "Extraction method count:%d\n" % method_count |
6
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
41 _str += ( |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
42 FOURSPACES + "Metadata extraction method:Extract from file/folder names\n" |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
43 ) |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
44 _str += ( |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
45 FOURSPACES |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
46 + "Regular expression to extract from file name:^(?P<Plate>.*)_(?P<Well>\x5BA-P\x5D\x5B0-9\x5D{2})_s(?P<Site>\x5B0-9\x5D)_w(?P<ChannelNumber>\x5B0-9\x5D)\n" |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
47 ) |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
48 _str += ( |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
49 FOURSPACES |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
50 + "Regular expression to extract from folder name:(?P<Date>\x5B0-9\x5D{4}_\x5B0-9\x5D{2}_\x5B0-9\x5D{2})$\n" |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
51 ) |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
52 _str += FOURSPACES + "Extract metadata from:All images\n" |
6
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
53 _str += ( |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
54 FOURSPACES + 'Select the filtering criteria:and (file does contain "")\n' |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
55 ) |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
56 _str += FOURSPACES + "Metadata file location:\n" |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
57 _str += FOURSPACES + "Match file and image metadata:\x5B\x5D\n" |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
58 _str += FOURSPACES + "Use case insensitive matching?:No\n" |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
59 else: |
6
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
60 _str += ( |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
61 FOURSPACES + "Metadata data type:Text\n" |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
62 ) # default Text,not possible to select in Galaxy |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
63 _str += FOURSPACES + "Metadata types:{}\n" |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
64 _str += FOURSPACES + "Extraction method count:%d\n" % method_count |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
65 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
66 for methods in metadata_extraction["extraction_method"]: |
6
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
67 _str += ( |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
68 FOURSPACES |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
69 + "Metadata extraction method:%s\n" |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
70 % methods["metadata_extraction_method"] |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
71 ) |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
72 _str += ( |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
73 FOURSPACES |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
74 + "Metadata source:%s\n" |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
75 % methods["con_metadata_source"]["metadata_source"] |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
76 ) |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
77 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
78 if "file_name_regex" in methods["con_metadata_source"]: |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
79 file_regex = methods["con_metadata_source"]["file_name_regex"] |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
80 folder_regex = "(?P<folderField1>.*)" |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
81 elif "folder_name_regex" in methods["con_metadata_source"]: |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
82 file_regex = "(?P<field1>.*)_(?P<field2>[a-zA-Z0-9]+)" |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
83 folder_regex = methods["con_metadata_source"]["folder_name_regex"] |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
84 else: |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
85 # default regex |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
86 file_regex = "(?P<field1>.*)_(?P<field2>[a-zA-Z0-9]+)" |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
87 folder_regex = "(?P<folderField1>.*)" |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
88 |
6
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
89 _str += ( |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
90 FOURSPACES |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
91 + "Regular expression to extract from file name:%s\n" % file_regex |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
92 ) |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
93 _str += ( |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
94 FOURSPACES |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
95 + "Regular expression to extract from folder name:%s\n" % folder_regex |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
96 ) |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
97 |
6
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
98 _str += ( |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
99 FOURSPACES |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
100 + "Extract metadata from:%s\n" |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
101 % methods["con_metadata_extract_from"]["extract_metadata_from"] |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
102 ) |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
103 |
6
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
104 if ( |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
105 methods["con_metadata_extract_from"]["extract_metadata_from"] |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
106 == "Images matching a rule" |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
107 ): |
4
f8fa0f6718a3
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
3
diff
changeset
|
108 rule_str = "" |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
109 for r in methods["con_metadata_extract_from"]["r_match"]: |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
110 if r["con_match"]["rule_type"] == "extension": |
6
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
111 rule_str += ( |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
112 " (" |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
113 + r["con_match"]["rule_type"] |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
114 + " " |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
115 + r["con_match"]["operator"] |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
116 + " " |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
117 + r["con_match"]["match_type"] |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
118 + ")" |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
119 ) |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
120 else: |
6
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
121 rule_str += ( |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
122 " (" |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
123 + r["con_match"]["rule_type"] |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
124 + " " |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
125 + r["con_match"]["operator"] |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
126 + " " |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
127 + r["con_match"]["contain"] |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
128 + ' "' |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
129 + r["con_match"]["match_value"] |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
130 + '")' |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
131 ) |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
132 |
6
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
133 _str += ( |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
134 FOURSPACES |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
135 + "Select the filtering criteria:" |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
136 + methods["con_metadata_extract_from"]["match_all_any"] |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
137 + rule_str |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
138 + "\n" |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
139 ) |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
140 else: |
6
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
141 _str += ( |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
142 FOURSPACES |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
143 + 'Select the filtering criteria:and (file does contain "")\n' |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
144 ) # this line is required even if it's not used |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
145 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
146 _str += FOURSPACES + "Metadata file location:\n" |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
147 _str += FOURSPACES + "Match file and image metadata:\x5B\x5D\n" |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
148 _str += FOURSPACES + "Use case insensitive matching?:No\n" |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
149 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
150 return _str |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
151 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
152 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
153 def write_nameandtypes(): |
6
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
154 nameandtypes = params["nameandtypes"] |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
155 assign_a_name = nameandtypes["con_assign_a_name_to"]["assign_a_name_to"] |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
156 |
6
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
157 if "con_select_image_type" in nameandtypes["con_assign_a_name_to"]: |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
158 con_set_intensity = nameandtypes["con_assign_a_name_to"][ |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
159 "con_select_image_type" |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
160 ]["con_set_intensity"] |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
161 max_intensity = ( |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
162 con_set_intensity["maximum_intensity"] |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
163 if "maximum_intensity" in con_set_intensity |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
164 else 255.0 |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
165 ) |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
166 else: |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
167 max_intensity = 255.0 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
168 |
6
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
169 pixel_space = nameandtypes["pixel_space"] |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
170 |
6
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
171 rule_count = ( |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
172 len(nameandtypes["con_assign_a_name_to"]["r_match_rule"]) |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
173 if "r_match_rule" in nameandtypes["con_assign_a_name_to"] |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
174 else 1 |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
175 ) |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
176 |
6
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
177 process_3d = nameandtypes["pixel_space"]["process_3d"] |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
178 x_spacing = 1.0 if "x_spacing" not in pixel_space else pixel_space["x_spacing"] |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
179 y_spacing = 1.0 if "y_spacing" not in pixel_space else pixel_space["y_spacing"] |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
180 z_spacing = 1.0 if "z_spacing" not in pixel_space else pixel_space["z_spacing"] |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
181 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
182 _str = "\nNamesAndTypes:[module_num:3|svn_version:\\'Unknown\\'|variable_revision_number:8|show_window:False|notes:\\x5B\\'The NamesAndTypes module allows you to assign a meaningful name to each image by which other modules will refer to it.\\'\\x5D|batch_state:array(\\x5B\\x5D, dtype=uint8)|enabled:True|wants_pause:False]\n" |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
183 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
184 _str += FOURSPACES + "Assign a name to:%s\n" % assign_a_name |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
185 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
186 if assign_a_name == "All images": |
6
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
187 _str += ( |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
188 FOURSPACES |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
189 + "Select the image type:%s\n" |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
190 % nameandtypes["con_assign_a_name_to"]["con_select_image_type"][ |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
191 "select_image_type" |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
192 ] |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
193 ) |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
194 _str += ( |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
195 FOURSPACES |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
196 + "Name to assign these images:%s\n" |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
197 % nameandtypes["con_assign_a_name_to"]["name_to_assign"] |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
198 ) |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
199 _str += FOURSPACES + "Match metadata:[]\n" |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
200 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
201 _str += FOURSPACES + "Image set matching method:Order\n" |
6
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
202 _str += ( |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
203 FOURSPACES |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
204 + "Set intensity range from:%s\n" |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
205 % con_set_intensity["set_intensity_range_from"] |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
206 ) |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
207 _str += FOURSPACES + "Assignments count:%s\n" % rule_count |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
208 _str += FOURSPACES + "Single images count:0\n" |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
209 _str += FOURSPACES + "Maximum intensity:%.1f\n" % max_intensity |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
210 _str += FOURSPACES + "Process as 3D?:%s\n" % process_3d |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
211 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
212 else: |
4
f8fa0f6718a3
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
3
diff
changeset
|
213 # the below lines are not relevant to "images matching rules", but needed in pipeline file |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
214 _str += FOURSPACES + "Select the image type:Grayscale image\n" |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
215 _str += FOURSPACES + "Name to assign these images:DNA\n" |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
216 _str += FOURSPACES + "Match metadata:[]\n" |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
217 |
6
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
218 _str += ( |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
219 FOURSPACES |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
220 + "Image set matching method:%s\n" |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
221 % nameandtypes["con_assign_a_name_to"]["matching_method"] |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
222 ) |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
223 _str += FOURSPACES + "Set intensity range from:Image metadata\n" |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
224 _str += FOURSPACES + "Assignments count:%d\n" % rule_count |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
225 _str += FOURSPACES + "Single images count:0\n" |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
226 _str += FOURSPACES + "Maximum intensity:%.1f\n" % max_intensity |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
227 _str += FOURSPACES + "Process as 3D?:%s\n" % process_3d |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
228 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
229 _str += FOURSPACES + "Relative pixel spacing in X:%.1f\n" % x_spacing |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
230 _str += FOURSPACES + "Relative pixel spacing in Y:%.1f\n" % y_spacing |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
231 _str += FOURSPACES + "Relative pixel spacing in Z:%.1f\n" % z_spacing |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
232 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
233 if assign_a_name == "Images matching rules": |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
234 for rule in nameandtypes["con_assign_a_name_to"]["r_match_rule"]: |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
235 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
236 rule_str = "" |
4
f8fa0f6718a3
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
3
diff
changeset
|
237 if len(rule["r_match"]) > 0: |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
238 for r in rule["r_match"]: |
6
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
239 if ( |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
240 r["con_match"]["rule_type"] == "file" |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
241 or r["con_match"]["rule_type"] == "directory" |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
242 ): |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
243 rule_str += ( |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
244 " (" |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
245 + r["con_match"]["rule_type"] |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
246 + " " |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
247 + r["con_match"]["operator"] |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
248 + " " |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
249 + r["con_match"]["contain"] |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
250 + ' "' |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
251 + r["con_match"]["match_value"] |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
252 + '")' |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
253 ) |
4
f8fa0f6718a3
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
3
diff
changeset
|
254 else: |
6
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
255 rule_str += ( |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
256 " (" |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
257 + r["con_match"]["rule_type"] |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
258 + " " |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
259 + r["con_match"]["operator"] |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
260 + " " |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
261 + r["con_match"]["match_type"] |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
262 + ")" |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
263 ) |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
264 else: |
6
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
265 rule_str = ' (file does contain "")' # need to have a value even if it is not used |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
266 |
6
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
267 _str += ( |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
268 FOURSPACES |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
269 + "Select the rule criteria:" |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
270 + rule["match_all_any"] |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
271 + rule_str |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
272 + "\n" |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
273 ) |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
274 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
275 img_or_obj = rule["con_select_image_type"]["select_image_type"] |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
276 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
277 if img_or_obj == "Objects": |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
278 _str += FOURSPACES + "Name to assign these images:DNA\n" |
6
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
279 _str += ( |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
280 FOURSPACES |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
281 + "Name to assign these objects:%s\n" |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
282 % rule["con_select_image_type"]["name_to_assign"] |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
283 ) |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
284 else: |
6
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
285 _str += ( |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
286 FOURSPACES |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
287 + "Name to assign these images:%s\n" |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
288 % rule["con_select_image_type"]["name_to_assign"] |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
289 ) |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
290 _str += FOURSPACES + "Name to assign these objects:Cell\n" |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
291 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
292 _str += FOURSPACES + "Select the image type:%s\n" % img_or_obj |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
293 |
4
f8fa0f6718a3
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
3
diff
changeset
|
294 intensity_range = "Image metadata" # default value |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
295 if img_or_obj == "Grayscale image" or img_or_obj == "Color image": |
6
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
296 intensity_range = rule["con_select_image_type"]["con_set_intensity"][ |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
297 "set_intensity_range_from" |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
298 ] |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
299 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
300 _str += FOURSPACES + "Set intensity range from:%s\n" % intensity_range |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
301 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
302 if intensity_range == "Manual": |
6
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
303 _str += ( |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
304 FOURSPACES |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
305 + "Maximum intensity:%s\n" |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
306 % rule["con_select_image_type"]["con_set_intensity"][ |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
307 "maximum_intensity" |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
308 ] |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
309 ) |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
310 else: |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
311 _str += FOURSPACES + "Maximum intensity:255.0\n" |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
312 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
313 return _str |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
314 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
315 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
316 def write_groups(): |
6
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
317 groups = params["groups"] |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
318 |
6
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
319 _str = "\nGroups:[module_num:4|svn_version:\\'Unknown\\'|variable_revision_number:2|show_window:False|notes:\\x5B\\'The Groups module optionally allows you to split your list of images into image subsets (groups) which will be processed independently of each other. Examples of groupings include screening batches, microtiter plates, time-lapse movies, etc.\\'\\x5D|batch_state:array(\\x5B\\x5D, dtype=uint8)|enabled:True|wants_pause:False]\n" |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
320 |
4
f8fa0f6718a3
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
3
diff
changeset
|
321 group_images = groups["con_groups"]["group_images"] |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
322 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
323 _str += FOURSPACES + "Do you want to group your images?:%s\n" % group_images |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
324 _str += FOURSPACES + "grouping metadata count:1\n" |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
325 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
326 if group_images == "Yes": |
6
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
327 _str += ( |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
328 FOURSPACES |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
329 + "Metadata category:%s\n" % groups["con_groups"]["group_category"] |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
330 ) |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
331 else: |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
332 _str += FOURSPACES + "Metadata category:None\n" |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
333 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
334 return _str |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
335 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
336 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
337 with open("output.cppipe", "w") as f: |
6
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
338 headers = [ |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
339 "CellProfiler Pipeline: http://www.cellprofiler.org\n", |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
340 "Version:3\n", |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
341 "DateRevision:319\n", |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
342 "GitHash:\n", |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
343 "ModuleCount:4\n", |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
344 "HasImagePlaneDetails:False", |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
345 "\n", |
f24c370e5ea4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
5
diff
changeset
|
346 ] |
3
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
347 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
348 f.writelines(headers) |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
349 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
350 img_str = write_images() |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
351 metadata_str = write_metadata() |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
352 nameandtypes_str = write_nameandtypes() |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
353 groups_str = write_groups() |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
354 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
355 output_str = img_str + metadata_str + nameandtypes_str + groups_str |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
356 |
72a7f23f3a79
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
bgruening
parents:
diff
changeset
|
357 f.write(output_str) |
4
f8fa0f6718a3
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
3
diff
changeset
|
358 f.close() |