Package biana :: Package BianaObjects :: Module BianaSessionManager :: Class BianaSessionManager
[hide private]
[frames] | no frames]

Class BianaSessionManager

source code


A class to represent a BianaNetworkManager

A BianaNetworkManager is composed of one or several userEntity(s) and one BianaDBaccess object

Instance Methods [hide private]
 
__init__(self, pSessionID, unification_protocol_name, dbname, dbhost, dbuser=None, dbpassword=None, dbport=None, out_method=None)
Starts a new BIANA Working session ------ pSessionID: identifier for current session object unification_protocol_name: name of the unification protocol to be used while retrieving data from database dbname: name of the mysql database to be used dbhost: host where mysql database resides dbuser: user for the given mysql database dbpassword: password for the given mysql database and host dbport: port for mysql database connection, if None default value is used out_method: is where biana session manager has to inform about changes
source code
 
__getstate__(self)
Get state of the session for [c]pickle.dump()
source code
 
__setstate__(self, dict)
Get state of the session for [c]pickle.load() ------ dict: the dictionary of a previously created and saved BianaSessionManager object
source code
 
close(self) source code
 
reconnect(self) source code
 
_send_complete_user_entity_set_info(self, user_entity_set)
Sends information of given userEntitySet in xml format through self.outmethod ------ user_entity_set: an instance of user entity set
source code
 
get_ontology(self, ontology_name, root_attribute_values=[])
Fetchs the ontology structure identifier by ontology_name ------ ontology_name: name of the ontology to be retrieved from database root_attribute_values: list of values used in selecting roots of ontology by attribute
source code
 
get_user_entity_set(self, user_entity_set_id)
returns the user entity set object with the name "user_entity_set_id" ------ user_entity_set_id: identifier of user entity set to be returned
source code
 
select_user_entity_set(self, user_entity_set_id)
Method for selecting a user entity set ------ user_entity_set_id: identifier of user entity set to be selected
source code
 
describe_user_entity_set(self, user_entity_set_id)
Method to print into the biana interface the description of the User Entity ID identified by "user_entity_set_id"
source code
 
get_selected_user_entity_set_ids(self)
Returns list of identifiers of selected user entity sets
source code
 
clear_selected_user_entity_sets(self)
Clears selection of user entity sets
source code
 
read_identifier_list_from_file(self, file_name, id_type=None)
File either contains an identifier per line or (attribute_name, identifier) couple on each line
source code
 
detectIdentifierType(self, id)
Return auto-detected type of the given id
source code
 
_convert_attribute_list_to_attribute_dictionary(self, identifier_description_list, attribute_name)
Returns dictionary containing identifier types mapped to identifiers created from given list of identifiers ------ identifier_description_list: list of identifiers (or (identifier, id_type) tuples in case id_type is "embedded") id_type: type of the identifiers in the file, if "embedded" then file contains (attribute_name, identifier) tuples instead of just identifiers
source code
 
_get_next_uEs_id(self)
Private method to obtain automatically the next user entity set default id
source code
 
duplicate_user_entity_set(self, user_entity_set_id, new_user_entity_set_id)
Returns an exact copy of user entity set object with given id ------ user_entity_set_id: id of user entity set to be duplicated user_entity_set_id_new: id of created copy of user entity set
source code
 
create_randomized_user_entity_set(self, user_entity_set_id, new_user_entity_set_id, type_randomization)
Creates a new user entity set with randomized network from given user entity set ------ user_entity_set_id: id of the user entity set whose copy with random network is going to be created new_user_entity_set_id: id for the created copy of user entity set type_randomization: randomization type to be used in network randomization, can be one of the following: "random", "preserve_topology", "preserve_topology_and_node_degree", "preserve_degree_distribution", "preserve_degree_distribution_and_node_degree"
source code
 
randomize_user_entity_set_network(self, user_entity_set_id, type_randomization)
Randomizes network of a given user entity set.
source code
 
