This is a test version of Biostars. For the public version, visit https://www.biostars.org.
sex imputation based on SNP data

Hi, is there any R package that can do sex imputation from GWAS SNP data?

Or is there anyway to run PLINK inside R code?

Thanks a lot!

sex imputation

2 answers

system('plink ...')

might be the way to go. That's what we did :-)

EDIT:

Of course, if you have a file with the plink commands already stored as a script, you can always system('bash script_file.sh'). For this to work in an automated though, you would need to address changing input parameters on the fly within the script file, at which point it becomes easier to just construct the command as a string and execute that string instead of adding on a couple of File IO operations.

Thanks for the help, @RamRS! Are you saying that PLINK can run batch processing like plink file.containing.plink.commands?

Thanks again!

Hi blueskypie,

Please do not add answers unless you're answering the top level question. Use Add Comment or Add Reply as appropriate. This reply is better suited as a comment on my answer. Could you make the appropriate change please? That would involve the following steps:

  1. Copy the contents of your reply from this answer (you can edit this answer (Ctrl/Cmd + click the link to open it in a new tab) and do a Select All -> Copy there).
  2. Click on Add Comment on my post here: A: sex imputation based on SNP data
  3. Paste the copied text
  4. Click on the green Add Comment button
  5. Click on moderate back in your answer here: A: sex imputation based on SNP data
  6. Choose Delete Post
  7. Click on the blue Submit button.

Thank you!

Log in to answer this question.