Skip to content

Commit

Permalink
close vcf readers
Browse files Browse the repository at this point in the history
  • Loading branch information
biona001 committed Nov 6, 2020
1 parent d56df9d commit 4b43552
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/vcf2plink.jl
Expand Up @@ -59,7 +59,7 @@ function vcf2plink(vcffile, plinkprefix)
write(io, 0x01)
write(io, Matrix{UInt8}(undef, (nsamples + 3) >> 2, nsnps))
end
snparray = SnpArray(plinkprefix * ".bed", nsamples, "r+")
snparray = SnpArray(plinkprefix * ".bed", nsamples, "r+")
bimio = makestream(plinkprefix * ".bim", "w")
vcfio = makestream(vcffile, "r")
reader = VCF.Reader(vcfio)
Expand Down Expand Up @@ -105,5 +105,8 @@ function vcf2plink(vcffile, plinkprefix)
end
end
end
close(bimio)
close(vcfio)
close(reader)
snparray
end

0 comments on commit 4b43552

Please sign in to comment.