# HG changeset patch # User gandres # Date 1460544579 14400 # Node ID 2b7eb79f0ba03fe6c0c3c7c2b133f0d777610ade # Parent ce984119f66930b2a376a20ac84e9c752ec5df57 planemo upload diff -r ce984119f669 -r 2b7eb79f0ba0 VCFToolFilter/GetChromOfVCF.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/VCFToolFilter/GetChromOfVCF.pl Wed Apr 13 06:49:39 2016 -0400 @@ -0,0 +1,25 @@ +#!/usr/bin/perl + +use strict; + +my $vcf = $ARGV[0]; + +my %chrs; +my $ok = 0; +open(my $V,$vcf); +while(<$V>) +{ + if ($ok) + { + my ($chr,$pos) = split(/\t/,$_); + $chrs{$chr}++; + } + if (/#CHROM/){$ok = 1;} +} +close($V); + +foreach my $chr(sort keys(%chrs)) +{ + my $nb = $chrs{$chr}; + print "$chr $nb\n"; +} diff -r ce984119f669 -r 2b7eb79f0ba0 VCFToolFilter/find_indiv.py --- a/VCFToolFilter/find_indiv.py Wed Apr 13 03:32:59 2016 -0400 +++ b/VCFToolFilter/find_indiv.py Wed Apr 13 06:49:39 2016 -0400 @@ -12,8 +12,14 @@ def get_field_chrs_options(dataset): options = [] - chrs=os.popen("grep -v '#' %s | cut -f1 | sort -u "%dataset.file_name).read()[:-1].split('\n') - for opt in chrs: - options.append((opt,opt, True)) + chrs=os.popen("grep '##contig' %s"%dataset.file_name).read()[:-1].split('\n') + if len(chr)>0: + for line in chrs: + opt=re.search('^##contig=