Package for data handling — GPTwoSample 0.1.7a documentation

### Navigation

- index
- modules |
- previous |
- GPTwoSample 0.1.7a documentation »

# Package for data handling

Use this Package for easiest way to handle the data for GPTwoSample.

## Data Structure Module

This Module is for easy access to data structures gptwosample works with.

Created on Mar 18, 2011

@author: Max Zwiessele

exception `gptwosample.data.data_base.` `DataStructureError`(*args, **kwargs)

  Bases: `exceptions.TypeError`

  Thrown, if DataStructure given does not fit. Training data training_data has following structure:

      {input_id : {'group 1':[double] ... 'group n':[double]},
       output_id : {'group 1':[double] ... 'group n':[double]}}

`gptwosample.data.data_base.` `get_model_structure`(individual=None, common=None)

  Returns the valid structure for model dictionaries, used in gptwosample. Make sure to use this method if you want to use the model structure in this package!

`gptwosample.data.data_base.` `get_training_data_structure`(x1, x2, y1, y2)

  Get the structure for training data, given two inputs x1 and x2 with corresponding outputs y1 and y2. Make sure, that replicates have to be tiled one after the other for proper resampling of data!

`gptwosample.data.data_base.` `has_model_structure`(structure)

  Returns the valid structure for model dictionaries, used in gptwosample. Make sure to use this method if you want to use the model structure in this package!

## Data IO tool

For convienent usage this module provides IO operations for data

Created on Jun 9, 2011

@author: Max Zwiessele, Oliver Stegle

`gptwosample.data.dataIO.` `get_data_from_csv`(path_to_file, delimiter=', ', count=-1, verbose=True, message='Reading File', fil=None)

  Return data from csv file with delimiter delimiter in form of a dictionary. Missing Values are all values x which cannot be converted float(x)

  The file format has to fullfill following formation:

  arbitrary | x1 | ... | xl
  --- | --- | --- | ---
  Gene Name 1 | y1 replicate 1 | ... | yl replicate 1
  ... | ... | ... | ...
  Gene Name 1 | y1 replicate k1 | ... | yl replicate k1
  ... |  |  |
  Gene Name n | y1 replicate 1 | ... | yl replicate 1
  ... | ... | ... | ...
  Gene Name n | y1 replicate kn | ... | yl replicate kn

  Returns: {“input”:[x1,...,xl], “Gene Name 1”:[[y1 replicate 1, ... yl replicate 1], ... ,[y1 replicate k, ..., yl replikate k]]}

`gptwosample.data.dataIO.` `write_data_to_csv`(data, path_to_file, header='GPTwoSample', delimiter=', ')

  Write given data in training_data_structure (see `gptwosample.data.data_base` for details) into file for path_to_file.

  Parameters:

  data : dict
    data to write in training_data_structure
  path_to_file : String
    The path to the file to write to
  header : String
    Name of the table
  delimiter : character
    delimiter for the csv file

### Navigation

- index
- modules |
- previous |
- GPTwoSample 0.1.7a documentation »