Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rp_bin/Ricopili/Version.pm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ our ($rp_header, $rp_version);



$rp_version = "2019_Feb_18.001" ;
$rp_version = "2019_Feb_20.001" ;


my $rp_logo = <<'END_TXT';
Expand Down
10 changes: 10 additions & 0 deletions rp_bin/impute_dirsub
Original file line number Diff line number Diff line change
Expand Up @@ -3743,6 +3743,16 @@ if ($impdeploy_done == 0) {
exit;
}
}

# check for vcf index files (csi or tbi)
unless (-e "$vcf_file.csi" || -e "$vcf_file.tbi") {
print "------------------------------------------------------------------------------------------------------------\n";
print "Error: $vcf_file index (csi or tbi) not found\n";
print "Please copy from imputation server output or generate in $subdir_in with \"tabix -p vcf\"\n";
print "------------------------------------------------------------------------------------------------------------\n";
exit;
}

my $keep_txt = "";
$keep_txt = "--keepvcf" if ($noclean);

Expand Down
19 changes: 16 additions & 3 deletions rp_bin/vcf2dos
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use Ricopili::Utils qw(trans);

use lib $ENV{rp_perlpackages};
use Compress::Zlib ;
use IO::Zlib;
#use Time;


Expand Down Expand Up @@ -235,7 +236,18 @@ if ($legend_sw == 1) {
## translate vcf file
##############################################

my $igz = gzopen("$vcf_file", "rb") or die "Cannot open file $vcf_file: $gzerrno\n" ;
# check for vcf index file and use with tabix if present
# if not, read entire file as before
my $vcf_has_index = -e "$vcf_file.csi" || -e "$vcf_file.tbi";

if ($vcf_has_index) {
my $tabix = trans("tabixloc") . "/tabix";
my $tabix_cmd = "$tabix -h $vcf_file $chr:$start_loc-$end_loc";
die $!."$tabix_cmd" unless open VCF, "-|", "$tabix_cmd";
} else {
die $!."$vcf_file" unless tie *VCF, "IO::Zlib", "$vcf_file", "rb";
}

my $ovgz = gzopen("$outvcf", "wb") or die "Cannot open file $outvcf: $gzerrno\n" ;
my $odgz = gzopen("$outdos", "wb") or die "Cannot open file $outdos: $gzerrno\n" ;

Expand All @@ -248,7 +260,8 @@ die $!."$outmap" unless open MAP, "> $outmap";
print "translating $vcf_file into $outvcf and $outdos\n";

my $nwarnings=0;
while ($igz->gzreadline(my $line)){

while (my $line = <VCF>){
chomp($line);
my @cells = @{&split_line_ref_tab(\$line)};

Expand Down Expand Up @@ -383,7 +396,7 @@ while ($igz->gzreadline(my $line)){

}

$igz->gzclose();
close VCF;
$ovgz->gzclose();
$odgz->gzclose();
close MAP;
Expand Down