<p>I think you can't do (2) and (3) without the mother.</p>
<p>(1) is doable to a very high accuracy. It is better to start with fastq. You need to generate a multi-sample VCF first. Here is a high-level overview: a) align reads with bwa-mem; b) sort alignments with samtools and then index the resulting BAM; c) call variants <em>jointly</em> with freebayes (or GATK if you like challenges). After you get the two-sample VCF, you go through every site where the father is homozygous and it is a <em>high-quality</em> site in both samples (e.g. average coverage, high mapping quality, not in difficult regions, etc). Among these sites, check if the child has the paternal allele. If you have a father-son pair, the child is expected to have all the paternal alleles in theory. In practice, if &gt;99% of paternal homozygotes are present in the child, the two samples will almost certainly be a father-son pair. The actual threshold may depend on how you define &quot;high-quality&quot; sites. Errors may lead to apparent mendelian violations.</p>
<p>In principle, it is possible to do a similar analysis with the two provided VCFs, but you need to be very careful about various technical artifacts.</p>

CC BY-SA 4.0
2021-07-04T23:37:16.287Z
2021-07-04T23:37:16.287Z
user172818
<p>Assuming you've got genotyped VCF files from the same type of data, and they are similarly normalised, I expect that the VCF files will be easier to work with initially.</p>
<p>That's a lot of assumptions, so until there's more information about the input data, I'll just point you to <a href="https://samtools.github.io/bcftools/bcftools.html#merge" rel="nofollow noreferrer">bcftools merge</a>, which I think would be a reasonable first step given those assumptions:</p>
<pre><code>bcftools merge -o merged.vcf.gz A.vcf.gz B.vcf.gz
</code></pre>
<p>This will produce a merged VCF file that contains genotypes from both files on each line. To look for similarities and/or differences, you would then inspect each line to check whether the genotypes were the same or different (e.g. <code>same: 1/1 1/1</code>; <code>different: 0/1 1/1</code>).</p>

CC BY-SA 4.0
2021-07-05T01:27:08.983Z
2021-07-05T01:27:08.983Z
gringer
<p>I have the files of 2 persons that got whole genome sequencing, one by nebula genomics and the other by dante labs.</p>
<ol>
<li>I want to compare their genomes to see if they are father and son.</li>
<li>I want to see exactly which genetic sequences they share.</li>
<li>In the shared sequences, I want to know what mutations exist only in the son.</li>
</ol>
<p>Which program should I use?</p>
<p>Each company provide fastq and vcf files to the genome. so I have each genome in fastq and vcf. which is better to use?</p>
<p>(I have the files on my hard drive, so is it better to use offline program?)</p>

CC BY-SA 4.0
2021-07-05T01:08:00.887Z
This seems like a valid question to me; it is similar to bioinformatics projects I've worked on in the past, and I think it's reasonable for people to ask questions regardless of how complex the answers seem to other people.
gringer
CC BY-SA 4.0
2021-07-05T01:17:21.920Z
I expect that answers to this will depend on what the input files look like. Could you please show the first few lines of the fastq files, and the first few lines of the VCF files (including a few lines beyond the header information)?
gringer
<wgs><human-genome>
How to compare 2 whole genome sequences
# How to compare 2 whole genome sequences

(Asked by: username_0 on 2021-07-04)

I have the files of 2 persons that got whole genome sequencing, one by nebula genomics and the other by dante labs.

1. I want to compare their genomes to see if they are father and son.
2. I want to see exactly which genetic sequences they share.
3. In the shared sequences, I want to know what mutations exist only in the son.

Which program should I use?

Each company provide fastq and vcf files to the genome. so I have each genome in fastq and vcf. which is better to use?

(I have the files on my hard drive, so is it better to use offline program?)

**Tags:** wgs, human-genome
> **Comments:**
> **username_1**: This seems like a valid question to me; it is similar to bioinformatics projects I've worked on in the past, and I think it's reasonable for people to ask questions regardless of how complex the answers seem to other people.  
> **username_1**: I expect that answers to this will depend on what the input files look like. Could you please show the first few lines of the fastq files, and the first few lines of the VCF files (including a few lines beyond the header information)?  

---

## 2 answers

### Answer by username_2 on 2021-07-04. Score: 2

I think you can't do (2) and (3) without the mother.

(1) is doable to a very high accuracy. It is better to start with fastq. You need to generate a multi-sample VCF first. Here is a high-level overview: a) align reads with bwa-mem; b) sort alignments with samtools and then index the resulting BAM; c) call variants *jointly* with freebayes (or GATK if you like challenges). After you get the two-sample VCF, you go through every site where the father is homozygous and it is a *high-quality* site in both samples (e.g. average coverage, high mapping quality, not in difficult regions, etc). Among these sites, check if the child has the paternal allele. If you have a father-son pair, the child is expected to have all the paternal alleles in theory. In practice, if >99% of paternal homozygotes are present in the child, the two samples will almost certainly be a father-son pair. The actual threshold may depend on how you define "high-quality" sites. Errors may lead to apparent mendelian violations.

In principle, it is possible to do a similar analysis with the two provided VCFs, but you need to be very careful about various technical artifacts.


---

### Answer by username_1 on 2021-07-05. Score: 0

Assuming you've got genotyped VCF files from the same type of data, and they are similarly normalised, I expect that the VCF files will be easier to work with initially.
That's a lot of assumptions, so until there's more information about the input data, I'll just point you to bcftools merge, which I think would be a reasonable first step given those assumptions:
bcftools merge -o merged.vcf.gz A.vcf.gz B.vcf.gz

This will produce a merged VCF file that contains genotypes from both files on each line. To look for similarities and/or differences, you would then inspect each line to check whether the genotypes were the same or different (e.g. same: 1/1 1/1; different: 0/1 1/1).


---