create_new_user_entity_set(self, identifier_description_list, id_type='embedded', new_user_entity_set_id=None, attribute_restriction_list=[], negative_attribute_restriction_list=[], external_database_restrictions=[])
create userEntity objects from given externalEntity ids (or get if already existing) then add them to a userEntitySet ------ identifier_description_list: list with external identifiers of the nodes in the set provided by user id_type: either list of attrubutes defined in EXTERNAL_ENTITY_TABLES or "embedded" meaning identifier_description_list is a list of (id_type, identifier) tuple in the form [(type1, id1), (type2, id2), ..., (typeN, idN)] new_user_entity_set_id: identifier of the set provided by the user attribute_restriction_list: list of tuples provided by the user containing external entity attribute restrictons to be applied.
source code
 
_get_user_entity_set_xml(self, user_entity_set_obj, level=None) source code
 
remove_user_entity_set(self, user_entity_set_id)
Remove user entity set from the session ------ user_entity_set_id: identifier of user entity set to be removed
source code
 
get_user_entity(self, user_entity_id)
Fetch all externalEntity ids associated with this user entity or retrieve it from dictionary if exists ------ user_entity_id: identifier of user entity
source code
 
expand_user_entity_set(self, user_entity_set_id, is_last_level=False)
Fetchs interactions of userEntities in the last level of the userEntitySet ------ user_entity_set_id: identifier of the user entity set
source code
 
_get_xml(self, inner_content)
Returns given information for current session in XML format.
source code
 
_get_xml_header(self) source code
 
_get_xml_foot(self) source code
 
create_network(self, user_entity_set_id, level=0, include_relations_last_level=True, source_database_version_list=[], relation_type_list=[], relation_attribute_restriction_list=[], use_self_relations=True, expansion_attribute_list=[], expansion_relation_type_list=[], expansion_level=2, attribute_network_attribute_list=[], group_relation_type_list=[])
Creates network of given user entity set adding relations of nodes as edges.
source code
 
get_union_of_user_entity_set_list(self, user_entity_set_list, include_relations=False, new_user_entity_set_id=None)
Does the union between of the user entities belonging to the user entities sets in the list and returns a new UserEntitySet ------ user_entity_set_list: list of user entity set objects/ids to be combined include_relations: flag to whether or not include relations in union new_user_entity_set_id: identifier of new user entity set to be created as a result of the union
source code
 
get_intersection_of_user_entity_set_list(self, user_entity_set_list, include_relations=False, new_user_entity_set_id=None)
Does the intersection between of the user Entities belonging to the user entities sets in the list and returns a new UserEntitySet ------ user_entity_set_list: list of user entity set objects to be combined include_relations: flag to whether or not include relations in intersection new_user_entity_set_id: identifier of new user entity set to be created as a result of the intersection
source code
 
remove_selected_user_entities(self, user_entity_set_id)
Removes selected user entitites from given user entity set ------ user_entity_set_id: identifier of user entity set for which selected user entities will be removed
source code
 
remove_selected_relations(self, user_entity_set_id)
Removes selected relations from given user entity set ------ user_entity_set_id: identifier of user entity set for which selected user entities will be removed
source code
 
output_ontology(self, ontology_object, additional_attributes=[], out_method=None)
Outputs the ontology in XML Format ------ ontology_name: Ontology to be loaded additional_attributes: Not implemented yet.
source code
 
output_external_entity_relation_participant_details(self, external_entity_relation_id, out_method=None)
Outputs details of participants involved in a given external entry relation ------ external_entity_relation_id: relation identifier for which participant details will be outputted out_method: output method to be used if None overwritten by instance default output method
source code
 
output_external_entity_relation_details(self, out_method=None, external_entity_relation_id_list=[], attributes=[], node_attributes=[], relation_attributes=[], participant_attributes=[])
Outputs details of external entry relations with given identifiers ------ external_entity_relation_id_list: list of relation identifiers for which details will be outputted #! attributes: Unknown node_attributes: attributes of user entities connected by these relations for which information will be fetched relation_attributes: attributes of external entity relations for which information will be fetched participant_attributes: attributes of external entity relation participants for which information will be fetched out_method: output method to be used if None overwritten by instance default output method
source code
 
get_defined_node_attributes(self, user_entity_set_id, user_entity_id, attribute, output_1_value_per_attribute, return_set=False, substitute_node_attribute_if_not_exists=False)
Gets user defined and BIANA defined node external names - adds substitution functionality to helper ------ user_entity_set_id: identifier for the user entity set information for whose user entity will be fetched user_entity_id: user_entity_id for the node for wich defined attributes are obtained attribute: attribute name corresponding to the attributes to be outputed output_1_value_per_attribute: Boolean.
source code
 
