diff --git a/articles/a01_overview.html b/articles/a01_overview.html index f717e567..f3218c51 100644 --- a/articles/a01_overview.html +++ b/articles/a01_overview.html @@ -188,12 +188,12 @@

The gen_tibble loci=example_loci, backingfile = tempfile()) #> -#> gen_tibble saved to /tmp/Rtmp5t9vcd/file20465c7dff6.gt -#> using bigSNP file: /tmp/Rtmp5t9vcd/file20465c7dff6.rds -#> with backing file: /tmp/Rtmp5t9vcd/file20465c7dff6.bk +#> gen_tibble saved to /tmp/RtmpGUqF2C/file1c8654cd39c7.gt +#> using bigSNP file: /tmp/RtmpGUqF2C/file1c8654cd39c7.rds +#> with backing file: /tmp/RtmpGUqF2C/file1c8654cd39c7.bk #> make sure that you do NOT delete those files! #> to reload the gen_tibble in another session, use: -#> gt_load('/tmp/Rtmp5t9vcd/file20465c7dff6.gt') +#> gt_load('/tmp/RtmpGUqF2C/file1c8654cd39c7.gt')

We are provided information on where the three files underlying the genotype information are stored. As we don’t want to keep the files, we used the tmp directory; normally you will want to use your working @@ -535,15 +535,16 @@

Saving and reading data
 gt_file_name <- gt_save(example_gt)
 #> 
-#> gen_tibble saved to /tmp/Rtmp5t9vcd/file20465c7dff6.gt
-#> using bigSNP file: /tmp/Rtmp5t9vcd/file20465c7dff6.rds
-#> with backing file: /tmp/Rtmp5t9vcd/file20465c7dff6.bk
+#> gen_tibble saved to /tmp/RtmpGUqF2C/file1c8654cd39c7.gt
+#> using bigSNP file: /tmp/RtmpGUqF2C/file1c8654cd39c7.rds
+#> with backing file: /tmp/RtmpGUqF2C/file1c8654cd39c7.bk
 #> make sure that you do NOT delete those files!
 #> to reload the gen_tibble in another session, use:
-#> gt_load('/tmp/Rtmp5t9vcd/file20465c7dff6.gt')
+#> gt_load('/tmp/RtmpGUqF2C/file1c8654cd39c7.gt')
 gt_file_name
-#> [1] "/tmp/Rtmp5t9vcd/file20465c7dff6.gt"  "/tmp/Rtmp5t9vcd/file20465c7dff6.rds"
-#> [3] "/tmp/Rtmp5t9vcd/file20465c7dff6.bk"
+#> [1] "/tmp/RtmpGUqF2C/file1c8654cd39c7.gt" +#> [2] "/tmp/RtmpGUqF2C/file1c8654cd39c7.rds" +#> [3] "/tmp/RtmpGUqF2C/file1c8654cd39c7.bk"

In a later session, we could reload the data with:

 new_example_gt <- gt_load(gt_file_name[1])
@@ -567,12 +568,12 @@ 

Saving and reading databed_path_pop_a <- system.file("extdata/pop_a.bed", package = "tidypopgen") pop_a_gt <- gen_tibble(bed_path_pop_a, backingfile = tempfile("pop_a_")) #> -#> gen_tibble saved to /tmp/Rtmp5t9vcd/pop_a_204677dd1a74.gt -#> using bigSNP file: /tmp/Rtmp5t9vcd/pop_a_204677dd1a74.rds -#> with backing file: /tmp/Rtmp5t9vcd/pop_a_204677dd1a74.bk +#> gen_tibble saved to /tmp/RtmpGUqF2C/pop_a_1c864952544c.gt +#> using bigSNP file: /tmp/RtmpGUqF2C/pop_a_1c864952544c.rds +#> with backing file: /tmp/RtmpGUqF2C/pop_a_1c864952544c.bk #> make sure that you do NOT delete those files! #> to reload the gen_tibble in another session, use: -#> gt_load('/tmp/Rtmp5t9vcd/pop_a_204677dd1a74.gt')

+#> gt_load('/tmp/RtmpGUqF2C/pop_a_1c864952544c.gt')

For this vignette, we don’t want to keep files, so we are using again a temporary path for the backing files, but in normal instances, we can simply omit the backingfile parameter, and the @@ -588,7 +589,7 @@

Saving and reading data
 gt_as_plink(example_gt, file =  tempfile("new_bed_"))
-#> [1] "/tmp/Rtmp5t9vcd/new_bed_20461ac5918a.bed"
+#> [1] "/tmp/RtmpGUqF2C/new_bed_1c862bde6073.bed"

This will also write a .bim and .fam file and save them together with the .bed file. Note that, from the main tibble, only id, population and sex will be preserved in the @@ -622,22 +623,22 @@

