|
NEWget_user_entity_relations(self,
unification_protocol_name,
userEntityID_list,
attribute_restrictions=[ ] ,
negative_attribute_restrictions=[ ] ,
listRelationType=[ ] ,
dictRelationAttributeRestriction={ } ,
use_self_relations=True,
limit_to_userEntityID_list=False,
use_nested_relations=True)
Returns the list of relations where the userEntity is involved
use_nested_relations ==> Include relations greater than a nested
level |
source code
|
|
|
OLDget_user_entity_relations(self,
unification_protocol_name,
userEntityID_list,
attribute_restrictions=[ ] ,
negative_attribute_restrictions=[ ] ,
listRelationType=[ ] ,
dictRelationAttributeRestriction={ } ,
use_self_relations=True,
limit_to_userEntityID_list=False,
use_nested_relations=True)
#! Nasty trick (not used anymore): to not to join externalEntityType
table in the query in case sth is interacting with itself (see
use_self_relations) there is an internal type called
"self_type" which should be handled carefully whenever this
method is called and type is going to be used |
source code
|
|
|
|
|
|
|
__init__(self,
dbname=None,
dbhost=None,
dbuser=None,
dbpassword=None,
dbport=None,
dbsocket=None,
use_buffer=False,
lock_tables=False,
check_integrity=False)
"dbname" is the database name to which you want to connect
to (required) "dbhost" is the machine with the mysql server
that holds the biana database (required) "dbuser" is the
mysql user (not required in most systems) "dbpassword" is
the mysql password (not required in most systems) "dbport"
is the mysql port (not required in most systems) |
source code
|
|
|
|
|
|
|
_add_key_attribute(self,
external_database_id,
key_attribute)
Adds a key attribute, used in transfer attributes (key attribute) and
ontologies (linked attribute) |
source code
|
|
|
_add_transfer_attribute(self,
externalDatabaseID,
key_attribute,
transfer_attribute) |
source code
|
|
|
_apply_negative_restrictions_to_query(self,
query,
unification_protocol_name,
negative_attribute_restrictions,
column_name_to_restrict=' userEntityID ' ) |
source code
|
|
|
_apply_relation_restrictions_to_query(self,
query,
attribute_restrictions_dict,
column_name_to_restrict=' externalEntityRelationID ' ) |
source code
|
|
|
_apply_restrictions_to_query(self,
query,
unification_protocol_name,
attribute_restrictions,
column_name_to_restrict=' userEntityID ' )
Applies the restrictions for a given query, where some user entites
must be restricted |
source code
|
|
|
_check_database_integrity(self)
Checks the integrity of the database |
source code
|
|
|
_convertListSourceDBVersionToSourceDBIdList(self,
source_databases) |
source code
|
|
|
_create_new_unification_protocol_tables(self,
protocol) |
source code
|
|
|
|
|
_get_attribute_restrictions_query(self,
unification_protocol_name,
negative_attribute_restrictions) |
source code
|
|
|
_get_attribute_value_list_for_transfer_attributes(self,
attribute_identifier,
field_values)
returns a list of (field, value) of the transferred attribute |
source code
|
|
|
|
|
_get_equivalent_external_entities(self,
unification_atom_element)
returns the query to obtain the list of equivalent |
source code
|
|
|
_get_equivalent_user_entities_by_sharing_attributes(self,
unification_protocol_name,
user_entity_id_list,
attribute_list)
Returns a list of tuples with userEntityID1, userEntityID2 OBSOLETE -
use get_user_entity_relations_by_sharing_attributes instead |
source code
|
|
|
_get_expand_ontology_attribute_table_query(self,
attribute_identifier,
values_to_expand_list) |
source code
|
|
|
|
|
_get_key_attribute_table_name(self,
key_id) |
source code
|
|
|
|
|
_get_last_external_entity_relation_participant_id(self) |
source code
|
|
|
|
|
|
|
|
|
|
|
_get_last_stable_external_entity_relation_participant_id(self) |
source code
|
|
|
|
|
_get_last_stable_sequenceNucleotide_id(self) |
source code
|
|
|
|
|
_get_linked_attribute_ontology_name(self,
attribute_identifier)
Returns the name of the ontology linked to an attribute |
source code
|
|
|
_get_list_eE_for_uE(self,
unification_protocol_name,
userEntityID) |
source code
|
|
|
_get_list_external_entities_IDs_by_attribute_SQLstat(self,
attribute_identifier,
field_values,
source_databases=[ ] ,
attribute_restrictions=None,
expand_ontology_attributes=True)
Gets a list of external entities that have an attribute with
"attribute_value" value "field_value" is the
field/S and value/S we want to obtain If a value is *, it will obtain
all having this attribute |
source code
|
|
|
_get_list_external_entities_for_user_entities(self,
unification_protocol_name,
userEntityID_list) |
source code
|
|
|
_get_list_user_entities_IDs_by_attribute_transfer_query(self,
attribute_identifier,
field_values,
unification_protocol_name,
source_databases=[ ] ,
attribute_restrictions=None,
include_type=False,
restrict_to_user_entity_ids_list=[ ] ) |
source code
|
|
|
_get_list_user_entities_for_external_entities(self,
unification_protocol_name,
externalEntityID_list) |
source code
|
|
|
|
|
|
|
_get_new_external_entity_relation_participant_id(self) |
source code
|
|
|
|
|
|
|
|
|
_get_similar_sequences(self,
sequenceID,
bit_score=None,
identity_percent=None,
similarity_percent=None,
query_coverage_percent=None,
match_coverage_percent=None)
Gets similar sequences from database |
source code
|
|
|
|
|
_get_user_entity_table_name(self,
unification_protocol_name) |
source code
|
|
|
|
|
|
|
_insert_blast_results_file(self,
file_fd)
METHOD TO TEST |
source code
|
|
|
_insert_external_entity_attribute(self,
externalEntityID,
externalEntityAttribute)
Adds a new attribute to the external entity externalEntityID must
exist previously |
source code
|
|
|
_insert_external_entity_relation_participant_attribute(self,
pParticipantID,
pExternalEntityRelationParticipantAttribute) |
source code
|
|
|
_insert_protein_sequence_cd_hit_cluster(self,
cd_hit_cluster) |
source code
|
|
|
_insert_sequence(self,
sequence)
Inserts a sequence object into BIANA database and returns its ID. |
source code
|
|
|
_insert_sequence_file(self,
input_fd,
type,
format=' fasta ' ,
verbose=True)
Inserts a sequence file to the database |
source code
|
|
|
_is_key_attribute(self,
attribute_identifier,
external_database_id) |
source code
|
|
|
_is_ontology_linked_attribute(self,
attribute_identifier) |
source code
|
|
|
_is_transferred_attribute(self,
attribute_identifier) |
source code
|
|
|
_load_available_unification_protocols(self)
Gets the information about available unification protocols |
source code
|
|
|
|
|
_load_biana_types_and_attributes(self)
Method to load current biana database types and attributes |
source code
|
|
|
|
|
_rollback(self)
Method used to undo all the changes from an stable data insert |
source code
|
|
|
_transform_attribute_value_data_type_to_biana_database_attribute_data_type(self,
attribute_identifier,
value) |
source code
|
|
|
_unify_promiscuous_external_entities(self,
protocol) |
source code
|
|
|
|
|
|
|
_update_relations_hierarchy(self)
Precalculates and stores in database relations hierachy |
source code
|
|
|
add_hssp_info_to_pdb(self,
pdb_code,
chain,
residue_pdb_number,
residue_hssp_entropy,
residue_hssp_norm_entropy,
residue_hssp_variability,
conservation_hssp,
solvent_exposure_hssp,
dssp)
Adds HSSP information to pdb files |
source code
|
|
|
add_valid_external_entity_attribute_type(self,
name,
data_type,
category) |
source code
|
|
|
add_valid_external_entity_relation_participant_attribute_type(self,
name,
data_type) |
source code
|
|
|
add_valid_external_entity_relation_type(self,
type) |
source code
|
|
|
|
|
add_valid_identifier_reference_types(self,
current_reference_type) |
source code
|
|
|
|
|
create_database(self,
dbname,
description=' BIANA DATABASE ' ,
optimize_for=' parsing ' ,
ignore_primary_keys=False)
It creates necessary tables into a database server |
source code
|
|
|
create_new_user_entities(self,
protocol)
"protocol" is the UnificationProtocol object that has to be
followed |
source code
|
|
|
|
|
get_alignment(self,
externalEntityID,
get_species=False,
range=None)
Returns an alignment object identified by the externalEntityID used
as parameter |
source code
|
|
|
get_available_ontology_names(self,
name=None) |
source code
|
|
|
get_available_unification_protocols_list(self) |
source code
|
|
|
get_default_external_entity_ids(self,
externalEntityIDsList) |
source code
|
|
|
get_equivalent_user_entities_from_list(self,
userEntitiesList,
attribute,
protocol_id) |
source code
|
|
|
get_expanded_entity_relations(self,
unification_protocol_name,
userEntityID_list,
expansionAttributesList=[ ] ,
listRelationType=[ ] ,
use_self_relations=True,
limit_to_userEntityID_list=False,
expansionLevel=2,
attribute_restrictions=[ ] ,
negative_attribute_restrictions=[ ] )
unification_protocol_name: name of the unification protocol to be
used |
source code
|
|
|
|
|
|
|
get_external_entities_dict(self,
externalEntityIdsList,
attribute_list=[ ] ,
relation_attribute_list=[ ] ,
participant_attribute_list=[ ] ,
useTransferAttributes=True)
Returns a dict of external Entity Objects with the attributes
specified in the "attribute_identifier_list" |
source code
|
|
|
get_external_entities_dict_by_attribute(self,
attribute_identifier,
field_values,
source_databases=None,
attribute_restrictions=None,
attribute_list=[ ] ,
relation_attribute_list=[ ] ,
participant_attribute_list=[ ] ) |
source code
|
|
|
get_list_external_entities_IDs_by_attribute(self,
attribute_identifier,
field_values,
source_databases=[ ] ,
attribute_restrictions=None) |
source code
|
|
|
get_list_user_entities_IDs_by_attribute(self,
unification_protocol_name,
attribute_identifier,
field_values,
attribute_restrictions=None,
negative_attribute_restrictions=None,
restrict_to_user_entity_ids_list=[ ] ,
include_type=False)
Returns a list of user entities that match with the attributes
specified of type attribute_identifier |
source code
|
|
|
get_ontology(self,
ontology_name,
root_attribute_values=[ ] ,
load_external_entities=False)
Loads ontology object |
source code
|
|
|
get_relations_hierarchy(self,
externalEntityRelationIDs)
Returns a list of tuples (relationID1, relationID2) in where
relationID1 is a child of relationID2 |
source code
|
|
|
get_sequence_from_sequenceID(self,
sequenceID) |
source code
|
|
|
|
|
get_taxonomies_from_species_name(self,
species_name) |
source code
|
|
|
get_taxonomy_names_taxID_dict(self,
tax_id_name_type=None)
name is lower cased |
source code
|
|
|
|
|
|
|
|
|
get_user_entity_relations(self,
unification_protocol_name,
userEntityID_list,
attribute_restrictions=[ ] ,
negative_attribute_restrictions=[ ] ,
listRelationType=[ ] ,
dictRelationAttributeRestriction={ } ,
use_self_relations=True,
limit_to_userEntityID_list=False,
use_nested_relations=True) |
source code
|
|
|
get_user_entity_relations_by_sharing_attributes(self,
unification_protocol_name,
userEntityID_list,
listAttributes,
limit_to_userEntityID_list=False,
attribute_restrictions=[ ] ,
negative_attribute_restrictions=[ ] ,
ontology_expansion_level=None)
Returns a list of relations between user entities, in which the share
attributes listed in listAttributes |
source code
|
|
|
|
|
get_valid_external_entity_relation_types(self) |
source code
|
|
|
|
|
insert_alignment(self,
alignmentObject,
externalEntityID,
insert_aligned=' no ' )
"insert_aligned" is used to insert exactly the aligned sequence (used in done alignments, as HSSP, as the sequences does not always is exactly the same... |
source code
|
|
|
insert_cd_hit_clusters_to_biana_database(self,
cd_hit_clusters_file)
Inserts information about CD-HIT clusters into database |
source code
|
|
|
|
|
insert_new_external_database(self,
externalDatabase)
Inserts into database the information of a new external database that
is being integrated into BIANA database |
source code
|
|
|
|
|
|
|
insert_pdb_object(self,
PDBObject,
source_database,
description=None) |
source code
|
|
|
|
|
|
|
load_hssp_multiple_chains(self,
pdb_id,
fragments=[ ] ,
get_species=False) |
source code
|
|
|
load_pdb_object(self,
pdb_code,
fragments=[ ] ,
merge_fragments=False,
request_information=None)
"pdb_code" is mandatory |
source code
|
|
|
optimize_database_for(self,
mode,
optimize=False)
Performs some modifications in database in order to optimize database
access efficiency for parsing or running |
source code
|
|
|
output_sequences(self,
outmethod,
type=' proteinsequence ' ,
format=' fasta ' ,
sequenceIDs=None)
outmethod: destination where data in fasta format would be written
type: either "proteinsequence" or
"nucleotidesequence" - decides which type of sequence is
desired format: either "fasta" or "seq"
corresponding to fasta format or raw sequence format sequenceIDs:
list of sequence ids whose sequence would be outputted - if None will
output all sequences in the database |
source code
|
|
|
|
|
|
|
transform_expanded_attribute_restrictions(self,
attribute_restriction_list) |
source code
|
|
|
update_external_database_external_entity_attributes(self,
externalDatabase) |
source code
|
|
Inherited from object :
__delattr__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__
|