Skip to content

Commit

Permalink
udated prune commented
Browse files Browse the repository at this point in the history
  • Loading branch information
SamGurr committed Nov 22, 2024
1 parent ba24dd3 commit 99b9df4
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion RAnalysis/Scripts/Popgen/03_prune.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,19 @@ chrom_vec <- tibble(chrom.name = dat$map$chromosome) %>%
# Run the SVD
thinned_snps <- snp_autoSVD(dat$genotypes, infos.chr = chrom_vec, infos.pos = dat$map$physical.pos, roll.size = 5, int.min.size = 10)
#thin_set <- attr(thinned_snps, "subset")
# Discarding 0 variant with MAC < 10 or MAF < 0.02.
#
# Phase of clumping (on MAF) at r^2 > 0.2.. keep 2797 variants.
#
# Iteration 1:
# Computing SVD..
# 0 outlier variant detected..
#
# Converged!
thin_set <- attr(thinned_snps, "subset")
length(thin_set) == nrow(thinned_snps$v) # the thinned subset is the same as thinned snps, meaning none removed
# therefore just about the thinned_snps
# Write the thinned SNP set to a file
write_rds(thinned_snps, here::here("RAnalysis", "Data", "Popgen", "03_prune", "pruned_snps.rds"))
Expand Down

0 comments on commit 99b9df4

Please sign in to comment.