| |
- PianaSelectSQL
-
- GetMaxPacket
- GetTableDescription
- GetTableNames
- LockTables
- SelectAllDBAliClusterRelationship
- SelectAllDistinctMD5
- SelectAllDistinctSequenceID
- SelectAllProteinPiana
- SelectAllProteinPiana_TaxID_and_MD5
- SelectAllProteinPiana_sequenceID_and_taxID
- SelectAllProteinProteinInteractions
- SelectAllSimilarProteins
- SelectColumnValues
- SelectCommonCharacteristicProteins
- SelectCommonCodeProteins
- SelectCompleteTable
- SelectDBAliClusterRelationship
- SelectDatabaseType
- SelectGoTermIdUsingTermType
- SelectInteractionMethod
- SelectInteractionPartner
- SelectInteractionPiana
- SelectInteractionPubmed
- SelectInteractionSourceDB
- SelectInteractors
- SelectListInteractionPiana
- SelectMaxProteinPiana
- SelectNewInteractionPiana
- SelectNewProteinPiana
- SelectNewSequenceID
- SelectPairMethodDBAliClusterRelationship
- SelectPartners
- SelectPartnersProteinSharingCog
- SelectPathWayDescriptionFromReactomeID
- SelectProteinAttributeRelationship
- SelectProteinCathRelationship
- SelectProteinID
- SelectProteinKingdom
- SelectProteinPiana
- SelectProteinPianaFromMD5
- SelectProteinPianaFromTaxID_and_MD5
- SelectProteinPianaFromTaxID_and_sequenceID
- SelectProteinPianaGeneralized
- SelectProteinPianaTax
- SelectProteinResiduesCathRelationship
- SelectProteinScopCfRelationship
- SelectProteinScopFaRelationship
- SelectProteinScopRelationship
- SelectProteinScopSfRelationship
- SelectProteinSimilarity
- SelectProteinTableColumn
- SelectProteinsWithScop
- SelectReactomeNamefromReactomeID
- SelectSequenceFromSequenceID
- SelectSequenceIDFromMD5
- SelectSequencePropertyFromProteinPiana
- SelectSequenceSequenceMD5FromSequenceID
- SelectSimilarProteins
- SelectSpeciesNamefromTaxID
- SelectTaxIDfromSpeciesName
- SelectValidProteinIds
- SelectValidSourceDBs
- SelectXFromGoTermId
- Select_go_term2term_distance
- UnlockTables
class GetTableNames(PianaSelectSQL) |
|
Generates the SQL statement that gets all database table names
Method used to select tables to lock in parsers. However, it should not be used: it is better to lock only those tables that will be used
Also used to select all tables to update sourceDBID field |
|
Static methods defined here:
- get_sqlquery()
|
class LockTables(PianaSelectSQL) |
|
Generates the SQL statement that locks tables indicated in argument
Method used to return the SQL query that locks access to mysql tables. Insertions are faster if tables are previously locked.
table_list is a list of table names |
|
Static methods defined here:
- get_sqlquery(table_list)
|
class PianaSelectSQL |
|
General class for Piana SQL SELECT queries. All SQL queries reading piana should be extensions of this class |
|
Static methods defined here:
- get_sqlquery()
- Override this with the sql query that returns the value being researched
|
class SelectAllProteinPiana_TaxID_and_MD5(PianaSelectSQL) |
|
Generates the SQL statement that obtains the relation (proteinMD5,taxID,proteinPiana) in table protein
This class is use to keep consistency of proteinPiana <--> proteinSequence and taxID between different versions of piana databases |
|
Static methods defined here:
- get_sqlquery()
|
class SelectAllProteinProteinInteractions(PianaSelectSQL) |
|
Generates the SQL statement that obtains all triplets (proteinPianaA, proteinPianaB, interactionPiana) for list_source_dbs and list_source_methods
if only_id is "yes", then it only returns the sql query for retrieving interactionPianas (and not the proteinPianas of the interaction)
"tax_id" can only contain a taxID value. It can be "all" or a taxID value |
|
Static methods defined here:
- get_sqlquery(use_self_ints='yes', list_source_dbs='all', inverse_dbs='no', list_source_methods='all', inverse_methods='no', only_id='yes', valid_source_dbs={}, tax_id_value='all')
|
class SelectColumnValues(PianaSelectSQL) |
|
General method to select the total number of entries in a table that have a determined combination of values |
|
Static methods defined here:
- get_sqlquery(tableName, tableColumns=[], values=[])
- "tableColumns" and "values" must have the same length
|
class SelectCommonCharacteristicProteins(PianaSelectSQL) |
|
Generates the SQL statement that obtains those proteins with characteristics described to get_sqlquery
This class is used for example to get all proteins that belong to a certain species, by passing the approapiate arguments
as shown: get_sqlquery(proteinCode_table= PianaGlobals.proteinSpecies_table,
proteinCodeID_col= PianaGlobals.taxID_col,
proteinCodeID_value = taxonomy_value)
will retrieve all those proteinPiana of table proteinSpecies_table where column taxID_col is taxonomy_value |
|
Static methods defined here:
- get_sqlquery(proteinCode_table=None, proteinCodeID_col=None, proteinCodeID_value=None)
|
class SelectCommonCodeProteins(PianaSelectSQL) |
|
Generates the SQL statement that obtains those proteins that share a code with a given protein
The list will not contain the protein passed as reference |
|
Static methods defined here:
- get_sqlquery(proteinCode_table, proteinCodeID_col, proteinPiana_value)
|
class SelectGoTermIdUsingTermType(PianaSelectSQL) |
|
Generates the sql statement to select go term id associated to a proteinPiana specifing the term type value
because one proteinPiana could be associated to more than one Go term id depending the term type:
- "molecular_function"
- "biological_process"
- "cellular_component" |
|
Static methods defined here:
- get_sqlquery(proteinPiana, term_type)
|
class SelectInteractionMethod(PianaSelectSQL) |
|
Generates the SQL statement that obtains a list of methodID of an interactionPiana
if sourceDB_value == None, then it returns the SQL statement that obtains all methodIDs for interactionPiana
if sourceDB_value is a database, then it returns the SQL statement that obtains all methodIDs for interactionPiana for a particular sourceDB
Attention! sourceDB_value is the integer associated to the source DB
Attention: list_source_dbs and inverse_dbs not being used!!! |
|
Static methods defined here:
- get_sqlquery(interactionPiana_value=None, sourceDBID_value=None, list_source_dbs='all', inverse_dbs='no')
- # TO DO!!! Remove sourceDBID and get methods for all dbs in list_source_dbs (taking into account inverse_dbs)
|
class SelectInteractionPiana(PianaSelectSQL) |
|
Generates the SQL statement that obtains interaction internal id interactionPiana for the interaction between two specific proteins
Before looking for the interaction, it makes sure that the order proteinPianaA < proteinPianaB is respected. If it is not the case, it
changes the query (not the objects passed, they remain unchanged) to execute it in the right order |
|
Static methods defined here:
- get_sqlquery(proteinPianaA_value, proteinPianaB_value, list_source_dbs='all', inverse_dbs='no', list_source_methods='all', inverse_methods='no', valid_source_dbs={})
|
class SelectInteractionPubmed(PianaSelectSQL) |
|
Generates the SQL statement that obtains a list of pubmedID of an interactionPiana
if sourceDB_value == None, then it returns the SQL statement that obtains all pubmedIDs for interactionPiana
if sourceDB_value is a database, then it returns the SQL statement that obtains all pubmedIDs for interactionPiana for a particular sourceDB
Attention! sourceDB_value is the integer associated to the source DB
Attention: list_source_dbs and inverse_dbs not being used!!! |
|
Static methods defined here:
- get_sqlquery(interactionPiana_value=None, sourceDBID_value=None, list_source_dbs='all', inverse_dbs='no')
|
class SelectInteractionSourceDB(PianaSelectSQL) |
|
Generates the SQL statement that obtains entries from table interaction in relation with its sourceDB
if interactionPiana_value not None --> get the list of sourceDBID for this interactionPiana
if sourceDBID_value not None --> get the list of interactionPiana for this sourceDBID
Only one of the arguments can be "not None" |
|
Static methods defined here:
- get_sqlquery(interactionPiana_value=None, sourceDBID_value=None)
|
class SelectListInteractionPiana(PianaSelectSQL) |
|
Generates the SQL statement that obtains interaction internal ids where a given protein is involved |
|
Static methods defined here:
- get_sqlquery(proteinPiana_value, list_source_dbs='all', inverse_dbs='no', list_source_methods='all', inverse_methods='no', valid_source_dbs={})
|
class SelectNewInteractionPiana(PianaSelectSQL) |
|
Generates the SQL statement that obtains a new sequenceID identifier from proteinPianaCounter table
After getting the new sequenceID identifier, the method calling this class must make sure that the counter in increased by 1 |
|
Static methods defined here:
- get_sqlquery()
|
class SelectNewProteinPiana(PianaSelectSQL) |
|
Generates the SQL statement that obtains a new proteinPiana identifier from proteinPianaCounter table
After getting the new proteinPiana identifier, the method calling this class must make sure that the counter in increased by 1 |
|
Static methods defined here:
- get_sqlquery()
|
class SelectNewSequenceID(PianaSelectSQL) |
|
Generates the SQL statement that obtains a new sequenceID identifier from proteinPianaCounter table
After getting the new sequenceID identifier, the method calling this class must make sure that the counter in increased by 1 |
|
Static methods defined here:
- get_sqlquery()
|
class SelectPartners(PianaSelectSQL) |
|
Generates the SQL statement that obtains interaction partners of a given protein
Used to return the SQL query that retrieves the interaction partners of a protein (only those on side A or B)
This class is not to be used externally: the side (A or B)
where the protein is placed should be trasparent to the
external user. Piana makes this trasparent to the user by
creating a method (get_all_partners) under PianaDBaccess that
performs two queries to obtain all partners. PianaDBaccess.get_all_partners
will call twice select_db_content with SelectPartners
partner_side is either "A" or "B", indicating if the partner will be searched on side A or B.
this is done this way because there is no single sqlquery that will return a complete list
of partners of a given protein, given the fact that those partners can be on side A or B
this is an artifact of the database design: an interaction is formed by a sideA and a sideB. |
|
Static methods defined here:
- get_sqlquery(proteinPiana_value, partner_side, list_source_dbs='all', inverse_dbs='no', list_source_methods='all', inverse_methods='no', valid_source_dbs={}, get_interactionPiana='no')
|
class SelectPartnersProteinSharingCog(PianaSelectSQL) |
|
Generates the SQL statement that obtains interaction partners for proteins that share cog with a certain proteinPiana
This class is not to be used externally: the side (A or B)
where the protein is placed should be trasparent to the
external user. Piana makes this trasparent to the user by
creating a method (get_partners_of_proteins_sharing_cog) under PianaDBaccess that
performs two queries to obtain all partners. PianaDBaccess.get_partners_of_proteins_sharing_cog
will call twice select_db_content with SelectPartnersProteinSharingCog
partner_side is either "A" or "B", indicating if the partner will be searched on side A or B.
this is done this way because there is no single sqlquery that will return a complete list
of partners of a given protein, given the fact that those partners can be on side A or B
this is an artifact of the database design: an interaction is formed by a sideA and a sideB. |
|
Static methods defined here:
- get_sqlquery(proteinPiana_value, partner_side, list_source_dbs='all', inverse_dbs='no', list_source_methods='all', inverse_methods='no', valid_source_dbs={})
|
class SelectProteinAttributeRelationship(PianaSelectSQL) |
|
Generates the sql statement to select information about protein attributes relationship tables
the tables must follow the structure:
(currently for tables:
protein_table
proteinCog_table
proteinEC_table
proteinSpecies_table
proteinDescription_table
proteinKeyword_table
proteinFunction_table
proteinSubcellularLocation_table
) |
|
Static methods defined here:
- get_sqlquery(attribute_relationship_table, attribute_relationship_col, proteinPiana_value)
|
class SelectProteinID(PianaSelectSQL) |
|
Generates the SQL statement that obtains protein ids from protein tables
This is a generalization that can be used for any protein table that has at least these two fields:
proteinPiana
proteinID_X
Currently, this class can be used for all ID tables
"id_type" is only necessary when the table being used is the generalized table |
|
Static methods defined here:
- get_sqlquery(proteinCode_table, proteinCode_col, proteinPiana_value, source_db_info='no', return_primary=None, id_type=None)
|
class SelectProteinPiana(PianaSelectSQL) |
|
Generates the SQL statement that obtains proteinPiana from any other protein identifier (swissprot, ...)
Method get_sqlquery used to return the SQL query that retrieves the proteinPianas equivalent to "protein_code" of type "code_type"
Valid "code_type" value are those in PianaGlobals.xxxx_col that are in a table where there is as well a proteinPiana_col
if protein_code being passed is a pdb code, the format of the code must be pdb_code.chain_id If the chain_id is None, write pdb_code. (leaving the dot)
"isPrimary" is used when only user wants to obtain proteinPiana that correspond to primary external code
i.e. if an external code has assigned two proteinPianas, only those assigned to primary codes will be returned
"source_db_info" determines if information about the sourceDB that inserted the proteinPiana is returned or not
- "no" will simply return a list of proteinPianas
- "yes" will return a list of tuples (proteinPiana, sourceDBID)
"id_type" is only necessary when identifier type uses the generalized table |
|
Static methods defined here:
- get_sqlquery(protein_code=None, protein_code_column=None, protein_code_table=None, isPrimary=0, source_db_info='no', id_type=None)
|
class SelectProteinPianaFromMD5(PianaSelectSQL) |
|
Generates the SQL statement that obtains a list of all proteinPianas that correspond to a sequence (represented by its MD5 value)
This class is used to generate FASTA file of PIANA sequences |
|
Static methods defined here:
- get_sqlquery(proteinMD5_value)
|
class SelectProteinPianaFromTaxID_and_MD5(PianaSelectSQL) |
|
Generates the SQL statement that obtains the proteinPiana associated to a proteinMD5 and taxID in tables protein and sequence
This class is use to keep consistency of proteinPiana <--> proteinSequence and taxID between different versions of piana databases |
|
Static methods defined here:
- get_sqlquery(sequenceMD5_value, tax_id_value)
|
class SelectProteinPianaFromTaxID_and_sequenceID(PianaSelectSQL) |
|
Generates the SQL statement that obtains the proteinPiana associated to a proteinMD5 and taxID in table protein
This class is use to keep consistency of proteinPiana <--> proteinSequence and taxID between different versions of piana databases |
|
Static methods defined here:
- get_sqlquery(sequenceID_value, tax_id_value)
|
class SelectProteinPianaTax(PianaSelectSQL) |
|
Generates the SQL statement that obtains proteinPiana (of a specific taxonomy) from any other protein identifier (swissprot, ...)
Method get_sqlquery is used to return the SQL query that retrieves the proteinPianas (of a specific taxonomy)
equivalent to "protein_code"
Valid taxonomy_value values are those in NCBI taxonomy database
"source_db_info" determines if information about the sourceDB that inserted the proteinPiana is returned or not
- "no" will simply return a list of proteinPianas
- "yes" will return a list of tuples (proteinPiana, sourceDBID)
"isPrimary" is used when only user wants to obtain proteinPiana that correspond to primary external code
i.e. if an external code has assigned two proteinPianas, only those assigned to primary codes will be returned
"id_type" is only necessary when identifier type uses the generalized table |
|
Static methods defined here:
- get_sqlquery(protein_code=None, protein_code_column=None, protein_code_table=None, taxonomy_value=None, isPrimary=0, source_db_info='no', id_type=None)
|
class SelectProteinSimilarity(PianaSelectSQL) |
|
Generates the SQL statement that obtains a pair of similar proteins, if they exist
Selects two elements, must be taken into account when making the call to PianaDB |
|
Static methods defined here:
- get_sqlquery(proteinPianaA_value, proteinPianaB_value)
|
class SelectProteinTableColumn(PianaSelectSQL) |
|
Generates the SQL statement that obtains a column value of table protein, given a proteinPiana identifier
This is a generalization that can be used for any column of table protein |
|
Static methods defined here:
- get_sqlquery(proteinTable_column_value, proteinPiana_value)
|
class SelectSimilarProteins(PianaSelectSQL) |
|
Generates the SQL statement that obtains a list of proteins that are similar to a proteinPiana
"mode" can be:
- "higher" : searches in the column proteinPianaB
- "lower" : searches in the column proteinPianaA
To get all similar proteins you need to do two queries, one with mode higher and another with mode lower. PianaDBaccess.get_similar_proteins_dic does it... |
|
Static methods defined here:
- get_sqlquery(proteinPiana_value, mode=None)
|
class SelectValidSourceDBs(PianaSelectSQL) |
|
Generates the SQL statment that returns the current external databases integrated into PIANA
"database_type" is used to select only a type of database in function of the information it gives |
|
Static methods defined here:
- get_sqlquery(database_type=None)
|
class SelectXFromGoTermId(PianaSelectSQL) |
|
Generates the sql statement to select something (proteinPiana_col or go_acc_col)
from one of the two go tables (proteinGo_table or go_table) from a
given GO term_id |
|
Static methods defined here:
- get_sqlquery(x_col, term_id_value)
|
class UnlockTables(PianaSelectSQL) |
|
Generates the SQL statement that unlocks tables previously locked
Method used to return the SQL query that locks access to mysql tables. Insertions are faster if tables are previously locked.
table_list is a list of table names |
|
Static methods defined here:
- get_sqlquery()
| |