Esempio n. 1
0
def build_color_preferences(mapping_file_tuple):
    """defines and calculates color prefrences for alpha_rarefaction plots

	Inputs:
	mapping_file_tuple: parsed mapping file information i. e. (data, headers)

	Outputs:
	A list containing color_prefs, data, background_color, label_color for usage
	with make_averages or any other qiime visualization module
	"""
    data = {}

    # format the mapping file for use with process_by_color
    mapping_file_data, mapping_file_headers = mapping_file_tuple
    formatted_mapping_file = [mapping_file_headers]
    formatted_mapping_file.extend(mapping_file_data)
    data['map'] = formatted_mapping_file

    background_color = 'black'
    label_color = 'white'

    # the colors will only be based on the data
    color_prefs, data = process_colorby(None, data, None)

    return color_prefs, data, background_color, label_color
Esempio n. 2
0
def build_color_preferences(mapping_file_tuple):
	"""defines and calculates color prefrences for alpha_rarefaction plots

	Inputs:
	mapping_file_tuple: parsed mapping file information i. e. (data, headers)

	Outputs:
	A list containing color_prefs, data, background_color, label_color for usage
	with make_averages or any other qiime visualization module
	"""
	data = {}

	# format the mapping file for use with process_by_color
	mapping_file_data, mapping_file_headers = mapping_file_tuple
	formatted_mapping_file =[mapping_file_headers]
	formatted_mapping_file.extend(mapping_file_data)
	data['map']= formatted_mapping_file

	background_color='black'
	label_color='white'

	# the colors will only be based on the data
	color_prefs, data = process_colorby(None, data, None)

	return color_prefs, data, background_color, label_color
Esempio n. 3
0
    def test_process_colorby(self):
        """process_colorby: parses the cmd line and determines which columns \
from mapping file to color by"""
        self.colorby = 'Day'
        exp1 = {}
        exp1['Day'] = {'column': 'Day'}
        obs1, obs2 = process_colorby(self.colorby, self.data)

        self.assertEqual(obs1, exp1)
        self.assertEqual(obs2, self.data)
Esempio n. 4
0
    def test_process_colorby(self):
        """process_colorby: parses the cmd line and determines which columns \
from mapping file to color by"""
        self.colorby = 'Day'
        exp1 = {}
        exp1['Day'] = {'column': 'Day'}
        obs1, obs2 = process_colorby(self.colorby, self.data)

        self.assertEqual(obs1, exp1)
        self.assertEqual(obs2, self.data)
Esempio n. 5
0
    def test_process_colorby(self):
        """process_colorby: parses the cmd line and determines which columns \
from mapping file to color by"""
        self.colorby = "Day"
        exp1 = {}
        exp1["Day"] = {"column": "Day"}
        obs1, obs2 = process_colorby(self.colorby, self.data)

        self.assertEqual(obs1, exp1)
        self.assertEqual(obs2, self.data)