Commit b058c529 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

No commit message

No commit message
parent 7aa67bad
......@@ -56,22 +56,26 @@ if __name__ == '__main__':
(options, args) = parser.parse_args()
if options.input and options.output_iter_list :
shared_file = open(options.input, "r").readlines()[0].strip()
oif = open(options.output_iter_list, "w")
oif.write("$;I_FILE_BASE$;\t$;I_FILE_NAME$;\t$;I_FILE_PATH$;\t$;I_FILE_EXT$;\t$;I_DIR$;\t$;GROUPS$;\n")
if os.path.isfile(shared_file):
samples = []
for line in open(shared_file, "r").readlines():
if not line.startswith("label"):
line = line.strip()
parts = line.split()
if os.path.splitext(parts[1])[0] not in samples:
samples.append(os.path.splitext(parts[1])[0])
samples = Set(samples)
list = getSizesUniqueCombinaison(samples)
for gr in list:
if len(gr) > 1 and len(gr) <= int(options.max_group_size):
oif.write(os.path.splitext(os.path.basename(shared_file))[0] + "\t"+ os.path.basename(shared_file) + "\t" + shared_file + "\t" + os.path.splitext(os.path.basename(shared_file))[1] + "\t" + os.path.dirname(shared_file) + "\t" + "-".join(gr) + "\n")
try:
shared_file = open(options.input, "r").readlines()[0].strip()
if os.path.isfile(shared_file):
samples = []
for line in open(shared_file, "r").readlines():
if not line.startswith("label"):
line = line.strip()
parts = line.split()
if os.path.splitext(parts[1])[0] not in samples:
samples.append(os.path.splitext(parts[1])[0])
samples = Set(samples)
list = getSizesUniqueCombinaison(samples)
for gr in list:
if len(gr) > 1 and len(gr) <= int(options.max_group_size):
oif.write(os.path.splitext(os.path.basename(shared_file))[0] + "\t"+ os.path.basename(shared_file) + "\t" + shared_file + "\t" + os.path.splitext(os.path.basename(shared_file))[1] + "\t" + os.path.dirname(shared_file) + "\t" + "-".join(gr) + "\n")
except:
pass
oif.close()
else :
parser.print_help()
sys.exit(1)
......@@ -61,7 +61,7 @@
<executable>python $;BIN_DIR$;/create_mothur_group_iterator.py</executable>
<arg>--input-file=$;OUTPUT_DIRECTORY$;/shared.list -max-group-size="4" --output-iter-list=$;OUTPUT_DIRECTORY$;/otu_group_iterator.list</arg>
</command>
<INCLUDE file="$;DOCS_DIR$;/iterator_template.xml" keys="$;ITERATOR_NAME$;=ITERATOR2,$;ITERATOR_XML$;=ITERATOR2_XML,$;ITERATOR_LIST$;=$;OUTPUT_DIRECTORY$;/final_otu_group_iterator.list"/>
<INCLUDE file="$;DOCS_DIR$;/iterator_template.xml" keys="$;ITERATOR_NAME$;=ITERATOR2,$;ITERATOR_XML$;=ITERATOR2_XML,$;ITERATOR_LIST$;=$;OUTPUT_DIRECTORY$;/otu_group_iterator.list"/>
<command>
<type>RunUnixCommand</type>
<name>create svg list</name>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment