Answers.Body: <p>Both <a href="http://www.cog-genomics.org/plink/1.9/input#vcf" rel="nofollow noreferrer">Plink 1.9</a> [uses <code>--assoc</code>] and <a href="http://www.cog-genomics.org/plink/2.0/input#vcf" rel="nofollow noreferrer">Plink 2</a> [uses <code>--glm</code>] can process VCF files directly; no conversion needed.</p>
  <p>I think that Plink will combine multiple files specified on the command line into one file, but if this is not the case then <a href="https://www.htslib.org/doc/1.1/bcftools.html#merge" rel="nofollow noreferrer">bcftools</a> can be used to merge them.</p>
  <p>As described in those input specifications, you can provide Plink with a <code>.fam</code> file (via <code>--fam</code>) to add in phenotype data.</p>
  <p>Information about the <code>.fam</code> formats can be found <a href="http://www.cog-genomics.org/plink/1.9/formats#fam" rel="nofollow noreferrer">here</a>. It's a 6-column headerless space-separated format containing the following fields:</p>
  <ol>
  <li>Family ID ('FID')</li>
  <li>Within-family ID ('IID'; cannot be '0')</li>
  <li>Within-family ID of father ('0' if father isn't in dataset)</li>
  <li>Within-family ID of mother ('0' if mother isn't in dataset)</li>
  <li>Sex code ('1' = male, '2' = female, '0' = unknown)</li>
  <li>Phenotype value ('1' = control, '2' = case, '-9'/'0'/non-numeric = missing data if case/control)</li>
  </ol>
  <p>The phenotype column can be quantitative as well; which is triggered when a numeric value is seen that is not one of the above qualitative codes.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-12-15T06:04:01.193Z
Answers.Text: Alright, so should I be able to indicate with a .fam file which samples are from the control group and which ones are from the case group?
Answers.UserDisplayName: Michelle Yang
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-12-14T19:10:19.680Z
Answers.LastActivityDate: 2021-12-15T11:00:04.307Z
Answers.LastEditDate: 2021-12-15T11:00:04.307Z
Answers.UserDisplayName: gringer
Body: <p>I have two vcf files, one containing samples with TP53 mutations, and one containing samples with no TP53 mutations. The vcf without the mutations is the control and the vcf with the mutations is the case. How can I combine these two files into something that can be processed by the --assoc function in plink 1.9.0? Do I need to make them into one vcf? Or is it not necessary, and I can just use --assoc on each file after converting each individually?</p>
  
Tags: <vcf><plink>
Title: Converting Control and Case vcf files into a format that can be processed by plink 1.9.0
ThreadText: # Converting Control and Case vcf files into a format that can be processed by plink 1.9.0
  
  (Asked by: username_0 on 2021-12-14)
  
  I have two vcf files, one containing samples with TP53 mutations, and one containing samples with no TP53 mutations. The vcf without the mutations is the control and the vcf with the mutations is the case. How can I combine these two files into something that can be processed by the --assoc function in plink 1.9.0? Do I need to make them into one vcf? Or is it not necessary, and I can just use --assoc on each file after converting each individually?
  
  **Tags:** vcf, plink
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-12-14. Score: 1
  
  Both [Plink 1.9](http://www.cog-genomics.org/plink/1.9/input#vcf) [uses `--assoc`] and [Plink 2](http://www.cog-genomics.org/plink/2.0/input#vcf) [uses `--glm`] can process VCF files directly; no conversion needed.
  
  I think that Plink will combine multiple files specified on the command line into one file, but if this is not the case then [bcftools](https://www.htslib.org/doc/1.1/bcftools.html#merge) can be used to merge them.
  
  As described in those input specifications, you can provide Plink with a `.fam` file (via `--fam`) to add in phenotype data.
  
  Information about the `.fam` formats can be found [here](http://www.cog-genomics.org/plink/1.9/formats#fam). It's a 6-column headerless space-separated format containing the following fields:
  
  1. Family ID ('FID')
  2. Within-family ID ('IID'; cannot be '0')
  3. Within-family ID of father ('0' if father isn't in dataset)
  4. Within-family ID of mother ('0' if mother isn't in dataset)
  5. Sex code ('1' = male, '2' = female, '0' = unknown)
  6. Phenotype value ('1' = control, '2' = case, '-9'/'0'/non-numeric = missing data if case/control)
  
  The phenotype column can be quantitative as well; which is triggered when a numeric value is seen that is not one of the above qualitative codes.
  
  > **Comments:**
  > **username_0**: Alright, so should I be able to indicate with a .fam file which samples are from the control group and which ones are from the case group?  
  
  ---
  
  