Merging databigsnp_path_a <- bigsnpr::snp_readBed(bed_path_pop_a, backingfile = tempfile("pop_a_")) pop_a_gt <- gen_tibble(bigsnp_path_a) #> -#> gen_tibble saved to /tmp/Rtmp5t9vcd/pop_a_204679d45277.gt -#> using bigSNP file: /tmp/Rtmp5t9vcd/pop_a_204679d45277.rds -#> with backing file: /tmp/Rtmp5t9vcd/pop_a_204679d45277.bk +#> gen_tibble saved to /tmp/RtmpGUqF2C/pop_a_1c86273b14ff.gt +#> using bigSNP file: /tmp/RtmpGUqF2C/pop_a_1c86273b14ff.rds +#> with backing file: /tmp/RtmpGUqF2C/pop_a_1c86273b14ff.bk #> make sure that you do NOT delete those files! #> to reload the gen_tibble in another session, use: -#> gt_load('/tmp/Rtmp5t9vcd/pop_a_204679d45277.gt') +#> gt_load('/tmp/RtmpGUqF2C/pop_a_1c86273b14ff.gt') bed_path_pop_b <- system.file("extdata/pop_b.bed", package = "tidypopgen") bigsnp_path_b <- bigsnpr::snp_readBed(bed_path_pop_b, backingfile = tempfile("pop_b_")) pop_b_gt <- gen_tibble(bigsnp_path_b) #> -#> gen_tibble saved to /tmp/Rtmp5t9vcd/pop_b_2046672173eb.gt -#> using bigSNP file: /tmp/Rtmp5t9vcd/pop_b_2046672173eb.rds -#> with backing file: /tmp/Rtmp5t9vcd/pop_b_2046672173eb.bk +#> gen_tibble saved to /tmp/RtmpGUqF2C/pop_b_1c862c5b2b9a.gt +#> using bigSNP file: /tmp/RtmpGUqF2C/pop_b_1c862c5b2b9a.rds +#> with backing file: /tmp/RtmpGUqF2C/pop_b_1c862c5b2b9a.bk #> make sure that you do NOT delete those files! #> to reload the gen_tibble in another session, use: -#> gt_load('/tmp/Rtmp5t9vcd/pop_b_2046672173eb.gt') +#> gt_load('/tmp/RtmpGUqF2C/pop_b_1c862c5b2b9a.gt')

And inspect them:

 pop_a_gt
@@ -706,12 +707,12 @@ 

Merging data#> ( 5 were flipped to match the reference set) #> ( 2 are ambiguous, of which 2 were removed) #> -#> gen_tibble saved to /tmp/Rtmp5t9vcd/gt_merged.gt -#> using bigSNP file: /tmp/Rtmp5t9vcd/gt_merged.rds -#> with backing file: /tmp/Rtmp5t9vcd/gt_merged.bk +#> gen_tibble saved to /tmp/RtmpGUqF2C/gt_merged.gt +#> using bigSNP file: /tmp/RtmpGUqF2C/gt_merged.rds +#> with backing file: /tmp/RtmpGUqF2C/gt_merged.bk #> make sure that you do NOT delete those files! #> to reload the gen_tibble in another session, use: -#> gt_load('/tmp/Rtmp5t9vcd/gt_merged.gt')

+#> gt_load('/tmp/RtmpGUqF2C/gt_merged.gt')

Let’s check the resulting gen_tibble:

 merged_gt
@@ -772,12 +773,12 @@ 

Imputationbed_file <- system.file("extdata", "example-missing.bed", package = "bigsnpr") missing_gt <- gen_tibble(bed_file, backingfile = tempfile("missing_")) #> -#> gen_tibble saved to /tmp/Rtmp5t9vcd/missing_204656d10a07.gt -#> using bigSNP file: /tmp/Rtmp5t9vcd/missing_204656d10a07.rds -#> with backing file: /tmp/Rtmp5t9vcd/missing_204656d10a07.bk +#> gen_tibble saved to /tmp/RtmpGUqF2C/missing_1c86fbef6a7.gt +#> using bigSNP file: /tmp/RtmpGUqF2C/missing_1c86fbef6a7.rds +#> with backing file: /tmp/RtmpGUqF2C/missing_1c86fbef6a7.bk #> make sure that you do NOT delete those files! #> to reload the gen_tibble in another session, use: -#> gt_load('/tmp/Rtmp5t9vcd/missing_204656d10a07.gt') +#> gt_load('/tmp/RtmpGUqF2C/missing_1c86fbef6a7.gt') missing_gt #> # A gen_tibble: 500 loci #> # A tibble: 200 × 3 diff --git a/articles/a02_qc.html b/articles/a02_qc.html index b85a7051..b7e06821 100644 --- a/articles/a02_qc.html +++ b/articles/a02_qc.html @@ -316,15 +316,15 @@

