# HG changeset patch # User iuc # Date 1630397437 0 # Node ID 1204e79d3a99bdfa7e04fffb68d0f9c9b2967350 # Parent 5330cf818142e580d5d3d17839e86e6bada20456 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/freec commit e0d4688a59e6eeba33adcfe803ac43d0bc2863e7" diff -r 5330cf818142 -r 1204e79d3a99 control_freec.xml --- a/control_freec.xml Thu Aug 13 13:49:44 2020 +0000 +++ b/control_freec.xml Tue Aug 31 08:10:37 2021 +0000 @@ -1,5 +1,8 @@ detects copy-number changes and allelic imbalances + + freec + macros.xml @@ -13,11 +16,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 +49,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 +163,10 @@ int(WGS_WES['advanced_settings']['window_section']['window']) == 0 - + + output_section['circos_data'] + + output_section['circos_data'] diff -r 5330cf818142 -r 1204e79d3a99 macros.xml --- a/macros.xml Thu Aug 13 13:49:44 2020 +0000 +++ b/macros.xml Tue Aug 31 08:10:37 2021 +0000 @@ -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 5330cf818142 -r 1204e79d3a99 ratio2circos.py --- a/ratio2circos.py Thu Aug 13 13:49:44 2020 +0000 +++ b/ratio2circos.py Tue Aug 31 08:10:37 2021 +0000 @@ -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]))