I have hundreds of vcf file where each vcf file contains genome profile for a tissue. A portion of the vcf file is as follows:

[VCF file/dataframe[1]

I can read each vcf file into a dataframe. So it would be hundreds of dataframes. Each vcf file/dataframe contains hundreds of columns and 40/50 thousands rows. I want to see the difference in ALT column for each profile (vcf files/ dataframes) on CHROM, POS, ID and REF columns. What would be the best way to compare these dataframes/vcf files to see any similarity on ALT column? Thanks in advance.

  • $\begingroup$ You could use bedtools intersect -v. $\endgroup$ – user3479780 Jun 28 '19 at 2:01
  • $\begingroup$ You should likely index your dataframes using column ID. I guess CHROM and POS will be always the same for a given ID. Check that this is the case. Then see if the files differ in terms of which IDs are present. Or do they all have the same IDs, but differ on other columns? Are REF and ALT always the same for a given ID? (I would imagine so, but I'm not very familiar with this kind of data.) $\endgroup$ – bli Jun 29 '19 at 15:41
  • $\begingroup$ Could you edit your question and explain what you want a bit more please? What exactly do you want to compare? Are you looking for cases where the same position has the same ALT allele in different samples? Or for cases where the same genomic position has a different ALT? What output would you want? A summary of similarities or differences? The actual VCF lines that differ/don't differ? $\endgroup$ – terdon Jul 2 '19 at 8:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.