Body: <p>I am using R to extract ClinVar classification of SNPs using rsid. Here's an example of my workflow:</p>
  <p>Patient data:</p>
  <div class="s-table-container"><table class="s-table">
  <thead>
  <tr>
  <th style="text-align: left;">Sample</th>
  <th style="text-align: left;">Func</th>
  <th style="text-align: left;">Gene</th>
  <th style="text-align: left;">Codon_Change</th>
  <th style="text-align: left;">dbSNPv151_GRCh38</th>
  <th style="text-align: left;">Chr</th>
  <th style="text-align: right;">Start</th>
  <th style="text-align: right;">End</th>
  <th style="text-align: left;">Ref</th>
  <th style="text-align: left;">Obs</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: left;">Mary</td>
  <td style="text-align: left;">missense_variant</td>
  <td style="text-align: left;">SPINK5</td>
  <td style="text-align: left;">Cga/Gga</td>
  <td style="text-align: left;">rs199757347</td>
  <td style="text-align: left;">chr5</td>
  <td style="text-align: right;">148091214</td>
  <td style="text-align: right;">148091214</td>
  <td style="text-align: left;">C</td>
  <td style="text-align: left;">G</td>
  </tr>
  </tbody>
  </table></div>
  <p>With this rsid rs199757347, <a href="https://www.ncbi.nlm.nih.gov/clinvar/?term=rs199757347" rel="nofollow noreferrer">two ClinVar classifications</a> were found with different codon changes, one is C &gt; G (Uncertain significance, missense variant) and the other one C &gt; T (Pathogenic, nonsense variant).</p>
  <p>With the <code>rentrez</code> package in R, I can extract both ClinVar classifications:</p>
  <pre class="lang-r prettyprint-override"><code>library(XML)
  library(rentrez)
  
  extract_from_esummary(
    entrez_summary(db = &quot;clinvar&quot;, 
                   id = entrez_search(db = &quot;clinvar&quot;, term = &quot;rs199757347&quot;)$ids, 
                   rettype='xml', 
                   parsed = F), 
    &quot;germline_classification&quot;
    )
  
                 968176                               
  description    &quot;Uncertain significance&quot;             
  last_evaluated &quot;2022/01/01 00:00&quot;                   
  review_status  &quot;criteria provided, single submitter&quot;
  trait_set      data.frame,2                         
                 351517                                                
  description    &quot;Pathogenic&quot;                                          
  last_evaluated &quot;2019/01/01 00:00&quot;                                    
  review_status  &quot;criteria provided, multiple submitters, no conflicts&quot;
  trait_set      data.frame,2 
  </code></pre>
  <p>However, only the classification &quot;Uncertain significance&quot; is relevant to my sample, how can I incorporate the alternative alleles in querying ClinVar with rsid? Or do you have a better way to query ClinVar with my sample data?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-02-15T11:57:20.730Z
Comments.Text: Do you absolutely need to use rsIDs? The problem isn't clinvar here, it is that the rsID describes two variants.
Comments.UserDisplayName: terdon
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-02-15T12:02:30.920Z
Comments.Text: @terdon, Yes I understand, that's why I wish to "incorporate" the info of ALT allele in the search. And based on my sample data, I think the most useful info for querying ClinVar is the rsID. Do you have other recommendations on querying ClinVar if I don't use rsID? Thank you!
Comments.UserDisplayName: benson23
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-02-15T13:15:17.177Z
Comments.Text: I am afraid not. I am spoiled, the company I work for has a [really good API](https://landing.varsome.com/varsome-api) and that's what I use, but it isn't a free product so any answer I post using it would only be helpful to our clients :/ However, my guess is that you should be able to get the nt change if you don't restrict the output to `germline_classification` only, so then you should be able to parse that to get what you need. Alternatively, if you can convert the rsIDs to HGVS notation (i.e. `NM_006846.4(SPINK5):c.652C>G` in your case), you can query using that.
Comments.UserDisplayName: terdon
Tags: <r><snp><wgs><entrez><rsid>
Title: Different ClinVar classifications/SNPs are linked to the same rsid
ThreadText: # Different ClinVar classifications/SNPs are linked to the same rsid
  
  (Asked by: username_0 on 2024-02-15)
  
  I am using R to extract ClinVar classification of SNPs using rsid. Here's an example of my workflow:
  
  Patient data:
  
  | Sample | Func | Gene | Codon\_Change | dbSNPv151\_GRCh38 | Chr | Start | End | Ref | Obs |
  | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
  | Mary | missense\_variant | SPINK5 | Cga/Gga | rs199757347 | chr5 | 148091214 | 148091214 | C | G |
  
  With this rsid rs199757347, [two ClinVar classifications](https://www.ncbi.nlm.nih.gov/clinvar/?term=rs199757347) were found with different codon changes, one is C > G (Uncertain significance, missense variant) and the other one C > T (Pathogenic, nonsense variant).
  
  With the `rentrez` package in R, I can extract both ClinVar classifications:
  
  ```r
  library(XML)
  library(rentrez)
  
  extract_from_esummary(
    entrez_summary(db = "clinvar", 
                   id = entrez_search(db = "clinvar", term = "rs199757347")$ids, 
                   rettype='xml', 
                   parsed = F), 
    "germline_classification"
    )
  
                 968176                               
  description    "Uncertain significance"             
  last_evaluated "2022/01/01 00:00"                   
  review_status  "criteria provided, single submitter"
  trait_set      data.frame,2                         
                 351517                                                
  description    "Pathogenic"                                          
  last_evaluated "2019/01/01 00:00"                                    
  review_status  "criteria provided, multiple submitters, no conflicts"
  trait_set      data.frame,2 
  
  ```
  
  However, only the classification "Uncertain significance" is relevant to my sample, how can I incorporate the alternative alleles in querying ClinVar with rsid? Or do you have a better way to query ClinVar with my sample data?
  
  **Tags:** r, snp, wgs, entrez, rsid
  
  > **Comments:**
  > **username_1**: Do you absolutely need to use rsIDs? The problem isn't clinvar here, it is that the rsID describes two variants.  
  > **username_0**: @username_1, Yes I understand, that's why I wish to "incorporate" the info of ALT allele in the search. And based on my sample data, I think the most useful info for querying ClinVar is the rsID. Do you have other recommendations on querying ClinVar if I don't use rsID? Thank you!  
  > **username_1**: I am afraid not. I am spoiled, the company I work for has a [really good API](https://landing.varsome.com/varsome-api) and that's what I use, but it isn't a free product so any answer I post using it would only be helpful to our clients :/ However, my guess is that you should be able to get the nt change if you don't restrict the output to `germline_classification` only, so then you should be able to parse that to get what you need. Alternatively, if you can convert the rsIDs to HGVS notation (i.e. `NM_006846.4(SPINK5):c.652C>G` in your case), you can query using that.  
  
  ---
  
  ## 0 answers
  
  