# Genomics API . variants

## Instance Methods

Creates a new variant.

Deletes a variant.

Gets a variant by ID.

Gets a list of variants matching the criteria.

Updates a variant's names and info fields. All other modifications are silently ignored. Returns the modified variant without its calls.

### Method Details

`create(body)`

    Creates a new variant.

    Args:
      body: object, The request body. (required)
        The object takes the form of:

    { # A variant represents a change in DNA sequence relative to a reference sequence. For example, a variant could represent a SNP or an insertion. Variants belong to a variant set. Each of the calls on a variant represent a determination of genotype with respect to that variant. For example, a call might assign probability of 0.32 to the occurrence of a SNP named rs1234 in a sample named NA12345. A call belongs to a call set, which contains related calls typically from one sample.
        "info": { # A map of additional variant information.
          "a_key": [ # A string which maps to an array of values.
            "A String",
          ],
        },
        "variantSetId": "A String", # The ID of the variant set this variant belongs to.
        "end": "A String", # The end position (0-based) of this variant. This corresponds to the first base after the last base in the reference allele. So, the length of the reference allele is (end - start). This is useful for variants that don't explicitly give alternate bases, for example large deletions.
        "calls": [ # The variant calls for this particular variant. Each one represents the determination of genotype with respect to this variant.
          { # A call represents the determination of genotype with respect to a particular variant. It may include associated information such as quality and phasing. For example, a call might assign a probability of 0.32 to the occurrence of a SNP named rs1234 in a call set with the name NA12345.
            "info": { # A map of additional variant call information.
              "a_key": [ # A string which maps to an array of values.
                "A String",
              ],
            },
            "genotype": [ # The genotype of this variant call. Each value represents either the value of the referenceBases field or a 1-based index into alternateBases. If a variant had a referenceBases value of T and an alternateBases value of ["A", "C"], and the genotype was [2, 1], that would mean the call represented the heterozygous value CA for this variant. If the genotype was instead [0, 1], the represented value would be TA. Ordering of the genotype values is important if the phaseset is present. If a genotype is not called (that is, a . is present in the GT string) -1 is returned.
              42,
            ],
            "callSetId": "A String", # The ID of the call set this variant call belongs to.
            "phaseset": "A String", # If this field is present, this variant call's genotype ordering implies the phase of the bases and is consistent with any other variant calls in the same reference sequence which have the same phaseset value. When importing data from VCF, if the genotype data was phased but no phase set was specified this field will be set to *.
            "genotypeLikelihood": [ # The genotype likelihoods for this variant call. Each array entry represents how likely a specific genotype is for this call. The value ordering is defined by the GL tag in the VCF spec. If Phred-scaled genotype likelihood scores (PL) are available and log10(P) genotype likelihood scores (GL) are not, PL scores are converted to GL scores. If both are available, PL scores are stored in info.
              3.14,
            ],
            "callSetName": "A String", # The name of the call set this variant call belongs to.
          },
        ],
        "created": "A String", # The date this variant was created, in milliseconds from the epoch.
        "referenceBases": "A String", # The reference bases for this variant. They start at the given position.
        "filter": [ # A list of filters (normally quality filters) this variant has failed. PASS indicates this variant has passed all filters.
          "A String",
        ],
        "start": "A String", # The position at which this variant occurs (0-based). This corresponds to the first base of the string of reference bases.
        "names": [ # Names for the variant, for example a RefSNP ID.
          "A String",
        ],
        "alternateBases": [ # The bases that appear instead of the reference bases.
          "A String",
        ],
        "referenceName": "A String", # The reference on which this variant occurs. (such as chr20 or X)
        "quality": 3.14, # A measure of how likely this variant is to be real. A higher value is better.
        "id": "A String", # The Google generated ID of the variant, immutable.
      }

    Returns:
      An object of the form:

        { # A variant represents a change in DNA sequence relative to a reference sequence. For example, a variant could represent a SNP or an insertion. Variants belong to a variant set. Each of the calls on a variant represent a determination of genotype with respect to that variant. For example, a call might assign probability of 0.32 to the occurrence of a SNP named rs1234 in a sample named NA12345. A call belongs to a call set, which contains related calls typically from one sample.
          "info": { # A map of additional variant information.
            "a_key": [ # A string which maps to an array of values.
              "A String",
            ],
          },
          "variantSetId": "A String", # The ID of the variant set this variant belongs to.
          "end": "A String", # The end position (0-based) of this variant. This corresponds to the first base after the last base in the reference allele. So, the length of the reference allele is (end - start). This is useful for variants that don't explicitly give alternate bases, for example large deletions.
          "calls": [ # The variant calls for this particular variant. Each one represents the determination of genotype with respect to this variant.
            { # A call represents the determination of genotype with respect to a particular variant. It may include associated information such as quality and phasing. For example, a call might assign a probability of 0.32 to the occurrence of a SNP named rs1234 in a call set with the name NA12345.
              "info": { # A map of additional variant call information.
                "a_key": [ # A string which maps to an array of values.
                  "A String",
                ],
              },
              "genotype": [ # The genotype of this variant call. Each value represents either the value of the referenceBases field or a 1-based index into alternateBases. If a variant had a referenceBases value of T and an alternateBases value of ["A", "C"], and the genotype was [2, 1], that would mean the call represented the heterozygous value CA for this variant. If the genotype was instead [0, 1], the represented value would be TA. Ordering of the genotype values is important if the phaseset is present. If a genotype is not called (that is, a . is present in the GT string) -1 is returned.
                42,
              ],
              "callSetId": "A String", # The ID of the call set this variant call belongs to.
              "phaseset": "A String", # If this field is present, this variant call's genotype ordering implies the phase of the bases and is consistent with any other variant calls in the same reference sequence which have the same phaseset value. When importing data from VCF, if the genotype data was phased but no phase set was specified this field will be set to *.
              "genotypeLikelihood": [ # The genotype likelihoods for this variant call. Each array entry represents how likely a specific genotype is for this call. The value ordering is defined by the GL tag in the VCF spec. If Phred-scaled genotype likelihood scores (PL) are available and log10(P) genotype likelihood scores (GL) are not, PL scores are converted to GL scores. If both are available, PL scores are stored in info.
                3.14,
              ],
              "callSetName": "A String", # The name of the call set this variant call belongs to.
            },
          ],
          "created": "A String", # The date this variant was created, in milliseconds from the epoch.
          "referenceBases": "A String", # The reference bases for this variant. They start at the given position.
          "filter": [ # A list of filters (normally quality filters) this variant has failed. PASS indicates this variant has passed all filters.
            "A String",
          ],
          "start": "A String", # The position at which this variant occurs (0-based). This corresponds to the first base of the string of reference bases.
          "names": [ # Names for the variant, for example a RefSNP ID.
            "A String",
          ],
          "alternateBases": [ # The bases that appear instead of the reference bases.
            "A String",
          ],
          "referenceName": "A String", # The reference on which this variant occurs. (such as chr20 or X)
          "quality": 3.14, # A measure of how likely this variant is to be real. A higher value is better.
          "id": "A String", # The Google generated ID of the variant, immutable.
        }