get_defined_node_attributes_helper(self, user_entity_set_id, user_entity_id, attribute, output_1_value_per_attribute)
Gets user defined and BIANA defined user_entity_id external names ------ user_entity_set_id: identifier for the user entity set information for whose user entity will be fetched user_entity_id: user_entity_id for the user_entity_id for wich defined attributes are obtained attribute: attribute name corresponding to the attributes to be outputed output_1_value_per_attribute: Boolean.
source code
 
get_user_entity_set_attribute_network(self, user_entity_set_id, node_attribute)
Gets a network of node attributes instead of user entity nodes ------ Deprecated - use get_defined_node_attributes instead
source code
 
output_user_entity_set_group(self, user_entity_set_id, group_ids)
"group_ids" must be the external entity relation that represents the group
source code
 
output_user_entity_set_network_in_sif_format(self, user_entity_set_id, output_path='./', output_prefix='', node_attributes=[], participant_attributes=[], relation_attributes=[], include_tags=True, output_1_value_per_attribute=True, only_selected=False)
Outputs information of the network of a given user entity set in sif format.
source code
 
output_user_entity_set_network(self, user_entity_set_id, out_method=None, node_attributes=[], participant_attributes=[], relation_attributes=[], allowed_relation_types='all', include_participant_tags=True, include_relation_tags=True, include_relation_ids=True, include_participant_ids=True, include_relation_type=True, include_relation_sources=True, output_1_value_per_attribute=True, output_format='xml', value_seperator=', ', only_selected=False, include_command_in_rows=False, substitute_node_attribute_if_not_exists=False, include_unconnected_nodes=True)
Outputs information of the network of a given user entity set ------ output_1_value_per_attribute: Boolean.
source code
 
output_user_entity_details(self, user_entity_set, user_entity_id_list, out_method=None, attributes=[], include_level_info=True, include_degree_info=True, include_tags_info=True, include_tags_linkage_degree_info=[], substitute_node_attribute_if_not_exists=False, output_1_value_per_attribute=True, output_format='tabulated', include_command_in_rows=False)
Outputs given user entity.
source code
 
output_user_entity_set_details(self, user_entity_set_id, out_method=None, attributes=[], include_level_info=True, include_degree_info=True, level=None, only_selected=False, output_format='tabulated', include_tags_info=True, include_tags_linkage_degree_info=[], substitute_node_attribute_if_not_exists=False, output_1_value_per_attribute=True, include_command_in_rows=False, output_only_native_values=False)
Outputs given user entity set.
source code
 
output_external_entity_details(self, out_method=None, attributes=[], user_entity_id_list=[])
Outputs a summary of the external entities given as a list ------ user_entity_id_list: list of user entities out_method: method to which output information will be directed attributes: list of attribute names corresponding to the attributes to be outputed
source code
 
output_user_entity_details_with_only_defaults(self, user_entity_set, user_entity_id_list, out_method=None, attributes=[], include_level_info=True, include_degree_info=True, include_tags_info=True, include_tags_linkage_degree_info=[], substitute_node_attribute_if_not_exists=False, output_1_value_per_attribute=True, output_format='tabulated', include_command_in_rows=False)
Outputs given user entity (for each attribute, shows only values coming from the database providing that attribute by default).
source code
 
__str__(self)
str(x)
source code
 
deliver_error_message(self, message) source code
 
output_user_entity_set_sequences_in_fasta(self, user_entity_set_id, only_selected=False, out_method=None, type='proteinsequence', attributes=[], include_tags_info=True, one_line_per_sequence=False, output_1_value_per_attribute=None, output_only_native_values=None)
Outputs sequences associated with given user entity set in fasta format.
source code
 
initReport(self, reportOutputMethod, reportTitle, reportFormat, url)
Inits the Biana report where a description of the experiment and results will be written
source code
 
closeReport(self, reportOutputMethod, reportFormat)
Closes the Biana report.
source code
 
addTextToReport(self, theText=None, type='regular')
This method adds text to the report.
source code
 
