Answers.Body: <p>So, columns 7 and 8 should be the genotype of variant 1 (each column is one of the alleles). You have them as 0 1, which means absent and major allele.</p>
  
  <p>I think you're just missing a column. From the doc:</p>
  
  <p>Column 6 is Phenotype value ('1' = control, '2' = case, '-9'/'0'/non-numeric = missing data if case/control)</p>
  
  <p>Ideally you would know which SNPs are heterozygous based on your SNP calling and have such SNPs as 1 2, but if you have a homozygous organism or if you're working with data that's been flattened you can simply generate the .ped file with the same number twice for each SNP.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-17T14:47:11.733Z
Answers.Text: Thanks for your reply. So, I need to phase the data? Because now I have one column per SNP.  I don't have the phenotype column but I specify in the command "--no-pheno"
Answers.UserDisplayName: aguillenea
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-17T15:02:50.447Z
Answers.Text: Yeah you're right that --no-pheno should mean it can read them fine, but it says specifically that the first variant in the first column is half-empty. Can you try after adding a phenotype column? You can use -9 to indicate you don't have one.
Answers.UserDisplayName: Thymine
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-17T15:04:53.473Z
Answers.Text: Oh, is your example not your real data maybe? I assumed it was real aside from there being more lines and columns
Answers.UserDisplayName: Thymine
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-17T15:07:24.953Z
Answers.Text: Actually, it is quite similar to my real data... but I have 5564 individuals (rows) and 46465 SNPs (columns). I will try adding the phenotype column...
Answers.UserDisplayName: aguillenea
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-17T15:15:01.000Z
Answers.Text: I have the same error with the phenotype column.
Answers.UserDisplayName: aguillenea
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-17T15:15:23.253Z
Answers.Text: On the first line, if you do a cat $file | head -n 1 | awk '{print \$6,\$7}' do you get 0 1? (or 1 0?). Because that's what I think the error message is saying you have
Answers.UserDisplayName: Thymine
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-17T15:24:32.637Z
Answers.Text: In my real data, next to the column of phenotypes, I have 0 0 1 0 1 1 1
Answers.UserDisplayName: aguillenea
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-17T15:29:15.887Z
Answers.Text: I think that I found the main problem. I should phase the data.
Answers.UserDisplayName: aguillenea
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-17T18:24:06.757Z
Answers.Text: No, .ped files do not contain phase information, but they do require *two* columns per variant, and those columns should contain allele codes, not alternate-allele counts.
  
  So, if your first variant is an A/G SNP and your second variant is G/T, columns 6 and 7 of your file should always be "A A", "A G", "G G", or "0 0"; and columns 8 and 9 should always be "G G", "G T", "T T", or "0 0".
Answers.UserDisplayName: Christopher Chang
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-17T14:44:03.237Z
Answers.LastActivityDate: 2020-01-17T14:54:12.167Z
Answers.LastEditDate: 2020-01-17T14:54:12.167Z
Answers.UserDisplayName: Thymine
Body: <p>I know that I don't have the correct format in my .ped file for PLINK but I don't know how to convert it.
  My actual file is something like:</p>
  
  <pre><code>BSCAN BSCAN20016 0 0 2 0 0 1 1 1....
  BSCAN BSCAN20017 0 0 2 0 0 1 1 1....
  BSCAN BSCAN20018 0 0 2 0 0 1 1 1....
  </code></pre>
  
  <p>Where column 1 is FamilyID, column 2 is ID, column 3 is FatherID, column 4 MotherID, column 5 Sex and then the genotype of each individual.
  I only need to create binary files, so I tried to run:</p>
  
  <pre><code>plink-1.9-rc --file admixed --make-bed --no-pheno --cow --out admixed
  </code></pre>
  
  <p>but the program shows: Error: half-missing call in .ped file at variant 1, line 1.</p>
  
  <p>Anyone know how can I change the format or recode it to make a correct input?</p>
  
  <p>Thanks in advance!</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-09-13T16:24:18.647Z
Comments.Text: Please consider the response below - its a good response - and consider upvoting/accepting.
Comments.UserDisplayName: M__
Tags: <file-formats><plink>
Title: Wrong format .ped in PLINK
ThreadText: # Wrong format .ped in PLINK
  
  (Asked by: username_0 on 2020-01-17)
  
  I know that I don't have the correct format in my .ped file for PLINK but I don't know how to convert it.
  My actual file is something like:
  
  ```
  BSCAN BSCAN20016 0 0 2 0 0 1 1 1....
  BSCAN BSCAN20017 0 0 2 0 0 1 1 1....
  BSCAN BSCAN20018 0 0 2 0 0 1 1 1....
  
  ```
  
  Where column 1 is FamilyID, column 2 is ID, column 3 is FatherID, column 4 MotherID, column 5 Sex and then the genotype of each individual.
  I only need to create binary files, so I tried to run:
  
  ```
  plink-1.9-rc --file admixed --make-bed --no-pheno --cow --out admixed
  
  ```
  
  but the program shows: Error: half-missing call in .ped file at variant 1, line 1.
  
  Anyone know how can I change the format or recode it to make a correct input?
  
  Thanks in advance!
  
  **Tags:** file-formats, plink
  
  > **Comments:**
  > **username_1**: Please consider the response below - its a good response - and consider upvoting/accepting.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2020-01-17. Score: 1
  
  So, columns 7 and 8 should be the genotype of variant 1 (each column is one of the alleles). You have them as 0 1, which means absent and major allele.
  
  I think you're just missing a column. From the doc:
  
  Column 6 is Phenotype value ('1' = control, '2' = case, '-9'/'0'/non-numeric = missing data if case/control)
  
  Ideally you would know which SNPs are heterozygous based on your SNP calling and have such SNPs as 1 2, but if you have a homozygous organism or if you're working with data that's been flattened you can simply generate the .ped file with the same number twice for each SNP.
  
  > **Comments:**
  > **username_0**: Thanks for your reply. So, I need to phase the data? Because now I have one column per SNP.  I don't have the phenotype column but I specify in the command "--no-pheno"  
  > **username_2**: Yeah you're right that --no-pheno should mean it can read them fine, but it says specifically that the first variant in the first column is half-empty. Can you try after adding a phenotype column? You can use -9 to indicate you don't have one.  
  > **username_2**: Oh, is your example not your real data maybe? I assumed it was real aside from there being more lines and columns  
  > **username_0**: Actually, it is quite similar to my real data... but I have 5564 individuals (rows) and 46465 SNPs (columns). I will try adding the phenotype column...  
  > **username_0**: I have the same error with the phenotype column.  
  > **username_2**: On the first line, if you do a cat $file | head -n 1 | awk '{print \$6,\$7}' do you get 0 1? (or 1 0?). Because that's what I think the error message is saying you have  
  > **username_0**: In my real data, next to the column of phenotypes, I have 0 0 1 0 1 1 1  
  > **username_0**: I think that I found the main problem. I should phase the data.  
  > **username_3**: No, .ped files do not contain phase information, but they do require *two* columns per variant, and those columns should contain allele codes, not alternate-allele counts.  So, if your first variant is an A/G SNP and your second variant is G/T, columns 6 and 7 of your file should always be "A A", "A G", "G G", or "0 0"; and columns 8 and 9 should always be "G G", "G T", "T T", or "0 0".  
  
  ---
  
  