`delete(variantId)`

    Deletes a variant.

    Args:
      variantId: string, The ID of the variant to be deleted. (required)

`get(variantId)`

    Gets a variant by ID.

    Args:
      variantId: string, The ID of the variant. (required)

    Returns:
      An object of the form:

        { # A variant represents a change in DNA sequence relative to a reference sequence. For example, a variant could represent a SNP or an insertion. Variants belong to a variant set. Each of the calls on a variant represent a determination of genotype with respect to that variant. For example, a call might assign probability of 0.32 to the occurrence of a SNP named rs1234 in a sample named NA12345. A call belongs to a call set, which contains related calls typically from one sample.
          "info": { # A map of additional variant information.
            "a_key": [ # A string which maps to an array of values.
              "A String",
            ],
          },
          "variantSetId": "A String", # The ID of the variant set this variant belongs to.
          "end": "A String", # The end position (0-based) of this variant. This corresponds to the first base after the last base in the reference allele. So, the length of the reference allele is (end - start). This is useful for variants that don't explicitly give alternate bases, for example large deletions.
          "calls": [ # The variant calls for this particular variant. Each one represents the determination of genotype with respect to this variant.
            { # A call represents the determination of genotype with respect to a particular variant. It may include associated information such as quality and phasing. For example, a call might assign a probability of 0.32 to the occurrence of a SNP named rs1234 in a call set with the name NA12345.
              "info": { # A map of additional variant call information.
                "a_key": [ # A string which maps to an array of values.
                  "A String",
                ],
              },
              "genotype": [ # The genotype of this variant call. Each value represents either the value of the referenceBases field or a 1-based index into alternateBases. If a variant had a referenceBases value of T and an alternateBases value of ["A", "C"], and the genotype was [2, 1], that would mean the call represented the heterozygous value CA for this variant. If the genotype was instead [0, 1], the represented value would be TA. Ordering of the genotype values is important if the phaseset is present. If a genotype is not called (that is, a . is present in the GT string) -1 is returned.
                42,
              ],
              "callSetId": "A String", # The ID of the call set this variant call belongs to.
              "phaseset": "A String", # If this field is present, this variant call's genotype ordering implies the phase of the bases and is consistent with any other variant calls in the same reference sequence which have the same phaseset value. When importing data from VCF, if the genotype data was phased but no phase set was specified this field will be set to *.
              "genotypeLikelihood": [ # The genotype likelihoods for this variant call. Each array entry represents how likely a specific genotype is for this call. The value ordering is defined by the GL tag in the VCF spec. If Phred-scaled genotype likelihood scores (PL) are available and log10(P) genotype likelihood scores (GL) are not, PL scores are converted to GL scores. If both are available, PL scores are stored in info.
                3.14,
              ],
              "callSetName": "A String", # The name of the call set this variant call belongs to.
            },
          ],
          "created": "A String", # The date this variant was created, in milliseconds from the epoch.
          "referenceBases": "A String", # The reference bases for this variant. They start at the given position.
          "filter": [ # A list of filters (normally quality filters) this variant has failed. PASS indicates this variant has passed all filters.
            "A String",
          ],
          "start": "A String", # The position at which this variant occurs (0-based). This corresponds to the first base of the string of reference bases.
          "names": [ # Names for the variant, for example a RefSNP ID.
            "A String",
          ],
          "alternateBases": [ # The bases that appear instead of the reference bases.
            "A String",
          ],
          "referenceName": "A String", # The reference on which this variant occurs. (such as chr20 or X)
          "quality": 3.14, # A measure of how likely this variant is to be real. A higher value is better.
          "id": "A String", # The Google generated ID of the variant, immutable.
        }