addResultToReport(self, resultFileName=None, resultFilePath=None, associatedText=None, bulletedList=[])
This method adds information to the resport about a result file.
source code
 
get_new_user_entity_set_from_user_entities(self, user_entity_id_list, new_user_entity_set_id=None, external_entity_attribute_restriction_list=[])
Creates a new user entity set from given user entities.
source code
 
get_sub_user_entity_set(self, user_entity_set_id, include_relations=False, new_user_entity_set_id=None)
Creates a new user entity set using selected user entities ------ user_entity_set_id: identifier of user entity set from whose user entities a new one will be created new_user_entity_set_id: identifier of user entity set to be created include_relations: flag to whether or not include relations in the new user entity set
source code
 
unselect_user_entities_from_user_entity_set(self, user_entity_set_id)
Clears selection of user entities in a given user entity set ------ user_entity_set_id: identifier of user entity set
source code
 
unselect_user_entity_relations_from_user_entity_set(self, user_entity_set_id)
Clears selection of relations in a given user entity set ------ user_entity_set_id: identifier of user entity set
source code
 
select_all_user_entities(self, user_entity_set_id)
Selects all user entities in a given user entity set ------ user_entity_set_id: identifier of user entity set
source code
 
select_all_user_entity_relations(self, user_entity_set_id)
Selects all relations in a given user entity set ------ user_entity_set_id: identifier of user entity set
source code
 
select_user_entities_from_user_entity_set(self, user_entity_set_id, user_entity_id_list, clear_previous_selection=False)
Select user entities with given id in a given user entity set ------ user_entity_set_id: identifier of user entity set user_entity_id_list: list of user entity identifiers clear_previous_selection: Boolean to clear or not previous selection
source code
 
select_user_entity_relations_from_user_entity_set(self, user_entity_set_id, user_entity_relation_id_list=[], clear_previous_selection=False, external_entity_relation_ids_list=[])
Select user entities with given id in a given user entity set ------ user_entity_set_id: identifier of user entity set user_entity_relation_id_list: list of relation identifiers: (userEntityID1, userEntityID2, relation_type) clear_previous_selection: Boolean to clear or not previous selection
source code
 
tag_selected_user_entities(self, user_entity_set_id, tag)
Tags selected user entities in a given user entity set with the given tag ------ user_entity_set_id: identifier of user entity set tag: tag string
source code
 
tag_selected_user_entity_relations(self, user_entity_set_id, tag)
Tags selected relations in a given user entity set with the given tag ------ user_entity_set_id: identifier of user entity set tag: tag string
source code
 
select_user_entities_using_attributes(self, user_entity_set_id, identifier_description_list, id_type='embedded', external_entity_attribute_restriction_list=[], negative_external_entity_attribute_restriction_list=[], clear_previous_selection=False)
Selects user entities in a given user entity set by given attributes ------ user_entity_set_id: identifier of user entity set identifier_description_list: list of identifiers (or (identifier, id_type) tuples in case id_type is "embedded") id_type: type of the identifiers in the file, if "embedded" then file contains (attribute_name, identifier) tuples instead of just identifiers external_entity_attribute_restriction_list: Restrictions to not to include user entities with external entities having those restriction values.
source code
 
select_user_entity_relations_using_attributes(self, user_entity_set_id, identifier_description_list, id_type='embedded', relation_attribute_restriction_list=[], relation_type_list=[], clear_previous_selection=False)
Selects relations in a given user entity set by given attributes ------ user_entity_set_id: identifier of user entity set identifier_description_list: list of identifiers (or (identifier, id_type) tuples in case id_type is "embedded") id_type: type of the identifiers in the file, if "embedded" then file contains (attribute_name, identifier) tuples instead of just identifiers realation_attribute_restrictions: Restrictions to not to include relations with external entity relations having those restriction values.
source code
 
cluster_user_entities(self, user_entity_set_id, attribute)
Clusters the user Entities according to an attribute
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__

Class Variables [hide private]
  substitution_list = ['uniprotaccession', 'geneid']
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, pSessionID, unification_protocol_name, dbname, dbhost, dbuser=None, dbpassword=None, dbport=None, out_method=None)
(Constructor)

source code 

