Skip to content

Commit

Permalink
haploid fix
Browse files Browse the repository at this point in the history
  • Loading branch information
campanam committed Jun 29, 2018
1 parent f587fd0 commit d3d52fc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vcf2aln.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#-----------------------------------------------------------------------------------------------
# vcf2aln
VCF2ALNVER = "0.4.1"
VCF2ALNVER = "0.4.2"
# Michael G. Campana, Jacob A. West-Roberts, 2017-2018
# Smithsonian Conservation Biology Institute
#-----------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -535,7 +535,7 @@ def vcf_to_alignment

#end

unless $options.hap_flag #Don't run this subroutine on haploid vcf
unless $options.hap_flag #Accounting for ploidy
for i in 9...line_arr.size
vars = line_arr[i].split(":")[0] # This code handles phasing and randomizes unphased diplotypes
randvar = rand(2)
Expand Down Expand Up @@ -582,7 +582,7 @@ def vcf_to_alignment
end
else
for i in 9...line_arr.size
vars = line_arr[i]
vars = line_arr[i].split(":")[0]
if vars == "."
current_locus.seqs[i-9][index..endex] = "?" * (endex - index + 1)
else
Expand Down

0 comments on commit d3d52fc

Please sign in to comment.