`search(body)`

    Gets a list of variants matching the criteria.

    Implements GlobalAllianceApi.searchVariants.

    Args:
      body: object, The request body. (required)
        The object takes the form of:

    { # The variant search request.
        "end": "A String", # Required. The end of the window (0-based, exclusive) for which overlapping variants should be returned.
        "pageSize": 42, # The maximum number of variants to return.
        "start": "A String", # Required. The beginning of the window (0-based, inclusive) for which overlapping variants should be returned.
        "maxCalls": 42, # The maximum number of calls to return. However, at least one variant will always be returned, even if it has more calls than this limit.
        "pageToken": "A String", # The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.
        "callSetIds": [ # Only return variant calls which belong to call sets with these ids. Leaving this blank returns all variant calls. If a variant has no calls belonging to any of these call sets, it won't be returned at all. Currently, variants with no calls from any call set will never be returned.
          "A String",
        ],
        "variantName": "A String", # Only return variants which have exactly this name.
        "referenceName": "A String", # Required. Only return variants in this reference sequence.
        "variantSetIds": [ # Exactly one variant set ID must be provided. Only variants from this variant set will be returned.
          "A String",
        ],
      }

    Returns:
      An object of the form:

        { # The variant search response.
        "nextPageToken": "A String", # The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results. This field will be empty if there aren't any additional results.
        "variants": [ # The list of matching Variants.
          { # A variant represents a change in DNA sequence relative to a reference sequence. For example, a variant could represent a SNP or an insertion. Variants belong to a variant set. Each of the calls on a variant represent a determination of genotype with respect to that variant. For example, a call might assign probability of 0.32 to the occurrence of a SNP named rs1234 in a sample named NA12345. A call belongs to a call set, which contains related calls typically from one sample.
              "info": { # A map of additional variant information.
                "a_key": [ # A string which maps to an array of values.
                  "A String",
                ],
              },
              "variantSetId": "A String", # The ID of the variant set this variant belongs to.
              "end": "A String", # The end position (0-based) of this variant. This corresponds to the first base after the last base in the reference allele. So, the length of the reference allele is (end - start). This is useful for variants that don't explicitly give alternate bases, for example large deletions.
              "calls": [ # The variant calls for this particular variant. Each one represents the determination of genotype with respect to this variant.
                { # A call represents the determination of genotype with respect to a particular variant. It may include associated information such as quality and phasing. For example, a call might assign a probability of 0.32 to the occurrence of a SNP named rs1234 in a call set with the name NA12345.
                  "info": { # A map of additional variant call information.
                    "a_key": [ # A string which maps to an array of values.
                      "A String",
                    ],
                  },
                  "genotype": [ # The genotype of this variant call. Each value represents either the value of the referenceBases field or a 1-based index into alternateBases. If a variant had a referenceBases value of T and an alternateBases value of ["A", "C"], and the genotype was [2, 1], that would mean the call represented the heterozygous value CA for this variant. If the genotype was instead [0, 1], the represented value would be TA. Ordering of the genotype values is important if the phaseset is present. If a genotype is not called (that is, a . is present in the GT string) -1 is returned.
                    42,
                  ],
                  "callSetId": "A String", # The ID of the call set this variant call belongs to.
                  "phaseset": "A String", # If this field is present, this variant call's genotype ordering implies the phase of the bases and is consistent with any other variant calls in the same reference sequence which have the same phaseset value. When importing data from VCF, if the genotype data was phased but no phase set was specified this field will be set to *.
                  "genotypeLikelihood": [ # The genotype likelihoods for this variant call. Each array entry represents how likely a specific genotype is for this call. The value ordering is defined by the GL tag in the VCF spec. If Phred-scaled genotype likelihood scores (PL) are available and log10(P) genotype likelihood scores (GL) are not, PL scores are converted to GL scores. If both are available, PL scores are stored in info.
                    3.14,
                  ],
                  "callSetName": "A String", # The name of the call set this variant call belongs to.
                },
              ],
              "created": "A String", # The date this variant was created, in milliseconds from the epoch.
              "referenceBases": "A String", # The reference bases for this variant. They start at the given position.
              "filter": [ # A list of filters (normally quality filters) this variant has failed. PASS indicates this variant has passed all filters.
                "A String",
              ],
              "start": "A String", # The position at which this variant occurs (0-based). This corresponds to the first base of the string of reference bases.
              "names": [ # Names for the variant, for example a RefSNP ID.
                "A String",
              ],
              "alternateBases": [ # The bases that appear instead of the reference bases.
                "A String",
              ],
              "referenceName": "A String", # The reference on which this variant occurs. (such as chr20 or X)
              "quality": 3.14, # A measure of how likely this variant is to be real. A higher value is better.
              "id": "A String", # The Google generated ID of the variant, immutable.
            },
        ],
      }

