changeset 0:64999b5b58fe draft

Uploaded
author greg
date Fri, 10 Feb 2023 17:35:04 +0000
parents
children 52a9e19ae588
files .shed.yml call_amr_mutations.xml macros.xml
diffstat 3 files changed, 63 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.shed.yml	Fri Feb 10 17:35:04 2023 +0000
@@ -0,0 +1,9 @@
+name: call_amr_mutations
+owner: greg
+description: Accepts VarScan mpileup2snps file, filters them, and produces a VCF file.
+long_description: Accepts VarScan mpileup2snps file, filters them, and produces a VCF file.
+categories: 
+- Visualization
+remote_repository_url: https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/pima/call_amr_mutations
+homepage_url: https://github.com/gregvonkuster/galaxy_tools
+type: unrestricted
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/call_amr_mutations.xml	Fri Feb 10 17:35:04 2023 +0000
@@ -0,0 +1,37 @@
+<tool id="call_amr_mutations" name="PIMA: call AMR mutations" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
+    <description></description>
+    <macros>
+        <import>macros.xml</import>
+    </macros>
+    <expand macro="requirements"/>
+    <command detect_errors="exit_code"><![CDATA[
+#import os
+
+#if $os.path.getsize(str($varscan_raw)) > 0:
+    cat '$varscan_raw' | awk '(NR > 1 && $9 == 2 && $5 + $6 >= 15){OFS = "\t";f = $6 / ($5 + $6); gsub(/.*\//, "", $4);s = $4;gsub(/[+\\-]/, "", s);$7 = sprintf("%.2f%%", f * 100);min = 1 / log(length(s) + 2) / log(10) + 2/10;if(f > min){print}}' > varscan_snp &&
+    cat varscan_snp | awk '{OFS = "\t"; print $1,$2,".",$3,$4,-log($14),"PASS",".","GT","1|1"}' > varscan_snp_vcf &&
+    cat varscan_snp_vcf | sort -k 1,1 -k 2n,2n | awk 'BEGIN{OFS = "\t";print "#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tSAMPLE"}{print}' > '$varscan_vcf'
+#end if
+]]></command>
+    <inputs>
+        <param name="varscan_raw" type="data" format="vcf" label="Raw varscan VCF file"/>
+        <param name="mutation_regions" type="data" format="bed" label="AMR mutation regions BED file"/>
+    </inputs>
+    <outputs>
+        <data name="varscan_vcf" format="vcf"/>
+    </outputs>
+    <tests>
+        <test>
+            <param name="varscan_raw" value="varscan_raw.vcf" ftype="vcf"/>
+            <param name="mutation_regions" value="mutation_regions.bed" ftype="bed"/>
+            <output name="varscan_vcf" value="varscan_vcf.vcf" ftype="vcf"/>
+        </test>
+    </tests>
+    <help>
+**What it does**
+
+Accepts VarScan mpileup2snps file, filters them, and produces a VCF file.
+    </help>
+    <expand macro="citations"/>
+</tool>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/macros.xml	Fri Feb 10 17:35:04 2023 +0000
@@ -0,0 +1,17 @@
+<macros>
+    <token name="@TOOL_VERSION@">1.0.0</token>
+    <token name="@VERSION_SUFFIX@">0</token>
+    <token name="@PROFILE@">21.01</token>
+    <xml name="requirements">
+        <requirements>
+            <requirement type="package" version="9.1">coreutils</requirement>
+            <requirement type="package" version="5.1.0">gawk</requirement>
+        </requirements>
+    </xml>
+    <xml name="citations">
+        <citations>
+            <citation type="doi">10.1101/011650</citation>
+        </citations>
+    </xml>
+</macros>
+