A BianaNetworkManager is composed of one or several userEntity(s) and
one BianaDBaccess object
|
__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
|
|
|
|
|
|
|
_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
|
|
|
|
|
|
|
|
|
|
|
_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
|
|
|
|
|
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
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
addResultToReport(self,
resultFileName=None,
resultFilePath=None,
associatedText=None,
bulletedList=[ ] )
This method adds information to the resport about a result file. |
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
|
|
|
|
Inherited from object :
__delattr__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__
|