@@ -327,7 +327,7 @@ function cross_validate(
327
327
end
328
328
329
329
"""
330
- convert_gt (t::Type{T}, b::Bgen)
330
+ convert_bgen_gt (t::Type{T}, b::Bgen)
331
331
332
332
Imports BGEN genotypes and chr/sampleID/pos/snpID/ref/alt into numeric arrays.
333
333
Genotypes are centered and scaled to mean 0 variance 1. Missing genotypes will
@@ -340,7 +340,7 @@ be replaced with the mean. Assumes every variant is biallelic (ie only 1 alt all
340
340
# Output
341
341
- `G`: matrix of genotypes with type `T`.
342
342
"""
343
- function convert_gt (t:: Type{T} , b:: Bgen ) where T <: Real
343
+ function convert_bgen_gt (t:: Type{T} , b:: Bgen ) where T <: Real
344
344
n = n_samples (b)
345
345
p = n_variants (b)
346
346
@@ -428,7 +428,7 @@ will be stored in double precision matrices (64 bit per entry).
428
428
"""
429
429
function parse_genotypes (tgtfile:: AbstractString , dosage= false )
430
430
if (endswith (tgtfile, " .vcf" ) || endswith (tgtfile, " .vcf.gz" ))
431
- f = dosage ? VCFTools . convert_ds : VCFTools . convert_gt
431
+ f = dosage ? convert_ds : convert_gt
432
432
X, X_sampleID, X_chr, X_pos, X_ids, X_ref, X_alt =
433
433
f (Float64, tgtfile, trans= false ,
434
434
save_snp_info= true , msg = " Importing from VCF file..." )
@@ -443,7 +443,7 @@ function parse_genotypes(tgtfile::AbstractString, dosage=false)
443
443
tgtfile[1 : end - 5 ] * " .sample" : nothing
444
444
indexfile = isfile (tgtfile * " .bgi" ) ? tgtfile * " .bgi" : nothing
445
445
bgen = Bgen (tgtfile; sample_path= samplefile, idx_path= indexfile)
446
- X, X_sampleID, X_chr, X_pos, X_ids, X_ref, X_alt = MendelIHT. convert_gt (Float64, bgen)
446
+ X, X_sampleID, X_chr, X_pos, X_ids, X_ref, X_alt = MendelIHT. convert_bgen_gt (Float64, bgen)
447
447
elseif isplink (tgtfile)
448
448
dosage && error (" PLINK files detected but dosage = true!" )
449
449
X = SnpArrays. SnpData (tgtfile)
0 commit comments