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)[source]

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)[source]

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)[source]

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)[source]

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)[source]

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=', ')[source]

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

Table Of Contents

Previous topic

GPTwoSample plot