1
$\begingroup$

Is there an easy way to grab the rsids (hg38) of a VCF file? I know one of the tabs can contain RSIDs, but this file doesn't contain any.

I have a software I created for mapping 23AndMe DTC testing to SNPedia, and I'm trying to integrate more DTC testing. (https://www.github.com/mentatpsi/osgenome)

The user found this https://gist.github.com/KlausTrainer/26c2996cf32677e4c107bd8aaee67794 which is a script to use variant summary data to map to the RSIDs, but I'm hesitant to perform a SQL dump to find a table that contains chromosome, postion, and rsID columns.

As a bonus question, 23AndMe reports all positive orientations. How would I go about converting strands to match this orientation? Does the VCF contain information that would allow this action autonomously?

$\endgroup$
4
  • $\begingroup$ Can you show us an example of your file? VCFs do not need to contain rsIDs and often don't, as you see. Also, if you are referring to the raw, unfiltered data that you can download from 23&me, you need to be very, very careful with them because, at least when I looked at them last, they don't contain any quality information and will contain many, many false positives. Which is why they are not included in the official results you get on their webpage. $\endgroup$
    – terdon
    Commented Mar 11, 2023 at 14:05
  • $\begingroup$ I do have a disclaimer on my application that Raw Data coming from DTC vendors have a false positive rate approaching 40% per a research article found in a Bioinformatics magazine. $\endgroup$
    – Shay Maor
    Commented Mar 11, 2023 at 16:03
  • $\begingroup$ If my understanding of the data is correct... this is the format: beholdgenealogy.com/blog/?p=2879 $\endgroup$
    – Shay Maor
    Commented Mar 11, 2023 at 16:09
  • $\begingroup$ Re the false positives - with this VCF data, there appears to be several fields of quality data. How useful I don't know, being a beginner to this subject. I'll post a the header and a few lines of the VCF later in a reply. But if you have, for instance, the number of reads (is that depth? Still getting the terminology) that match this particular variant, I assume that would allow you to provide a confidence level. $\endgroup$
    – Pete
    Commented Mar 11, 2023 at 22:22

1 Answer 1

1
$\begingroup$

If your file doesn't contain the rsIDs, you can use a tool like Ensembl's VEP to annotate the file and get rsIDs as well. Of course, not all variants have an rsID so don't expect to find one for everything reported in your file.

More importantly, if these are the raw, unfiltered data from commercial direct-to-consumer sequencing products like 23&me, you need to be aware that they are incredibly untrustworthy. This is why 23&me don't include them in their official report. They only show you the quality results that have been filtered. When working with the raw data, you are very likely to have completely bogus results and will need to have a full VCF file and filter on various quality criteria.

I have looked at the raw 23&me data from 4 individuals, and all of them had extremely rare pathogenic variants reported that would basically have killed them long before they learned to walk. They were clearly false positives.

I stress that I am not suggesting these companies are producing crap: none of these variants was reported in the official report of 23&me, they were filtered out. The bad calls are only present when you work on the raw, unfiltered data but if that is what you are working on, you need to be extremely careful.

$\endgroup$
7
  • $\begingroup$ Is there a downloadable file which 'maps' chromosome, position to rsid? According to this bioinformatics.stackexchange.com/a/14193/17155 one can download a dbSNP database file, with caveats - does this file allow you to map chr:pos to rsid? The caveats mentioned in that answer are that dbSNP build numbers are important (range mentioned is 152, 153, 154) but that reference genome is not. What build is suitable for use with SNPedia? Would a suitable file for Dante, using GRCh37, be say ftp.ncbi.nih.gov/snp/pre_build152/organisms/… $\endgroup$
    – Pete
    Commented Mar 12, 2023 at 23:14
  • $\begingroup$ Ensembl's VEP, that you mentioned, seems to return vast amounts of data, tens of rows per chr:pos, with reams of redundant data, and a limited query size, and very long waits even for tiny queries. Unless I am misunderstanding and the 'mapping' is a lot more complicated than chr:pos to rsid, it will be easier to just do it locally on my PC after a longish single download of a few GB aided by a bit of fast C code and an SSD. $\endgroup$
    – Pete
    Commented Mar 12, 2023 at 23:20
  • $\begingroup$ @Pete are you really only giving chr and position, with no actual variant? You said you had a VCF file, do you not? $\endgroup$
    – terdon
    Commented Mar 12, 2023 at 23:47
  • $\begingroup$ Sorry, you're absolutely right, I have a long line of data associated with each chr:pos - format is chr, pos, <period (in place of rsid)>, reference base, my actual variant base(s), and then there's several quality fields and many more fields. The fields are described in the file header, there must be about 30 more fields iirc (I'm not in front of the file right now). Many of these fields I don't yet understand. One thing I'm still unsure of is if you have 2 different possible alternative bases at a particular position, do they get different rsids or is it the same rsid with different 'types' $\endgroup$
    – Pete
    Commented Mar 13, 2023 at 7:30
  • $\begingroup$ @Pete That... isn't a VCF and isn't even similar to the image of a file you showed. That's why I asked you for an example of your file. Instead, you gave me a photograph (images of text are useless, we cannot run text parsing tools on them) and now you tell me it was a photograph that isn't even related to your data? Please don't do this. That invalidates the entire question. So please go and edit your question and include some actual lines from your file and the output you expect from them. As for rsIDs, sometimes one rsID corresponds to a specific variant, other times it can be many. $\endgroup$
    – terdon
    Commented Mar 13, 2023 at 9:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.