Starts a new BIANA Working session ------ pSessionID: identifier for current session object unification_protocol_name: name of the unification protocol to be used while retrieving data from database dbname: name of the mysql database to be used dbhost: host where mysql database resides dbuser: user for the given mysql database dbpassword: password for the given mysql database and host dbport: port for mysql database connection, if None default value is used out_method: is where biana session manager has to inform about changes

Overrides: object.__init__

select_user_entity_set(self, user_entity_set_id)

source code 

Method for selecting a user entity set ------ user_entity_set_id: identifier of user entity set to be selected

#! Not called by any other method

describe_user_entity_set(self, user_entity_set_id)

source code 

Method to print into the biana interface the description of the User Entity ID identified by "user_entity_set_id"

"format" can be txt or html

get_selected_user_entity_set_ids(self)

source code 

Returns list of identifiers of selected user entity sets

#! Not called by any other method

clear_selected_user_entity_sets(self)

source code 

Clears selection of user entity sets

#! Not called by any other method

read_identifier_list_from_file(self, file_name, id_type=None)

source code 

File either contains an identifier per line
or (attribute_name, identifier) couple on each line

- Designated for use from command line scripts
------
file_name: name of the file identifiers will be read from
identifier_description_list: list of identifiers (or (id_type, id_string) tuples in case id_type is "embedded")
id_type: type of the identifiers in the file, if "embedded" then file contains "attribute_name" "identifier" (seperated by tab) instead of just identifier at each line, if "auto" certain regular expressions will be tried to matched for automatic detection

detectIdentifierType(self, id)

source code 

Return auto-detected type of the given id

Works for ids with strict regular format (such as ENSP00123, AC1423234.1, EC0123123, RAW1_HUMAN, Q1234R, ...)

randomize_user_entity_set_network(self, user_entity_set_id, type_randomization)

source code 

Randomizes network of a given user entity set. ------ user_entity_set_id: id of the user entity set whose network will be randomized type_randomization: randomization type to be used in network randomization, can be one of the following: "random", "preserve_topology", "preserve_topology_and_node_degree", "preserve_degree_distribution", "preserve_degree_distribution_and_node_degree"

create_new_user_entity_set(self, identifier_description_list, id_type='embedded', new_user_entity_set_id=None, attribute_restriction_list=[], negative_attribute_restriction_list=[], external_database_restrictions=[])

source code 

create userEntity objects from given externalEntity ids (or get if already existing) then add them to a userEntitySet ------ identifier_description_list: list with external identifiers of the nodes in the set provided by user id_type: either list of attrubutes defined in EXTERNAL_ENTITY_TABLES or "embedded" meaning identifier_description_list is a list of (id_type, identifier) tuple in the form [(type1, id1), (type2, id2), ..., (typeN, idN)] new_user_entity_set_id: identifier of the set provided by the user attribute_restriction_list: list of tuples provided by the user containing external entity attribute restrictons to be applied. They will be used always in the set (network creation, etc) negative_attribute_restriction_list: list of tuples provided by the user containing attributes that may neve appear in the user entity set. They will be used alwyas in the set.

_get_xml(self, inner_content)

source code 

Returns given information for current session in XML format. ------ inner_content: Information to be encapsulated with current session.

create_network(self, user_entity_set_id, level=0, include_relations_last_level=True, source_database_version_list=[], relation_type_list=[], relation_attribute_restriction_list=[], use_self_relations=True, expansion_attribute_list=[], expansion_relation_type_list=[], expansion_level=2, attribute_network_attribute_list=[], group_relation_type_list=[])

source code 

Creates network of given user entity set adding relations of nodes as edges. ------ user_entity_set_id: identifier of user entity set for which network will be created level: level of the network to be created, network will be expanded till that level include_relations_last_level: include relations between the nodes residing at the last level source_database_version_list: list of (biological database, version) tuples relation_type_list: type of the relations to be used in expansion relation_attribute_restriction_list: tuples of (attribute, value) corresponding to restrictions to be applied on attributes of relations use_self_relations: include relations within the node itself expansion_attribute_list: tuples of (attribute, value_dictionary) corresponding to attributes to be used in relation inference between nodes based on shared attributes - value_dictionary is empty if attribute is not parameterizable expansion_relation_type_list: type of relations to be used in shared attribute based relation inference expansion_level: number of relations (edges) to look further while inferring relations based on shared attributes attribute_network_attribute_list: tuples of (attribute, value) corresponding to attributes to be used while associating nodes with common attributes - value_dictionary is empty if attribute is not parameterizable group_relation_type_list: type of relations that are going to be treated as a group (like pathway, complex, cluster..)

