AJResearchGroup / nsphs_ml_qt

R package for nsphs_ml_qt
GNU General Public License v3.0
0 stars 1 forks source link

Extract subset of SNPs #24

Closed richelbilderbeek closed 2 years ago

richelbilderbeek commented 2 years ago
richelbilderbeek commented 2 years ago
richel@N141CU:~/GitHubs/nsphs_ml_qt_results/issue_24$ ~/.local/share/plinkr/plink_1_9_unix/plink --bfile issue_24 --snp snp_5 --window 2 --make-bed
PLINK v1.90b6.22 64-bit (16 Apr 2021)          www.cog-genomics.org/plink/1.9/
(C) 2005-2021 Shaun Purcell, Christopher Chang   GNU General Public License v3
Logging to plink.log.
Options in effect:
  --bfile issue_24
  --make-bed
  --snp snp_5
  --window 2

7642 MB RAM detected; reserving 3821 MB for main workspace.
10 variants loaded from .bim file.
10 people (10 males, 0 females) loaded from .fam.
Using 1 thread (no multithreaded calculations invoked).
Before main variant filters, 10 founders and 0 nonfounders present.
Calculating allele frequencies... done.
10 variants and 10 people pass filters and QC.
Note: No phenotypes present.
--make-bed to plink.bed + plink.bim + plink.fam ... done.
richel@N141CU:~/GitHubs/nsphs_ml_qt_results/issue_24$ ls
create_fake_dataset.R  issue_24.bim  issue_24_labels.csv  plink.bed  plink.fam  run_plink.sh
issue_24.bed           issue_24.fam  issue_24.phe         plink.bim  plink.log
richelbilderbeek commented 2 years ago
richel@N141CU:~/GitHubs/nsphs_ml_qt_results/issue_24$ ~/.local/share/plinkr/plink_1_9_unix/plink --bfile issue_24 --snp snp_5 --window 2 --make-bed --out issue_24_subset
PLINK v1.90b6.22 64-bit (16 Apr 2021)          www.cog-genomics.org/plink/1.9/
(C) 2005-2021 Shaun Purcell, Christopher Chang   GNU General Public License v3
Logging to issue_24_subset.log.
Options in effect:
  --bfile issue_24
  --make-bed
  --out issue_24_subset
  --snp snp_5
  --window 2

7642 MB RAM detected; reserving 3821 MB for main workspace.
10 variants loaded from .bim file.
10 people (10 males, 0 females) loaded from .fam.
Using 1 thread (no multithreaded calculations invoked).
Before main variant filters, 10 founders and 0 nonfounders present.
Calculating allele frequencies... done.
10 variants and 10 people pass filters and QC.
Note: No phenotypes present.
--make-bed to issue_24_subset.bed + issue_24_subset.bim + issue_24_subset.fam
... done.
richel@N141CU:~/GitHubs/nsphs_ml_qt_results/issue_24$ ls
create_fake_dataset.R  issue_24.bim  issue_24_labels.csv  issue_24_subset.bed  issue_24_subset.fam  run_plink.sh
issue_24.bed           issue_24.fam  issue_24.phe         issue_24_subset.bim  issue_24_subset.log

What, no phenotype present?

richelbilderbeek commented 2 years ago

Works:

richel@N141CU:~/GitHubs/nsphs_ml_qt_results/issue_24$ ~/.local/share/plinkr/plink_1_9_unix/plink --bfile issue_24  --pheno issue_24.phe --snp snp_5 --window 2 --make-bed --out issue_24_subset
PLINK v1.90b6.22 64-bit (16 Apr 2021)          www.cog-genomics.org/plink/1.9/
(C) 2005-2021 Shaun Purcell, Christopher Chang   GNU General Public License v3
Logging to issue_24_subset.log.
Options in effect:
  --bfile issue_24
  --make-bed
  --out issue_24_subset
  --pheno issue_24.phe
  --snp snp_5
  --window 2

7642 MB RAM detected; reserving 3821 MB for main workspace.
10 variants loaded from .bim file.
10 people (10 males, 0 females) loaded from .fam.
10 phenotype values present after --pheno.
Using 1 thread (no multithreaded calculations invoked).
Before main variant filters, 10 founders and 0 nonfounders present.
Calculating allele frequencies... done.
10 variants and 10 people pass filters and QC.
Phenotype data is quantitative.
--make-bed to issue_24_subset.bed + issue_24_subset.bim + issue_24_subset.fam
... done.
richelbilderbeek commented 2 years ago

Note that adding --pheno did not result in a .phe file being created:

richel@N141CU:~/GitHubs/nsphs_ml_qt_results/issue_24$ ls
create_fake_dataset.R  issue_24.fam         issue_24_subset.bed  issue_24_subset.log
issue_24.bed           issue_24_labels.csv  issue_24_subset.bim  run_create_fake_dataset.sh
issue_24.bim           issue_24.phe         issue_24_subset.fam  run_plink.sh

or more tailored to detect the .phe file:

richel@N141CU:~/GitHubs/nsphs_ml_qt_results/issue_24$ ls issue_24_subset.*
issue_24_subset.bed  issue_24_subset.bim  issue_24_subset.fam  issue_24_subset.log
richelbilderbeek commented 2 years ago

This has been added to plinkr, ?plinkr::select_snps and ?plinkr::select_samples