Skip to content

OpenVariant

logo_open_variant

Description

OpenVariant is a comprehensive Python package that provides different functionalities to read, parse and operate different multiple input file formats (e. g. tsv, csv, vcf, maf, bed), being able to build an unified output with a proper annotation file structure.

Usage

Click here to see the installation guide and the complete documentation of OpenVariant.

When working with OpenVariant, we need to distinguish 3 different types of files: input files and annotation file, which are provided by the user and output file, which will returned from the function.

  • Input files will be the group of files in different formats (e.g. tsv, csv, vcf, maf, bed) that we want to parse.
  • Annotation file is a YAML file which describes how the input files are processed and how the output file will look like.
  • Output files are generated by OpenVariant and they are the result of the process.

Functions

OpenVariant has several functions to perform different tasks:

  • find_files: Find files with a given pattern name in a given folder.
  • Variant: Parse an input file through the annotation file. It will generate an object which you can apply different functionalities
  • cat: It will show on the stdout (standard out) the whole parsed output.
  • group_by: It will generate an iterator that will contain three variables: group_key (the value of each group), group_result (a list of all rows that pertain to each group) and command (if it uses the script parameter or not). It will group the parsed result for each different value of the specified key_by.
  • count: It returns the number of rows that matches a specific conditions.

Click here to see several examples of each of the functions from OpenVariant.

Parameters

The different options and parameters of these functions are specified in the annotation file, which has several required and optional parameters.
Click here to learn about the parameters in the annotation file and a to see a template of the annotation file.

Reference

  • David Martínez
  • Paula Gomis