output_ontology(self, ontology_object, additional_attributes=[], out_method=None)

source code 

Outputs the ontology in XML Format ------ ontology_name: Ontology to be loaded additional_attributes: Not implemented yet. TO DO!!! (Attribute "id" is the visual ID) out_method: output method to be used if None overwritten by instance default output method

output_external_entity_relation_participant_details(self, external_entity_relation_id, out_method=None)

source code 

Outputs details of participants involved in a given external entry relation ------ external_entity_relation_id: relation identifier for which participant details will be outputted out_method: output method to be used if None overwritten by instance default output method

Called by BianaGUI/showTableDialog.java via output_external_entity_relation_details method

get_defined_node_attributes(self, user_entity_set_id, user_entity_id, attribute, output_1_value_per_attribute, return_set=False, substitute_node_attribute_if_not_exists=False)

source code 

Gets user defined and BIANA defined node external names - adds substitution functionality to helper ------ user_entity_set_id: identifier for the user entity set information for whose user entity will be fetched user_entity_id: user_entity_id for the node for wich defined attributes are obtained attribute: attribute name corresponding to the attributes to be outputed output_1_value_per_attribute: Boolean. Defines wether 1 or multiple values are outputed per each attribute

get_defined_node_attributes_helper(self, user_entity_set_id, user_entity_id, attribute, output_1_value_per_attribute)

source code 

Gets user defined and BIANA defined user_entity_id external names ------ user_entity_set_id: identifier for the user entity set information for whose user entity will be fetched user_entity_id: user_entity_id for the user_entity_id for wich defined attributes are obtained attribute: attribute name corresponding to the attributes to be outputed output_1_value_per_attribute: Boolean. Defines wether 1 or multiple values are outputed per each attribute

output_user_entity_set_network_in_sif_format(self, user_entity_set_id, output_path='./', output_prefix='', node_attributes=[], participant_attributes=[], relation_attributes=[], include_tags=True, output_1_value_per_attribute=True, only_selected=False)

source code 

Outputs information of the network of a given user entity set in sif format. User entity id will be taken as the node identifier. ------ output_path: directory in which Cytoscape attribute files will be generated output_prefix: prefix to be added to the begining of Cytoscape attribute files

output_user_entity_set_network(self, user_entity_set_id, out_method=None, node_attributes=[], participant_attributes=[], relation_attributes=[], allowed_relation_types='all', include_participant_tags=True, include_relation_tags=True, include_relation_ids=True, include_participant_ids=True, include_relation_type=True, include_relation_sources=True, output_1_value_per_attribute=True, output_format='xml', value_seperator=', ', only_selected=False, include_command_in_rows=False, substitute_node_attribute_if_not_exists=False, include_unconnected_nodes=True)

source code 

Outputs information of the network of a given user entity set ------ output_1_value_per_attribute: Boolean. Defines wether 1 or multiple values are outputed per each attribute output_format: format for the output used in case format is "table"; can be "tabulated" or "xml" include_relation_ids: Boolean to whether display or not relation identifiers include_participant_ids: Boolean to whether display or not relation participant identifiers include_relation_type: Boolean to whether display or not types of relations include_relation_sources: Boolean to whether display or not relation sources include_participant_tags: Boolean to whether display or not tags of participants include_relation_tags: Boolean to whether display or not tags of relations value_seperator: string to seperate consequitive values in the same column only_selected: Boolean to decide whether to output only selected nodes or all nodes (and their interactions) include_command_in_rows: Include the command to output individual relation information at each row substitute_node_attribute_if_not_exists: In case the node does not have a value for a given attribute (s.t. uniprotaccession) this flag make it possible to output another attribute (e.g. geneid) in the same column indicated as attribute:value (e.g. geneid:123123) include_unconnected_nodes: Boolean to whether display or not unconnected nodes

