Answers.Body: <p>Plink can work directly with <a href="https://en.wikipedia.org/wiki/Variant_Call_Format" rel="nofollow noreferrer">VCF</a> files (and can convert to/from VCF files), which is a text-based format that has one row per variant, with field columns for individual genotypes. VCF is a common output of variant calling software.</p>
  <p>You could load an existing VCF file into a tab-separated editor (like LibreOffice Calc), add in your separate genotypes, then save as a new VCF file.</p>
  <p>Alternatively, create a specific VCF file for your two variants, then use a combining tool [e.g. <a href="https://github.com/samtools/bcftools" rel="nofollow noreferrer">bcftools</a> concat] to combine that VCF file with the larger VCF file. Here's the blurb from <code>bcftools concat</code>:</p>
  <blockquote>
  <p>Concatenate or combine VCF/BCF files. All source files must have the same sample columns appearing in the same order. Can be used, for example, to concatenate chromosome VCFs into one VCF, or combine a SNP VCF and an indel VCF into one. The input files must be sorted by chr and position. The files must be given in the correct order to produce sorted VCF on output unless the -a, --allow-overlaps option is specified. With the --naive option, the files are concatenated without being recompressed, which is very fast..</p>
  </blockquote>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-04-21T04:39:46.870Z
Answers.LastActivityDate: 2024-04-21T04:39:46.870Z
Answers.UserDisplayName: gringer
Body: <p>I have a data set of ~350 humans, genotyped on an Illumina. I have bed, bim, and fam files for them.  Because of difficulty genotyping them, the genotyping does not include rs7412 or rs429358. However, these were specifically genotyped separately for the same sample, and I have .csv that gives both alleles both SNP locations.</p>
  <p>I would like these two SNPs to be taken into account when running analyses in plink, so would like these SNPs to be in the plink file with all the others. Is this practically possible? I don't mind &quot;manually entering&quot; the genotypes from my .csv into a plink file, but because of the format of plink files, I worry it is too error-prone since I would need to find the correct place to manually enter the alleles for each person.</p>
  
Tags: <snp><plink><data-preprocessing>
Title: Approach for manually adding genotype of two SNPs to plink files for 350 people?
ThreadText: # Approach for manually adding genotype of two SNPs to plink files for 350 people?
  
  (Asked by: username_0 on 2024-04-18)
  
  I have a data set of ~350 humans, genotyped on an Illumina. I have bed, bim, and fam files for them. Because of difficulty genotyping them, the genotyping does not include rs7412 or rs429358. However, these were specifically genotyped separately for the same sample, and I have .csv that gives both alleles both SNP locations.
  
  I would like these two SNPs to be taken into account when running analyses in plink, so would like these SNPs to be in the plink file with all the others. Is this practically possible? I don't mind "manually entering" the genotypes from my .csv into a plink file, but because of the format of plink files, I worry it is too error-prone since I would need to find the correct place to manually enter the alleles for each person.
  
  **Tags:** snp, plink, data-preprocessing
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-04-21. Score: 0
  
  Plink can work directly with [VCF](https://en.wikipedia.org/wiki/Variant_Call_Format) files (and can convert to/from VCF files), which is a text-based format that has one row per variant, with field columns for individual genotypes. VCF is a common output of variant calling software.
  
  You could load an existing VCF file into a tab-separated editor (like LibreOffice Calc), add in your separate genotypes, then save as a new VCF file.
  
  Alternatively, create a specific VCF file for your two variants, then use a combining tool [e.g. [bcftools](https://github.com/samtools/bcftools) concat] to combine that VCF file with the larger VCF file. Here's the blurb from `bcftools concat`:
  
  > Concatenate or combine VCF/BCF files. All source files must have the same sample columns appearing in the same order. Can be used, for example, to concatenate chromosome VCFs into one VCF, or combine a SNP VCF and an indel VCF into one. The input files must be sorted by chr and position. The files must be given in the correct order to produce sorted VCF on output unless the -a, --allow-overlaps option is specified. With the --naive option, the files are concatenated without being recompressed, which is very fast..
  
  
  ---
  
  