`update(variantId, body)`

    Updates a variant's names and info fields. All other modifications are silently ignored. Returns the modified variant without its calls.

    Args:
      variantId: string, The ID of the variant to be updated. (required)
      body: object, The request body. (required)
        The object takes the form of:

    { # A variant represents a change in DNA sequence relative to a reference sequence. For example, a variant could represent a SNP or an insertion. Variants belong to a variant set. Each of the calls on a variant represent a determination of genotype with respect to that variant. For example, a call might assign probability of 0.32 to the occurrence of a SNP named rs1234 in a sample named NA12345. A call belongs to a call set, which contains related calls typically from one sample.
        "info": { # A map of additional variant information.
          "a_key": [ # A string which maps to an array of values.
            "A String",
          ],
        },
        "variantSetId": "A String", # The ID of the variant set this variant belongs to.
        "end": "A String", # The end position (0-based) of this variant. This corresponds to the first base after the last base in the reference allele. So, the length of the reference allele is (end - start). This is useful for variants that don't explicitly give alternate bases, for example large deletions.
        "calls": [ # The variant calls for this particular variant. Each one represents the determination of genotype with respect to this variant.
          { # A call represents the determination of genotype with respect to a particular variant. It may include associated information such as quality and phasing. For example, a call might assign a probability of 0.32 to the occurrence of a SNP named rs1234 in a call set with the name NA12345.
            "info": { # A map of additional variant call information.
              "a_key": [ # A string which maps to an array of values.
                "A String",
              ],
            },
            "genotype": [ # The genotype of this variant call. Each value represents either the value of the referenceBases field or a 1-based index into alternateBases. If a variant had a referenceBases value of T and an alternateBases value of ["A", "C"], and the genotype was [2, 1], that would mean the call represented the heterozygous value CA for this variant. If the genotype was instead [0, 1], the represented value would be TA. Ordering of the genotype values is important if the phaseset is present. If a genotype is not called (that is, a . is present in the GT string) -1 is returned.
              42,
            ],
            "callSetId": "A String", # The ID of the call set this variant call belongs to.
            "phaseset": "A String", # If this field is present, this variant call's genotype ordering implies the phase of the bases and is consistent with any other variant calls in the same reference sequence which have the same phaseset value. When importing data from VCF, if the genotype data was phased but no phase set was specified this field will be set to *.
            "genotypeLikelihood": [ # The genotype likelihoods for this variant call. Each array entry represents how likely a specific genotype is for this call. The value ordering is defined by the GL tag in the VCF spec. If Phred-scaled genotype likelihood scores (PL) are available and log10(P) genotype likelihood scores (GL) are not, PL scores are converted to GL scores. If both are available, PL scores are stored in info.
              3.14,
            ],
            "callSetName": "A String", # The name of the call set this variant call belongs to.
          },
        ],
        "created": "A String", # The date this variant was created, in milliseconds from the epoch.
        "referenceBases": "A String", # The reference bases for this variant. They start at the given position.
        "filter": [ # A list of filters (normally quality filters) this variant has failed. PASS indicates this variant has passed all filters.
          "A String",
        ],
        "start": "A String", # The position at which this variant occurs (0-based). This corresponds to the first base of the string of reference bases.
        "names": [ # Names for the variant, for example a RefSNP ID.
          "A String",
        ],
        "alternateBases": [ # The bases that appear instead of the reference bases.
          "A String",
        ],
        "referenceName": "A String", # The reference on which this variant occurs. (such as chr20 or X)
        "quality": 3.14, # A measure of how likely this variant is to be real. A higher value is better.
        "id": "A String", # The Google generated ID of the variant, immutable.
      }

    Returns:
      An object of the form:

        { # A variant represents a change in DNA sequence relative to a reference sequence. For example, a variant could represent a SNP or an insertion. Variants belong to a variant set. Each of the calls on a variant represent a determination of genotype with respect to that variant. For example, a call might assign probability of 0.32 to the occurrence of a SNP named rs1234 in a sample named NA12345. A call belongs to a call set, which contains related calls typically from one sample.
          "info": { # A map of additional variant information.
            "a_key": [ # A string which maps to an array of values.
              "A String",
            ],
          },
          "variantSetId": "A String", # The ID of the variant set this variant belongs to.
          "end": "A String", # The end position (0-based) of this variant. This corresponds to the first base after the last base in the reference allele. So, the length of the reference allele is (end - start). This is useful for variants that don't explicitly give alternate bases, for example large deletions.
          "calls": [ # The variant calls for this particular variant. Each one represents the determination of genotype with respect to this variant.
            { # A call represents the determination of genotype with respect to a particular variant. It may include associated information such as quality and phasing. For example, a call might assign a probability of 0.32 to the occurrence of a SNP named rs1234 in a call set with the name NA12345.
              "info": { # A map of additional variant call information.
                "a_key": [ # A string which maps to an array of values.
                  "A String",
                ],
              },
              "genotype": [ # The genotype of this variant call. Each value represents either the value of the referenceBases field or a 1-based index into alternateBases. If a variant had a referenceBases value of T and an alternateBases value of ["A", "C"], and the genotype was [2, 1], that would mean the call represented the heterozygous value CA for this variant. If the genotype was instead [0, 1], the represented value would be TA. Ordering of the genotype values is important if the phaseset is present. If a genotype is not called (that is, a . is present in the GT string) -1 is returned.
                42,
              ],
              "callSetId": "A String", # The ID of the call set this variant call belongs to.
              "phaseset": "A String", # If this field is present, this variant call's genotype ordering implies the phase of the bases and is consistent with any other variant calls in the same reference sequence which have the same phaseset value. When importing data from VCF, if the genotype data was phased but no phase set was specified this field will be set to *.
              "genotypeLikelihood": [ # The genotype likelihoods for this variant call. Each array entry represents how likely a specific genotype is for this call. The value ordering is defined by the GL tag in the VCF spec. If Phred-scaled genotype likelihood scores (PL) are available and log10(P) genotype likelihood scores (GL) are not, PL scores are converted to GL scores. If both are available, PL scores are stored in info.
                3.14,
              ],
              "callSetName": "A String", # The name of the call set this variant call belongs to.
            },
          ],
          "created": "A String", # The date this variant was created, in milliseconds from the epoch.
          "referenceBases": "A String", # The reference bases for this variant. They start at the given position.
          "filter": [ # A list of filters (normally quality filters) this variant has failed. PASS indicates this variant has passed all filters.
            "A String",
          ],
          "start": "A String", # The position at which this variant occurs (0-based). This corresponds to the first base of the string of reference bases.
          "names": [ # Names for the variant, for example a RefSNP ID.
            "A String",
          ],
          "alternateBases": [ # The bases that appear instead of the reference bases.
            "A String",
          ],
          "referenceName": "A String", # The reference on which this variant occurs. (such as chr20 or X)
          "quality": 3.14, # A measure of how likely this variant is to be real. A higher value is better.
          "id": "A String", # The Google generated ID of the variant, immutable.
        }