Skip to content

PharmGKB/ncbi-var-services

Repository files navigation

ncbi-var-services

Variation Services

  • API version: 2.0.0
    • Build date: 2019-04-25T10:32:24.325-07:00[America/Los_Angeles]

Services for variation data processing

NOTE: This service is still in beta testing mode. Please limit your request rate to 1 request/second. dbSNP provides bulk download in VCF and JSON on the FTP site for users with a large number of RefSNPs (>100K) to process.

Code Generation

This repo was automatically generated by the Swagger Codegen using the following command

swagger-codegen generate -i https://api.ncbi.nlm.nih.gov/variation/v0/var_service.yaml 
  --api-package org.pharmgkb.io.ncbi.api 
  --model-package org.pharmgkb.io.ncbi.model 
  --artifact-id ncbi-var-services 
  --group-id org.pharmgkb 
  -l java 
  -o ncbi-var-services

Changes after auto-generation:

  1. compile target was set to Java 1.8
  2. removed gradle config for android compile target

Requirements

Building the API client library requires:

  1. Java 1.7+
  2. Maven/Gradle

Installation

To install the API client library to your local Maven repository, simply execute:

mvn clean install

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

mvn clean deploy

Refer to the OSSRH Guide for more information.

Maven users

Add this dependency to your project's POM:

<dependency>
  <groupId>org.pharmgkb</groupId>
  <artifactId>ncbi-var-services</artifactId>
  <version>1.0.0</version>
  <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project's build file:

compile "org.pharmgkb:ncbi-var-services:1.0.0"

Others

At first generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/ncbi-var-services-1.0.0.jar
  • target/lib/*.jar

Getting Started

Please follow the installation instruction and execute the following Java code:

import org.pharmgkb.io.ncbi.*;
import org.pharmgkb.io.ncbi.auth.*;
import org.pharmgkb.io.ncbi.model.*;
import org.pharmgkb.io.ncbi.api.FrequencyNotYetAvailableComingSoonApi;

import java.io.File;
import java.util.*;

public class FrequencyNotYetAvailableComingSoonApiExample {

    public static void main(String[] args) {
        
        FrequencyNotYetAvailableComingSoonApi apiInstance = new FrequencyNotYetAvailableComingSoonApi();
        String seqId = "seqId_example"; // String | Sequence id in 'accession.version' format
        Integer position = 56; // Integer | Zero-based SPDI-like start position. The number of nucleotides to advance from the position before the first nucleotides before starting the interval.
        Integer length = 56; // Integer | SPDI-like length of interval in units of nucleotides
        try {
            Object result = apiInstance.frequencyByInterval(seqId, position, length);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling FrequencyNotYetAvailableComingSoonApi#frequencyByInterval");
            e.printStackTrace();
        }
    }
}
import org.pharmgkb.io.ncbi.*;
import org.pharmgkb.io.ncbi.auth.*;
import org.pharmgkb.io.ncbi.model.*;
import org.pharmgkb.io.ncbi.api.FrequencyNotYetAvailableComingSoonApi;

import java.io.File;
import java.util.*;

public class FrequencyNotYetAvailableComingSoonApiExample {

    public static void main(String[] args) {
        
        FrequencyNotYetAvailableComingSoonApi apiInstance = new FrequencyNotYetAvailableComingSoonApi();
        try {
            Map result = apiInstance.frequencyMetadata();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling FrequencyNotYetAvailableComingSoonApi#frequencyMetadata");
            e.printStackTrace();
        }
    }
}

Documentation for API Endpoints

All URIs are relative to https://api.ncbi.nlm.nih.gov/variation/v0

Class Method HTTP request Description
FrequencyNotYetAvailableComingSoonApi frequencyByInterval GET /interval/{seq_id}:{position}:{length}/overlapping_frequency_records Retrieve frequencies for variants overlapping a position range
FrequencyNotYetAvailableComingSoonApi frequencyMetadata GET /metadata/frequency Retrieve frequency metadata
HgvsApi hgvsBatchContextualsPost POST /hgvs/batch/contextuals Retrieve contextual alleles for each input
HgvsApi hgvsHgvsContextualsGet GET /hgvs/{hgvs}/contextuals Retrieve the contextual alleles equivalent to the HGVS notation input
RefSnpApi betaRefsnpRsidGet GET /beta/refsnp/{rsid} Lookup RefSNP object by RSID
SpdiApi spdiSpdiAllEquivalentContextualGet GET /spdi/{spdi}/all_equivalent_contextual Retrieve equivalent contextual allele on all aligned sequences
SpdiApi spdiSpdiCanonicalRepresentativeGet GET /spdi/{spdi}/canonical_representative Retrieve canonical allele representative
SpdiApi spdiSpdiContextualGet GET /spdi/{spdi}/contextual Retrieve contextual allele in SPDI syntax for provided allele
SpdiApi spdiSpdiHgvsGet GET /spdi/{spdi}/hgvs Retrieve HGVS notation for contextual allele in SPDI Syntax
SpdiApi spdiSpdiRsidsGet GET /spdi/{spdi}/rsids Lookup the RSIDs (if any) associated with the input allele
SpdiApi spdiSpdiVcfFieldsGet GET /spdi/{spdi}/vcf_fields Retrieve fields suitable for representing the input allele in VCF
VcfApi vcfChromPosRefAltsContextualsGet GET /vcf/{chrom}/{pos}/{ref}/{alts}/contextuals Retrieve contextual alleles for the reference allele and each alternate allele
VcfApi vcfFileSetRsidsPost POST /vcf/file/set_rsids For provided VCF data, add RSIDs in the ID field

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization. Authentication schemes defined for the API:

Recommendation

It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.

Author

[email protected]

About

Java wrapper for NCBI Variation API Services

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages