# HG changeset patch # User iuc # Date 1597755165 14400 # Node ID 2c6349fb175cfb99967f9aab8aceb00d488b2c7c # Parent e46944a59b3155619e3af86c9d33488536523af0 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/freec commit a8b671c0a0d277296751dd2ae403603bea1c58dd" diff -r e46944a59b31 -r 2c6349fb175c control_freec.xml --- a/control_freec.xml Thu Aug 13 09:50:35 2020 -0400 +++ b/control_freec.xml Tue Aug 18 08:52:45 2020 -0400 @@ -13,11 +13,15 @@ samtools faidx ./genome.fa 2>&1 || echo 'Error running samtools faidx for indexing fasta reference for control-freec' >&2 && #else ln -s '$reference_source.ref.fields.path' ./genome.fa && - ln -s '${reference_source.ref.fields.path}.fai' ./genome.fa.fai && + cp '${reference_source.ref.fields.path}.fai' ./genome.fa.fai && #end if #if int($WGS_WES.advanced_settings.window_section.window) == 0 ln -s '$WGS_WES.input_capture_file' ./capture.bed && + + cat ./capture.bed | cut -f 1 | sort | uniq > ./capture.bed_tmp && + cp ./genome.fa.fai ./genome.fa.fai_tmp && + awk 'NR==FNR{A[$1];next}($1 in A)' ./capture.bed_tmp ./genome.fa.fai_tmp > ./genome.fa.fai && #end if mkdir ./chromosomes && @@ -42,10 +46,7 @@ #end if #if $output_section.circos_data - && python '$__tool_directory__/ratio2circos.py' - -i ./output/sample.bam_ratio.BedGraph - -p '$WGS_WES.advanced_settings.ploidy' - -o sample.bam_ratio_log2_circos.txt + && python '$__tool_directory__/ratio2circos.py' '$WGS_WES.advanced_settings.ploidy' #end if ]]> @@ -159,7 +160,10 @@ int(WGS_WES['advanced_settings']['window_section']['window']) == 0 - + + output_section['circos_data'] + + output_section['circos_data'] diff -r e46944a59b31 -r 2c6349fb175c macros.xml --- a/macros.xml Thu Aug 13 09:50:35 2020 -0400 +++ b/macros.xml Tue Aug 18 08:52:45 2020 -0400 @@ -1,5 +1,5 @@ - @TOOL_VERSION@+galaxy0 + @TOOL_VERSION@+galaxy1 11.6 @@ -40,6 +40,8 @@ + + @@ -61,6 +63,8 @@ + + @@ -82,6 +86,8 @@ + + @@ -105,9 +111,7 @@ - - diff -r e46944a59b31 -r 2c6349fb175c ratio2circos.py --- a/ratio2circos.py Thu Aug 13 09:50:35 2020 -0400 +++ b/ratio2circos.py Tue Aug 18 08:52:45 2020 -0400 @@ -1,20 +1,18 @@ -import argparse import math -import os +import sys -parser = argparse.ArgumentParser() -parser.add_argument('-i', '--input', required=True, default='./output/sample.bam_ratio.BedGraph', type=str) -parser.add_argument('-o', '--output', required=True, default='./output/sample.bam_ratio_log2_circos.txt', type=str) -parser.add_argument('-p', '--ploidy', required=True, default=2, type=int) -args = parser.parse_args() +ploidy = int(sys.argv[1]) -path = os.path.dirname(args.input) -output = os.path.join(path, args.output) +with open("./output/sample.bam_ratio.BedGraph") as bed: + with open("./output/sample.bam_ratio_log2_circos.txt", "w+") as olog2r: + for line in bed.readlines(): + ls = line.split() + if ls[0] != "track" and float(ls[3]) > 0: + log2_ratio = math.log2(float(ls[3]) / ploidy) + olog2r.write("{}\t{}\t{}\t{}\n".format(ls[0], ls[1], ls[2], log2_ratio)) -with open(args.input) as file: - for line in file.readlines(): - ls = line.split() - if ls[0] != "track" and float(ls[3]) > 0: - log2_ratio = math.log2(float(ls[3]) / args.ploidy) - with open(output, "a") as out: - out.write("{}\t{}\t{}\t{}\n".format(ls[0], ls[1], ls[2], log2_ratio)) +with open("./genome.fa.fai") as fai: + with open("./output/karyotype_circos.txt", "w+") as ochr: + for line in fai.readlines(): + ls = line.split() + ochr.write("chr - {}\t{}\t0\t{}\t{}\n".format(ls[0], ls[0].strip("chr").lower(), ls[1], ls[0]))