output_user_entity_details(self, user_entity_set, user_entity_id_list, out_method=None, attributes=[], include_level_info=True, include_degree_info=True, include_tags_info=True, include_tags_linkage_degree_info=[], substitute_node_attribute_if_not_exists=False, output_1_value_per_attribute=True, output_format='tabulated', include_command_in_rows=False)

source code 

Outputs given user entity. Called by output_user_entity_set_details. ------ user_entity_set: Instace of the user entity set, user entities of which will be outputted user_entity_id_list: list of user entities out_method: method to which output information will be directed attributes: list of attribute names corresponding to the attributes to be outputed include_level_info: Boolean. Defines inclussion of network level information in the output. include_degree_info: Boolean. Defines inclussion of node degree information in the output. inlcude_tags_info: Boolean. Defines inclussion of node tags information in the output. include_tags_linkage_degree_info: #! output_1_value_per_attribute: Boolean. Defines wether 1 or multiple values are outputed per each attribute output_format: format for the output. Either "tabulated" or "xml" include_command_in_rows: Include the command to output individual user entity information at each row

output_user_entity_set_details(self, user_entity_set_id, out_method=None, attributes=[], include_level_info=True, include_degree_info=True, level=None, only_selected=False, output_format='tabulated', include_tags_info=True, include_tags_linkage_degree_info=[], substitute_node_attribute_if_not_exists=False, output_1_value_per_attribute=True, include_command_in_rows=False, output_only_native_values=False)

source code 

Outputs given user entity set. ------ user_entity_set_id: Identifier of the user entity set, user entities of which will be outputted out_method: method to which output information will be directed attributes: list of attribute names corresponding to the attributes to be outputed include_level_info: Boolean. Defines inclussion of network level information in the output. include_degree_info: Boolean. Defines inclussion of node degree information in the output. inlcude_tags_info: Boolean. Defines inclussion of node tags information in the output. include_tags_linkage_degree_info: #! output_1_value_per_attribute: Boolean. Defines wether 1 or multiple values are outputed per each attribute output_format: format for the output. Either "tabulated" or "xml" only_selected: Boolean to decide whether to output only selected nodes or all nodes. "level" parameter is used only it is False include_command_in_rows: Include the command to output individual user entity information at each row output_only_native_values: If true, for each attribute, shows only values coming from the database providing that attribute by default

output_external_entity_details(self, out_method=None, attributes=[], user_entity_id_list=[])

source code 

Outputs a summary of the external entities given as a list ------ user_entity_id_list: list of user entities out_method: method to which output information will be directed attributes: list of attribute names corresponding to the attributes to be outputed

Called by BianaGUI/showTableDialog.java via output_user_entity_details method

output_user_entity_details_with_only_defaults(self, user_entity_set, user_entity_id_list, out_method=None, attributes=[], include_level_info=True, include_degree_info=True, include_tags_info=True, include_tags_linkage_degree_info=[], substitute_node_attribute_if_not_exists=False, output_1_value_per_attribute=True, output_format='tabulated', include_command_in_rows=False)

source code 

Outputs given user entity (for each attribute, shows only values coming from the database providing that attribute by default). Called by output_user_entity_set_details. ------ user_entity_set: Instace of the user entity set, user entities of which will be outputted user_entity_id_list: list of user entities out_method: method to which output information will be directed attributes: list of attribute names corresponding to the attributes to be outputed include_level_info: Boolean. Defines inclussion of network level information in the output. include_degree_info: Boolean. Defines inclussion of node degree information in the output. inlcude_tags_info: Boolean. Defines inclussion of node tags information in the output. include_tags_linkage_degree_info: #! output_1_value_per_attribute: Boolean. Defines wether 1 or multiple values are outputed per each attribute output_format: format for the output. Either "tabulated" or "xml" include_command_in_rows: Include the command to output individual user entity information at each row

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

output_user_entity_set_sequences_in_fasta(self, user_entity_set_id, only_selected=False, out_method=None, type='proteinsequence', attributes=[], include_tags_info=True, one_line_per_sequence=False, output_1_value_per_attribute=None, output_only_native_values=None)

source code 