Save
 gt_save(ld_data, file_name = tempfile())
## 
-## gen_tibble saved to /tmp/RtmpiLvqvN/file20944df8f4e3.gt
-
## using bigSNP file: /tmp/RtmpiLvqvN/file20944759736e.rds
-
## with backing file: /tmp/RtmpiLvqvN/file20944759736e.bk
+## gen_tibble saved to /tmp/Rtmpou4CMz/file1ce12710f1e4.gt

+
## using bigSNP file: /tmp/Rtmpou4CMz/file1ce13b6286ec.rds
+
## with backing file: /tmp/Rtmpou4CMz/file1ce13b6286ec.bk
## make sure that you do NOT delete those files!
## to reload the gen_tibble in another session, use:
-
## gt_load('/tmp/RtmpiLvqvN/file20944df8f4e3.gt')
-
## [1] "/tmp/RtmpiLvqvN/file20944df8f4e3.gt" 
-## [2] "/tmp/RtmpiLvqvN/file20944759736e.rds"
-## [3] "/tmp/RtmpiLvqvN/file20944759736e.bk"
+
## gt_load('/tmp/Rtmpou4CMz/file1ce12710f1e4.gt')
+
## [1] "/tmp/Rtmpou4CMz/file1ce12710f1e4.gt" 
+## [2] "/tmp/Rtmpou4CMz/file1ce13b6286ec.rds"
+## [3] "/tmp/Rtmpou4CMz/file1ce13b6286ec.bk"
diff --git a/articles/a03_example_clustering_and_dapc.html b/articles/a03_example_clustering_and_dapc.html index 0465c16b..6e439c8f 100644 --- a/articles/a03_example_clustering_and_dapc.html +++ b/articles/a03_example_clustering_and_dapc.html @@ -475,7 +475,7 @@

Clustering with sNMF
 geno_file <- gt_as_geno_lea(anole_gt)
 geno_file
-#> [1] "/tmp/RtmpQcaSEW/anolis_20da72d6bc60.geno"
+#> [1] "/tmp/RtmpPQ5ffe/anolis_1d2516b2763b.geno"

Note that the .geno file is placed by default in the same directory and using the same name as the backing file of the gen_tibble

diff --git a/pkgdown.yml b/pkgdown.yml index 13be81b7..13212b37 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -6,4 +6,4 @@ articles: a02_qc: a02_qc.html a03_example_clustering_and_dapc: a03_example_clustering_and_dapc.html a99_plink_cheatsheet: a99_plink_cheatsheet.html -last_built: 2024-08-09T09:27Z +last_built: 2024-08-09T09:48Z diff --git a/reference/gt_pcadapt.html b/reference/gt_pcadapt.html new file mode 100644 index 00000000..bf62cff9 --- /dev/null +++ b/reference/gt_pcadapt.html @@ -0,0 +1,129 @@ + +pcadapt analysis on a gen_tibble object — gt_pcadapt • tidypopgen + + +
+
+ + + +
+
+ + +
+

pcadapt is an algorithm that detects genetic markers under selection. It is based on the +principal component analysis (PCA) of the genotypes of the individuals. +The method is described in Luu et al. (2017), +See the R package pcadapt, which provides extensive +documentation and examples.

+
+ +
+
gt_pcadapt(x, pca, k, n_cores = 1)
+
+ +
+

Arguments

+ + +
x
+

A gen_tibble object.

+ + +
pca
+

a gt_pca object, as returned by gt_pca_partialSVD() or gt_pca_randomSVD().

+ + +
k
+

Number of principal components to use in the analysis.

+ + +
n_cores
+

Number of cores to use.

+ +
+
+

Value

+

An object of subclass gt_pcadapt, a subclass of mhtest.

+
+
+

Details

+

Internally, this function uses the snp_pcadapt function from the bigsnpr package.

+
+ +
+ +
+ + +
+ + + + + + + + diff --git a/reference/index.html b/reference/index.html index c018afcd..9cdb8c18 100644 --- a/reference/index.html +++ b/reference/index.html @@ -196,6 +196,10 @@

All functions gt_pca_randomSVD()

PCA for gen_tibble objects by randomized partial SVD

+ +

gt_pcadapt()

+ +

pcadapt analysis on a gen_tibble object

gt_roh_window()

diff --git a/sitemap.xml b/sitemap.xml index 4d0e3fd2..53b9a5b0 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -48,6 +48,7 @@ /reference/gt_pca_autoSVD.html /reference/gt_pca_partialSVD.html /reference/gt_pca_randomSVD.html +/reference/gt_pcadapt.html /reference/gt_roh_window.html /reference/gt_save.html /reference/gt_save_light.html