openvariant.variant package#

Submodules#

openvariant.variant.variant module#

Variant#

A core class to represent the files that will be parsed by an Annotation file.

class openvariant.variant.variant.Variant(path: str, annotation: openvariant.annotation.annotation.Annotation, skip_files: bool = False)[source]

Bases: object

A representation of parsed files

read(group_key: str or None = None)[source]

Read the parsed files with its proper annotation.

save(file_path: str, display_header: bool = True)[source]

Save parsed files on specified location.

property annotation: openvariant.annotation.annotation.Annotation

Annotation object which files were parsed

Type

Annotation

property header: List[str]

Header of the corresponding parsed files

Type

List[str]

property path: str

Path where parsed files are located

Type

str

read(where: Optional[dict] = None, group_key: Optional[str] = None) Generator[dict, None, None][source]

Read parsed files and generated an iterator for each row

Parameters
  • where (dict or str) – A conditional where structure (optional).

  • group_key (str or None) – A string that indicates how rows will be grouped (optional).

Yields

dict – Representation of a parsed row.

save(file_path: str, mode: str = 'w', display_header: bool = True) None[source]

Save parsed files in an indicated location.

Parameters
  • file_path (str or None) – A string that indicates the location to store the output file.

  • mode (string) – Two modes for writing (optional): ‘w’ the cursor starts at the begging of the file. ‘a’ the cursor starts at the end of the file.

  • display_header (bool) – A bool that indicates if the output will have header or not (optional).

Module contents#

class openvariant.variant.Variant(path: str, annotation: openvariant.annotation.annotation.Annotation, skip_files: bool = False)[source]

Bases: object

A representation of parsed files

read(group_key: str or None = None)[source]

Read the parsed files with its proper annotation.

save(file_path: str, display_header: bool = True)[source]

Save parsed files on specified location.

property annotation: openvariant.annotation.annotation.Annotation

Annotation object which files were parsed

Type

Annotation

property header: List[str]

Header of the corresponding parsed files

Type

List[str]

property path: str

Path where parsed files are located

Type

str

read(where: Optional[dict] = None, group_key: Optional[str] = None) Generator[dict, None, None][source]

Read parsed files and generated an iterator for each row

Parameters
  • where (dict or str) – A conditional where structure (optional).

  • group_key (str or None) – A string that indicates how rows will be grouped (optional).

Yields

dict – Representation of a parsed row.

save(file_path: str, mode: str = 'w', display_header: bool = True) None[source]

Save parsed files in an indicated location.

Parameters
  • file_path (str or None) – A string that indicates the location to store the output file.

  • mode (string) – Two modes for writing (optional): ‘w’ the cursor starts at the begging of the file. ‘a’ the cursor starts at the end of the file.

  • display_header (bool) – A bool that indicates if the output will have header or not (optional).