Outputs sequences associated with given user entity set in fasta format. ------ user_entity_set_id: Id of user entity set containing user entities whose sequence will be outputted only_selected: Includes all user entites if False, otherwise only selected ones out_method: method to which output information will be directed type: either "proteinsequence" or "nucleotidesequence" attributes: list of attribute names corresponding to the attributes to be outputed as sequence header inlcude_tags_info: Boolean. Defines inclussion of node tags information in the output.

Called by BianaGUI/ViewUserEntityDetails.java

initReport(self, reportOutputMethod, reportTitle, reportFormat, url)

source code 

Inits the Biana report where a description of the experiment and results will be written

"reportTitle" is the title that will be written on top of the report (default is 'BIANA report')

"reportOutputMethod" is the write method where the report will be written (e.g. file_object.write)
      --> if no streamOutputMethod is given, report is written to stdout

"reportFormat" is the formatting that will be applied to the report
     - 'html': report in html
     - 'txt': report in raw text

"url" is the URL where the interface to BIANA is placed

closeReport(self, reportOutputMethod, reportFormat)

source code 

Closes the Biana report. This method is in charge of writing the closing HTML tags of the report

"reportOutputMethod" is the write method where the report will be written (e.g. file_object.write)
      --> if no streamOutputMethod is given, report is written to stdout

"reportFormat" is the formatting that will be applied to the report
     - 'html': report in html
     - 'txt': report in raw text

Attention!!! This method does not close the file object associated to the report. The user is responsible
             for closing the file (if needed).

addTextToReport(self, theText=None, type='regular')

source code 

This method adds text to the report.

Depending on the 'type' of text, it will be written one way or another

  • 'regular' prints standard text
  • 'title' prints a section title

addResultToReport(self, resultFileName=None, resultFilePath=None, associatedText=None, bulletedList=[])

source code 

This method adds information to the resport about a result file.

'resultFileName' is the name you want to give to this result file

'resultFilePath' is the path (or URL) of the result file (e.g. http://localhost/this_file.html

'associatedText' is the text shown next to the results file name (i.e description of the file)

'bulletedList' is a list of strings that will be shown under the results name as a bulleted list

get_new_user_entity_set_from_user_entities(self, user_entity_id_list, new_user_entity_set_id=None, external_entity_attribute_restriction_list=[])

source code 

Creates a new user entity set from given user entities. ------ user_entity_id_list: user entities to be included new user entity set user_entity_set_id: identifier of user entity set to be created external_entity_attribute_restriction_list: Restrictions to not to include user entities with external entities having those restriction values. List of tuples provided by the user containing external entity attribute restrictons to be applied. They will be used always in the set (network creation, etc)

#! Not called by any other method

select_user_entities_using_attributes(self, user_entity_set_id, identifier_description_list, id_type='embedded', external_entity_attribute_restriction_list=[], negative_external_entity_attribute_restriction_list=[], clear_previous_selection=False)

source code 

Selects user entities in a given user entity set by given attributes ------ user_entity_set_id: identifier of user entity set identifier_description_list: list of identifiers (or (identifier, id_type) tuples in case id_type is "embedded") id_type: type of the identifiers in the file, if "embedded" then file contains (attribute_name, identifier) tuples instead of just identifiers external_entity_attribute_restriction_list: Restrictions to not to include user entities with external entities having those restriction values. List of tuples provided by the user containing external entity attribute restrictons to be applied. clear_previous_selection: Boolean to clear or not previous selection

select_user_entity_relations_using_attributes(self, user_entity_set_id, identifier_description_list, id_type='embedded', relation_attribute_restriction_list=[], relation_type_list=[], clear_previous_selection=False)

source code 

Selects relations in a given user entity set by given attributes ------ user_entity_set_id: identifier of user entity set identifier_description_list: list of identifiers (or (identifier, id_type) tuples in case id_type is "embedded") id_type: type of the identifiers in the file, if "embedded" then file contains (attribute_name, identifier) tuples instead of just identifiers realation_attribute_restrictions: Restrictions to not to include relations with external entity relations having those restriction values. List of tuples provided by the user containing external entity attribute restrictons to be applied. relation_type_list: types of relations to be included in selection

#! Not called by any method

cluster_user_entities(self, user_entity_set_id, attribute)

source code 

Clusters the user Entities according to an attribute

#! Not called by any other method