Body: <p>For a study I need some kind of &quot;decoy&quot; GWAS-data. For this I created a panel with some genes, the same ones as in the real data. From NCBI I fetch some of their SNPs and create my own artificial .ped and .map file. Furthermore I save for each snp if it lies on the X-Chromosome.</p>
  <p>I then go on and randomly create female individuals by giving them heterozygous alleles on their X-Chromosome genes. Males only get homozygous ones.</p>
  <p>But when I then run pLink with the <code>--check-sex</code> argument I get a sexcheck file where there's only zeroes in the <code>SNPSEX</code> column. So do you know how <code>--check-sex</code> works that I can then create decoy-individuals that reliably (as much as possible) get detected as a given gender?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-02-18T12:42:16.530Z
Comments.Text: I was able to create a sample map/ped files that result in SNPSEX column being populated in plink 1.19 using 1000genomes Xchrom - found in their FAQ: https://www.internationalgenome.org/faq/where-are-snps-xymitochondrial-chr/. 
  
  The relevant conversion command `./plink  --check-sex --vcf ../ALL.chrX.phase3_shapeit2_mvncall_integrated_v1b.20130502.genotypes.vcf --maf 0.05 --out ped_map_chrX/chrmX --recode` .
  
  Even in this dataset, SNPSEX is 0 (ambiguous) in 400 (~16%) of cases. One could start pruning from here to arrive at a suitable minimal set of SNPs that are still recognised in plink.
Comments.UserDisplayName: ellimilial
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-02-19T10:03:39.490Z
Comments.Text: Ok, thanks! I'll try that out.
Comments.UserDisplayName: Cowboy_Patrick
Tags: <python><plink>
Title: Reliably create female and male individuals in a -ped file for plink
ThreadText: # Reliably create female and male individuals in a -ped file for plink
  
  (Asked by: username_0 on 2021-02-17)
  
  For a study I need some kind of "decoy" GWAS-data. For this I created a panel with some genes, the same ones as in the real data. From NCBI I fetch some of their SNPs and create my own artificial .ped and .map file. Furthermore I save for each snp if it lies on the X-Chromosome.
  
  I then go on and randomly create female individuals by giving them heterozygous alleles on their X-Chromosome genes. Males only get homozygous ones.
  
  But when I then run pLink with the `--check-sex` argument I get a sexcheck file where there's only zeroes in the `SNPSEX` column. So do you know how `--check-sex` works that I can then create decoy-individuals that reliably (as much as possible) get detected as a given gender?
  
  **Tags:** python, plink
  
  > **Comments:**
  > **username_1**: I was able to create a sample map/ped files that result in SNPSEX column being populated in plink 1.19 using 1000genomes Xchrom - found in their FAQ: https://www.internationalgenome.org/faq/where-are-snps-xymitochondrial-chr/.   The relevant conversion command `./plink  --check-sex --vcf ../ALL.chrX.phase3_shapeit2_mvncall_integrated_v1b.20130502.genotypes.vcf --maf 0.05 --out ped_map_chrX/chrmX --recode` .  Even in this dataset, SNPSEX is 0 (ambiguous) in 400 (~16%) of cases. One could start pruning from here to arrive at a suitable minimal set of SNPs that are still recognised in plink.  
  > **username_0**: Ok, thanks! I'll try that out.  
  
  ---
  
  ## 0 answers
  
  