changeset 0:7e4eb6957b8a default tip

initial commit for genomeid tool
author Yusuf Ali <ali@yusuf.email>
date Thu, 12 Mar 2015 09:49:46 -0600
parents
children
files generateID.pl genomeid.xml
diffstat 2 files changed, 106 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generateID.pl	Thu Mar 12 09:49:46 2015 -0600
@@ -0,0 +1,46 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use Getopt::Long;
+
+use Bio::Seq::GenomeID qw(generate_id);
+
+my ($outFile, $inFile, $type, $index, $hg);
+my ($noise, $baq, $sex, $ucn, $ref, $name);
+
+GetOptions("o=s"=> \$outFile,
+				"n=f"=>\$noise,
+				"hg=s"=> \$hg,
+				"b=i"=> \$baq,
+				"s=s"=> \$sex,
+				"u=s"=> \$ucn,
+				"r=s"=> \$ref,
+				"type=s"=> \$type,
+				"file=s"=> \$inFile,
+				"sN=s"=> \$name,
+);
+$ucn = ($ucn eq "true")? 1:0; $sex = ($sex eq "true")?1:0; $ref = ($ref eq "true")?1:0;
+
+my %obj;
+$obj{'type'} = $type; $obj{'file'} = $inFile;
+$obj{'ucn'} = $ucn; $obj{'sex'} = $sex; $obj{'ref'} = $ref;
+$obj{'noise'} = $noise; $obj{'baq'} = $baq; 
+
+if($type eq "tbi"){
+	`tabix -p vcf $inFile`;
+}
+
+
+if($hg ne "none"){
+	$obj{'hg'} = $hg;
+}
+
+if( defined $name ){
+	$obj{'sampleName'} = $name;
+}
+
+my $genomeID = generate_id(%obj);
+open(my $fh, '>', $outFile);
+print $fh $genomeID;
+close $fh;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/genomeid.xml	Thu Mar 12 09:49:46 2015 -0600
@@ -0,0 +1,60 @@
+<?xml version="1.0" ?>
+
+<tool id="generate_genomeid" name='Generate GenomeID' version='1.0.0' hidden='false'>
+
+	<command interpreter="perl">
+		generateID.pl --o $genomeID --n $noise --hg $hg --b $baq --s $sex --u $ucn --r $ref 
+		#if $source.source_select=="bam"
+--type bam --file $bamFile
+		#elif $source.source_select=="vcf"
+--type vcf --file $vcfFile
+		#else
+--type tbi --file $tbi_gz 
+		#end if
+		#if $sampleName 
+--sN $sampleName
+		#end if
+
+	</command>
+
+	<inputs>
+		<conditional name="source">
+			<param name="source_select" type="select" label="Sequence Source Type">
+				<option value="bam">Binary Alignment Map (BAM)</option>
+				<option value="vcf">Variant Call Format (VCF)</option>
+				<option value="tbi">Indexed TAB-delimited (TABIX)</option>
+			</param>
+			
+			<when value="bam">
+				<param name="bamFile" type="data" format="bam" label="BAM file" help="If file is not listed, ensure it is set to bam datatype"></param>
+			</when>
+
+			<when value="vcf">
+				<param name="vcfFile" type="data" format="vcf" label="VCF File" help="If file is not listed, ensure it is set to vcf datatype"></param>
+			</when>
+
+			<when value="tbi">
+				<param name="tbi_gz" type="data" format="vcf_bgzip" label="Compressed VCF File" help="If file is not listed, ensure it is set to vcf_bgzip datatype"></param>
+			</when>
+
+		</conditional>
+			
+			<param name="hg" type="select" label="Version of the reference Human Genome" help="Warning: Selection of Unknown may return a poor identifier">
+				<option value="hg19">Human Genome Version 19</option>
+				<option value="hg38">Human Genome Version 38</option>
+				<option value="none">Unknown</option>
+			</param>
+			
+			<param name="sampleName" type="text"  label="Name of the sample" help="Used if source file contains more than one sample"></param>
+			<param name="noise" type="float" value="0.05" label="Threshold for maximum allowed noise"></param>
+			<param name="baq" type="integer" value="30" label=""></param>
+			<param name="sex" type="boolean" checked="true" label="Include Sex Chromosome Information"></param>
+			<param name="ucn" type="boolean" checked="false" label="Sample has unusual copy number"></param>
+			<param name="ref" type="boolean" checked="false" label="Match to reference geneome if marker not found"></param>
+
+	</inputs>
+	
+	<outputs>
+		<data name="genomeID" format="txt" label="${sampleName}_genomeID" />
+	</outputs>
+</tool>