diff king.xml @ 0:ec2bc87ebd7b draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/king/ commit 7e521e5df8cac36549fed2488034c9d1c4376a3a"
author iuc
date Tue, 16 Nov 2021 20:14:31 +0000
parents
children 1932808c6fab
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/king.xml	Tue Nov 16 20:14:31 2021 +0000
@@ -0,0 +1,328 @@
+<?xml version="1.0" encoding="utf-8"?>
+<tool id="king" name="KING" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@">
+    <description>Kinship-based INference for GWAS</description>
+    <macros>
+        <token name="@TOOL_VERSION@">2.2.4</token>
+        <token name="@VERSION_SUFFIX@">0</token>
+    </macros>
+    <requirements>
+        <requirement type="package" version="@TOOL_VERSION@">king</requirement>
+        <requirement type="package" version="1.6.4">r-kinship2</requirement>
+        <requirement type="package" version="1.2.2">r-igraph</requirement>
+    </requirements>
+    <version_command>
+        king | head -1 | cut -d' ' -f 2
+    </version_command>
+    <command detect_errors="exit_code"><![CDATA[
+    ln -s '$genotype' input.bed &&
+    ln -s '$family' input.fam &&
+    ln -s '$map' input.bim &&
+
+    king -b input.bed --fam input.fam --bim input.bim
+    $related
+    $duplicate
+    $kinship
+    $ibdseg
+    $ibs
+    $homog
+    #if str($degree):
+    --degree $degree
+    #end if
+    #if str($projection):
+    --projection $projection
+    #end if
+    $unrelated
+    $build
+    $cluster
+    $rplot
+
+    > '$kingoutlog'
+    ]]></command>
+    <inputs>
+        <param name="genotype" type="data" format="pbed,binary" label="Binary Genotype File" />
+        <param name="family" type="data" format="lped,txt" label="Family File" />
+        <param name="map" type="data" format="tabular" label="Map File" />
+        <!-- Beginning of the optional paramters -->
+        <param argument="--related" type="boolean" truevalue="--related" falsevalue="" label="Relationship Inference" help="Implements the fastest and integrated relationship inference." />
+        <param argument="--duplicate" type="boolean" truevalue="--duplicate" falsevalue="" label="Duplicate Analysis" help="Implements the fastest (and accurate) algorithm to identify duplicates or MZ twins" />
+        <param argument="--kinship" type="boolean" truevalue="--kinship" falsevalue="" label="Kinship Inference" help="Estimates pair-wise kinship coefficients" />
+        <param argument="--ibdseg" type="boolean" truevalue="--ibdseg" falsevalue="" label="IBD Segment Analysis" help="IBD segment analysis determines all IBD (IBD1 and IBD2) segments shared between relatives" />
+        <param argument="--ibs" type="boolean" truevalue="--ibs" falsevalue="" label="IBS Summary Statistics" help="Counts and average of IBS" />
+        <param argument="--homog" type="boolean" truevalue="--homog" falsevalue="" label="Homogeneous Population" help="Estimates pair-wise kinship coefficients assuming a homogeneous population." />
+        <param argument="--degree" type="integer" min="0" optional="true" label="Degrees of relatedness" help="Filters relative pairs based on kinship coefficients." />
+        <param argument="--projection" type="integer" min="0" optional="true" label="Projection N" help="Includes the first N samples of a subset." />
+        <param argument="--unrelated" type="boolean" truevalue="--unrelated" falsevalue="" label="Unrelated Option" help="Extract a list of unrelated individuals." />
+        <param argument="--build" type="boolean" truevalue="--build" falsevalue="" label="Reconstruct Pedigree" help="Reconstructs pedigrees using SNP data" />
+        <param argument="--cluster" type="boolean" truevalue="--cluster" falsevalue="" label="Cluster Parameter" help="Clusters relatives into families by generating an updateid file." />
+        <param argument="--rplot" type="boolean" truevalue="--rplot" falsevalue="" label="R Code and Plots" help="Generates R code first and then calls R program to make plots in a PDF file." />
+        <param name="use_log" type="boolean" checked="false" label="Output a Log?" />
+    </inputs>
+    <outputs>
+        <data name="kingoutlog" format="txt" label="${tool.name} on ${on_string} : Log" >
+            <filter>use_log == True</filter>
+        </data>
+        <collection name="kingoutput_txt" type="list" label="${tool.name} on ${on_string}: Metrics">
+            <discover_datasets pattern="king(?P&lt;designation&gt;.+)\.txt" format="txt"  />
+        </collection>
+        <collection name="kingoutput_log" type="list" label="${tool.name} on ${on_string}: Metrics Logs" >
+            <filter>use_log == True</filter>
+            <discover_datasets pattern="king(?P&lt;designation&gt;.+)\.log" format="txt" />
+        </collection>
+        <collection name="kingoutput_pdf" type="list" label="${tool.name} on ${on_string}: Plots">
+            <discover_datasets pattern="king_(?P&lt;designation&gt;.+)\.pdf" format="pdf" />
+        </collection>
+    </outputs>
+    <tests>
+        <test>
+            <param name="genotype" value="new.6000.bed"/>
+            <param name="family" value="new.6000.fam"/>
+            <param name="map" value="new.6000.bim"/>
+            <param name="related" value="true" />
+            <param name="use_log" value="true" />
+            <output name="kingoutlog">
+                <assert_contents>
+                    <has_text text="Total length of 6 chromosomal segments usable for IBD segment analysis is"/>
+                    <has_text text="Information of these chromosomal segments can be found in file kingallsegs.txt" />
+                    <has_text text="--related" />
+                    <has_text text="Relationship summary (total relatives: 200 by pedigree, 200 by inference)" />
+                </assert_contents>
+            </output>
+        </test>
+        <test>
+            <param name="genotype" value="new.6000.bed"/>
+            <param name="family" value="new.6000.fam"/>
+            <param name="map" value="new.6000.bim"/>
+            <param name="related" value="true" />
+            <param name="degree" value="2" />
+            <param name="use_log" value="true" />
+            <output name="kingoutlog">
+                <assert_contents>
+                    <has_text text="Total length of 6 chromosomal segments usable for IBD segment analysis is"/>
+                    <has_text text="Information of these chromosomal segments can be found in file kingallsegs.txt" />
+                    <has_text text="--related" />
+                    <has_text text="--degree 2" />
+                    <has_text text="Relationship summary (total relatives: 200 by pedigree, 200 by inference)" />
+                </assert_contents>
+            </output>
+        </test>
+        <test>
+            <param name="genotype" value="new.6000.bed"/>
+            <param name="family" value="new.6000.fam"/>
+            <param name="map" value="new.6000.bim"/>
+            <param name="related" value="true" />
+            <param name="degree" value="2" />
+            <param name="rplot" value="true" />
+            <param name="use_log" value="true" />
+            <output name="kingoutlog">
+                <assert_contents>
+                    <has_text text="Autosome genotypes stored in 94 words for each of 332 individuals."/>
+                    <has_text text="Total length of 6 chromosomal segments usable for IBD segment analysis is" />
+                    <has_text text="--related" />
+                    <has_text text="--degree 2" />
+                    <has_text text="--rplot" />
+                    <has_text text="(with 6000 SNPs): 8 pairs of relatives are detected (with kinship > 0.0625)" />
+                    <has_text text="Relationship summary (total relatives: 0 by pedigree, 6 by inference)" />
+                </assert_contents>
+            </output>
+        </test>
+        <test>
+            <param name="genotype" value="new.6000.bed"/>
+            <param name="family" value="new.6000.fam"/>
+            <param name="map" value="new.6000.bim"/>
+            <param name="duplicate" value="true" />
+            <param name="use_log" value="true" />
+            <output name="kingoutlog">
+                <assert_contents>
+                    <has_text text="Autosome genotypes stored in 94 words for each of 332 individuals."/>
+                    <has_text text="--duplicate" />
+                    <has_text text="No duplicates are found with heterozygote concordance rate > 80%." />
+                </assert_contents>
+            </output>
+        </test>
+        <test>
+            <param name="genotype" value="new.6000.bed"/>
+            <param name="family" value="new.6000.fam"/>
+            <param name="map" value="new.6000.bim"/>
+            <param name="kinship" value="true" />
+            <param name="use_log" value="true" />
+            <output name="kingoutlog">
+                <assert_contents>
+                    <has_text text="Autosome genotypes stored in 94 words for each of 332 individuals."/>
+                    <has_text text="--kinship" />
+                    <has_text text="Relationship summary (total relatives: 200 by pedigree, 200 by inference)" />
+                </assert_contents>
+            </output>
+        </test>
+        <test>
+            <param name="genotype" value="new.6000.bed"/>
+            <param name="family" value="new.6000.fam"/>
+            <param name="map" value="new.6000.bim"/>
+            <param name="related" value="true" />
+            <param name="projection" value="100000" />
+            <param name="use_log" value="true" />
+            <output name="kingoutlog">
+                <assert_contents>
+                    <has_text text="Autosome genotypes stored in 94 words for each of 332 individuals."/>
+                    <has_text text="--related" />
+                    <has_text text="Relationship summary (total relatives: 200 by pedigree, 200 by inference)" />
+                    <has_text text="PLINK pedigrees loaded: 332 samples" />
+                    <has_text text="PLINK maps loaded: 6000 SNPs" />
+                    <has_text text="Autosome genotypes stored in 94 words for each of 332 individuals." />
+                </assert_contents>
+            </output>
+        </test>
+        <test>
+            <param name="genotype" value="new.6000.bed"/>
+            <param name="family" value="new.6000.fam"/>
+            <param name="map" value="new.6000.bim"/>
+            <param name="ibdseg" value="true" />
+            <param name="use_log" value="true" />
+            <output name="kingoutlog">
+                <assert_contents>
+                    <has_text text="--ibdseg" />
+                    <has_text text="Sample pairs without any long IBD segments (>10Mb) are excluded." />
+                    <has_text text="IBD segments saved in a gzipped file king.segments.gz" />
+                    <has_text text="Total length of 6 chromosomal segments usable for IBD segment analysis is" />
+                </assert_contents>
+            </output>
+        </test>
+        <test>
+            <param name="genotype" value="new.6000.bed"/>
+            <param name="family" value="new.6000.fam"/>
+            <param name="map" value="new.6000.bim"/>
+            <param name="ibdseg" value="true" />
+            <param name="degree" value="3" />
+            <param name="rplot" value="true" />
+            <param name="use_log" value="true" />
+            <output name="kingoutlog">
+                <assert_contents>
+                    <has_text text="--ibdseg" />
+                    <has_text text="--rplot" />
+                    <has_text text="--degree 3" />
+                    <has_text text="Summary statistics of IBD segments for individual pairs saved in file king.seg" />
+                    <has_text text="Genotype data consist of 6000 autosome SNPs" />
+                </assert_contents>
+            </output>
+        </test>
+        <test>
+            <param name="genotype" value="new.6000.bed"/>
+            <param name="family" value="new.6000.fam"/>
+            <param name="map" value="new.6000.bim"/>
+            <param name="ibs" value="true" />
+            <param name="use_log" value="true" />
+            <output name="kingoutlog">
+                <assert_contents>
+                    <has_text text="Autosome genotypes stored in 94 words for each of 332 individuals." />
+                    <has_text text="Within-family IBS data saved in file king.ibs" />
+                    <has_text text="--ibs" />
+                    <has_text text="Total length of 6 chromosomal segments usable for IBD segment analysis is" />
+                    <has_text text="Information of these chromosomal segments can be found in file kingallsegs.txt" />
+                    <has_text text="Between-family IBS data saved in file king.ibs0" />
+                    <has_text text="Relationship summary (total relatives: 200 by pedigree, 200 by inference)" />
+                </assert_contents>
+            </output>
+        </test>
+        <test>
+            <param name="genotype" value="new.6000.bed"/>
+            <param name="family" value="new.6000.fam"/>
+            <param name="map" value="new.6000.bim"/>
+            <param name="homog" value="true" />
+            <param name="use_log" value="true" />
+            <output name="kingoutlog">
+                <assert_contents>
+                    <has_text text="Autosome genotypes stored in 375 words for each of 332 individuals." />
+                    <has_text text="--homo" />
+                    <has_text text="Within-family kinship data saved in file king.kin" />
+                    <has_text text="Genotype data consist of 6000 autosome SNPs" />
+                </assert_contents>
+            </output>
+        </test>
+        <test>
+            <param name="genotype" value="new.6000.bed"/>
+            <param name="family" value="new.6000.fam"/>
+            <param name="map" value="new.6000.bim"/>
+            <param name="unrelated" value="true" />
+            <param name="use_log" value="true" />
+            <output name="kingoutlog">
+                <assert_contents>
+                    <has_text text="--unrelated" />
+                    <has_text text="Total length of 6 chromosomal segments usable for IBD segment analysis is" />
+                    <has_text text="Y028,Y117" />
+                    <has_text text="An alternative list of 114 to-be-removed individuals saved in file kingunrelated_toberemoved.txt" />
+                </assert_contents>
+            </output>
+        </test>
+        <test>
+            <param name="genotype" value="new.6000.bed"/>
+            <param name="family" value="new.6000.fam"/>
+            <param name="map" value="new.6000.bim"/>
+            <param name="unrelated" value="true" />
+            <param name="degree" value="2" />
+            <param name="use_log" value="true" />
+            <output name="kingoutlog" >
+                <assert_contents>
+                    <has_text text="--unrelated" />
+                    <has_text text="--degree 2" />
+                    <has_text text="Autosome genotypes stored in 94 words for each of 332 individuals." />
+                    <has_text text="An alternative list of 114 to-be-removed individuals saved in file kingunrelated_toberemoved.txt" />
+                </assert_contents>
+            </output>
+        </test>
+        <test>
+            <param name="genotype" value="new.6000.bed"/>
+            <param name="family" value="new.6000.fam"/>
+            <param name="map" value="new.6000.bim"/>
+            <param name="build" value="true" />
+            <param name="use_log" value="true" />
+            <output name="kingoutlog" >
+                <assert_contents>
+                    <has_text text="--build" />
+                    <has_text text="Autosome genotypes stored in 94 words for each of 332 individuals." />
+                    <has_text text="Update-ID information is saved in file kingupdateids.txt" />
+                    <has_text text="Total length of 6 chromosomal segments usable for IBD segment analysis is" />
+                </assert_contents>
+            </output>
+        </test>
+        <test>
+            <param name="genotype" value="new.6000.bed"/>
+            <param name="family" value="new.6000.fam"/>
+            <param name="map" value="new.6000.bim"/>
+            <param name="build" value="true" />
+            <param name="degree" value="2" />
+            <param name="use_log" value="true" />
+            <output name="kingoutlog">
+                <assert_contents>
+                    <has_text text="--build" />
+                    <has_text text="--degree 2" />
+                    <has_text text="Total length of 6 chromosomal segments usable for IBD segment analysis is" />
+                    <has_text text="Update-parent information is saved in file kingupdateparents.txt" />
+                </assert_contents>
+            </output>
+        </test>
+        <test>
+            <param name="genotype" value="new.6000.bed"/>
+            <param name="family" value="new.6000.fam"/>
+            <param name="map" value="new.6000.bim"/>
+            <param name="cluster" value="true" />
+            <param name="use_log" value="true" />
+            <output name="kingoutlog">
+                <assert_contents>
+                    <has_text text="--cluster" />
+                    <has_text text="Total length of 6 chromosomal segments usable for IBD segment analysis is" />
+                    <has_text text="Pair-wise relatedness in newly clustered families saved in kingcluster.kin." />
+                </assert_contents>
+            </output>
+        </test>
+    </tests>
+    <help><![CDATA[
+
+    `KING <http://people.virginia.edu/~wc9c/KING/>`_ is a toolset that makes use of high-throughput SNP data typically seen in a genome-wide association study (GWAS)
+    or a sequencing project. Applications of KING include family relationship inference and pedigree error checking,
+    quality control, population substructure identification, forensics, gene mapping, etc.
+
+    ]]>
+    </help>
+    <citations>
+        <citation type="doi">10.1093/bioinformatics/btq559</citation>
+    </citations>
+</tool>