Mercurial > repos > greg > call_amr_mutations
comparison call_amr_mutations.xml @ 3:30b17a17c1aa draft
Uploaded
author | greg |
---|---|
date | Tue, 21 Mar 2023 19:26:55 +0000 |
parents | a2fe87395f74 |
children | 2774bdf30122 |
comparison
equal
deleted
inserted
replaced
2:a2fe87395f74 | 3:30b17a17c1aa |
---|---|
3 <macros> | 3 <macros> |
4 <import>macros.xml</import> | 4 <import>macros.xml</import> |
5 </macros> | 5 </macros> |
6 <expand macro="requirements"/> | 6 <expand macro="requirements"/> |
7 <command detect_errors="exit_code"><![CDATA[ | 7 <command detect_errors="exit_code"><![CDATA[ |
8 #import os | 8 ## NOTE: This tool provides the functionality of the PIMA filter_varsacn() |
9 ## function here https://github.com/appliedbinf/pima_md/blob/main/pima.py#L3012 | |
9 | 10 |
10 #if $os.path.getsize(str($varscan_raw)) > 0: | 11 python '$__tool_directory__/filter_varscan.py' |
11 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 && | 12 --varscan_raw '$varscan_raw' |
12 cat varscan_snp | awk '{OFS = "\t"; print $1,$2,".",$3,$4,-log($14),"PASS",".","GT","1|1"}' > snp_vcf && | 13 --output '$output' |
13 cat 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' | |
14 #end if | |
15 ]]></command> | 14 ]]></command> |
16 <inputs> | 15 <inputs> |
17 <param name="varscan_raw" type="data" format="vcf" label="Raw varscan VCF file"/> | 16 <param name="varscan_raw" type="data" format="vcf" label="Raw varscan VCF file"/> |
18 <param name="mutation_regions" type="data" format="bed" label="AMR mutation regions BED file"/> | |
19 </inputs> | 17 </inputs> |
20 <outputs> | 18 <outputs> |
21 <data name="varscan_vcf" format="vcf"/> | 19 <data name="output" format="vcf"/> |
22 </outputs> | 20 </outputs> |
23 <tests> | 21 <tests> |
24 <test> | 22 <test> |
25 <param name="varscan_raw" value="input1.vcf" ftype="vcf"/> | 23 <param name="varscan_raw" value="input.vcf" ftype="vcf"/> |
26 <param name="mutation_regions" value="mutation_regions.bed" ftype="bed"/> | 24 <output name="output" value="output.vcf" ftype="vcf"/> |
27 <output name="varscan_vcf" value="output1.vcf" ftype="vcf"/> | |
28 </test> | 25 </test> |
29 </tests> | 26 </tests> |
30 <help> | 27 <help> |
31 **What it does** | 28 **What it does** |
32 | 29 |
33 Accepts VarScan mpileup2snps file, filters them, and produces a VCF file. | 30 Accepts VarScan mpileup2snps VCF file, filters it, and produces a filtered VCF file. |
34 </help> | 31 </help> |
35 <expand macro="citations"/> | 32 <expand macro="citations"/> |
36 </tool> | 33 </tool> |
37 |