Go to the source code of this file.
Functions | |
| icbasic_init () | |
| icbasic_encode ($variable) | |
| icbasic_decode ($encoded) | |
| icbasic_array2csv ($array=NULL, $quote=NULL, $separator= ',', $key=FALSE) | |
| icbasic_db_execute ($db=NULL, $function=NULL, $variables=NULL) | |
| icbasic_validate_ic_id ($accession=NULL) | |
| icbasic_validate_seq_dna ($seq=NULL) | |
| icbasic_validate_seq_protein ($seq=NULL) | |
| icbasic_chadoapi_get_single_table ($table=NULL, $field= 'uniquename', $value=NULL) | |
| icbasic_checkboxes_results2array ($results) | |
| icbasic_add_cv ($cv, $cvterm_array) | |
| icbasic_populate_prop ($table_type, $object_name, $cvterm_id, $property_array) | |
| icbasic_populate_cvterms ($table_type, $object_name, $cvname, $cvterm_array) | |
| icbasic_get_add_cv_withnames ($cv_name, $cvterm_name=NULL, $name_as_key=FALSE) | |
| icbasic_get_add_dbxref_withnames ($dbname, $accession) | |
| icbasic_clear_session ($var=NULL) | |
| icbasic_create_uid ($sessionid=NULL, $timestamp=NULL, $string=NULL) | |
| icbasic_get_resource_name_id ($resource, $name_as_key=FALSE) | |
| icbasic_get_add_resource ($type_name, $data=NULL, $add=FALSE, $name_as_key=FALSE) | |
| icbasic_get_resource_cvterm_and_prop ($resource) | |
| icbasic_link_unlink_resources ($subject, $rel, $object=NULL, $replace=FALSE) | |
| icbasic_get_linked_resources ($resource, $relationship_name=NULL, $name_as_key=FALSE, $limit=NULL) | |
| icbasic_write_fastafile ($infile=NULL, $outfile=NULL, $delete=NULL) | |
Developed by Alexie Papanicolaou
Definition in file icbasic.module.
| icbasic_add_cv | ( | $ | cv, | |
| $ | cvterm_array | |||
| ) |
Populate a CV table using a CV name and a list of CVTERMS
| $cv | Name of CV | |
| $cvterm_array | A list array of cvterm names to add |
Definition at line 360 of file icbasic.module.
Referenced by dbsf_install(), and icbasic_populate_cvterms().
| icbasic_array2csv | ( | $ | array = NULL, |
|
| $ | quote = NULL, |
|||
| $ | separator = ',', |
|||
| $ | key = FALSE | |||
| ) |
Convert an array to a quoted string, suitable for SQL queries
Essentially implode() with bells and whistles
| $array | a list array of elements to ocnvert to a comma delimited string | |
| $quote | give TRUE to include quotes around element or pass any string to include left and right of element | |
| $separator | character to separate elements in list | |
| $key | Boolean, if true then return the keys of the $array. |
Definition at line 90 of file icbasic.module.
| icbasic_chadoapi_get_single_table | ( | $ | table = NULL, |
|
| $ | field = 'uniquename', |
|||
| $ | value = NULL | |||
| ) |
Definition at line 313 of file icbasic.module.
| icbasic_checkboxes_results2array | ( | $ | results | ) |
Cleans and decomposes a checkbox FAPI result array
| $results | FAPI Checkboxes result as an associative array |
Definition at line 333 of file icbasic.module.
| icbasic_clear_session | ( | $ | var = NULL |
) |
Clear all or part of $_SESSION
| $var | A string or a list array of $_SESSION parameter names(s) to empty. If no $var is provided, then the whole of $_SESSION is emptied (use with care) |
Definition at line 674 of file icbasic.module.
| icbasic_create_uid | ( | $ | sessionid = NULL, |
|
| $ | timestamp = NULL, |
|||
| $ | string = NULL | |||
| ) |
Create a Unique Identifier using SESSIONID, time and, optionally, a string
Uses the md5 algorithm to generate a hexadecimal unique identifier.
time()
md5()
| $sessionid | the session id to include in the calculation. If empty, it is retrieved. | |
| $timestamp | Unix timestamp (integer) to include in md5 calculation. If empty, it's retrieved. | |
| $string | Optionally, add a string to the md5 calculation. This allows you to generate multiple UIDs with the same timestamp. |
Definition at line 712 of file icbasic.module.
Referenced by dbsf_blast_form_submit(), and dbsf_ssaha2_form_submit().
| icbasic_db_execute | ( | $ | db = NULL, |
|
| $ | function = NULL, |
|||
| $ | variables = NULL | |||
| ) |
Seamlessly execute a connection to an non-drupal database
| $db | Name of database to connect to as in settings.php | |
| $function | Function to execute to $db | |
| $variables | variables to pass to above function |
Definition at line 137 of file icbasic.module.
| icbasic_decode | ( | $ | encoded | ) |
Decodes icbasic_encode function
| $encoded | Variable to be decoded |
Definition at line 64 of file icbasic.module.
| icbasic_encode | ( | $ | variable | ) |
Encodes a variable using base64,serialize and gzcompress
Allows encoding of more than 2000 characters (IE6 problem)
| $variable | Variable to be encoded |
Definition at line 46 of file icbasic.module.
| icbasic_get_add_cv_withnames | ( | $ | cv_name, | |
| $ | cvterm_name = NULL, |
|||
| $ | name_as_key = FALSE | |||
| ) |
Get cvterm_id for a CV, add it first if it does not exist.
Also if cvterm_name is not given, it will return all cvterm_id/cvterm_names for the CV. $name_as_key controls the return array
| $cv_name | The name of the CV to which the cvterm belong. | |
| $cvterm_name | The name of the cvterm to look for or add. Not needed if just want to retrieve all cvterms | |
| $name_as_key | TRUE, FALSE or BOTH. False gives cvterm_id as key to return array; TRUE gives name with ID as value; BOTH gives name both as key and value (useful for FAPI) |
Definition at line 543 of file icbasic.module.
Referenced by dbsf_add_software_blast(), dbsf_add_software_ssaha2(), dbsf_admin_newdataset_form(), icbasic_get_add_resource(), icbasic_get_linked_resources(), and icbasic_link_unlink_resources().
| icbasic_get_add_dbxref_withnames | ( | $ | dbname, | |
| $ | accession | |||
| ) |
Get dbxref_id for a dbxref; add it first if it doesn't exist
| $dbname | Name of db to link dbxref | |
| $accession | Accession/uniquename for dbxref to get and/or add. |
Definition at line 623 of file icbasic.module.
Referenced by dbsf_add_software_blast(), dbsf_add_software_ssaha2(), and icbasic_get_add_resource().
| icbasic_get_add_resource | ( | $ | type_name, | |
| $ | data = NULL, |
|||
| $ | add = FALSE, |
|||
| $ | name_as_key = FALSE | |||
| ) |
Get a list of resources, replace or add a new one
| $type_name | Name of the cvterm which defines the resource type | |
| $data | (optional) An assoc. array to limit SELECT queries: the keys are used as column and values as the condition. Further, when adding/replacing, $data has to contain keys with 'uniquename' and 'dbxref_name' | |
| $add | Switch which can be FALSE/NULL, ADD, DELETE or REPLACE | |
| $name_as_key | A boolean. If TRUE the return array has uniquename as keys and resource_id as values. |
Definition at line 778 of file icbasic.module.
References icbasic_get_add_cv_withnames(), and icbasic_get_add_dbxref_withnames().
Referenced by dbsf_admin_database_files_table(), dbsf_admin_database_table(), dbsf_admin_dataset_perms_form(), dbsf_admin_dataset_variables_form_submit(), dbsf_admin_link_dataset_software_form(), dbsf_admin_newdataset_form(), dbsf_admin_newdataset_form_submit(), and dbsf_admin_newdataset_form_validate().

| icbasic_get_linked_resources | ( | $ | resource, | |
| $ | relationship_name = NULL, |
|||
| $ | name_as_key = FALSE, |
|||
| $ | limit = NULL | |||
| ) |
Get all object resources stored in the resource_resource table
| $resource | id ID or uniquename of subject resource | |
| $relationship_name | Optionally delimit by relationship type by providing the type name | |
| $name_as_key | A boolean, if TRUE then the return array has uniquename as key | |
| $limit | A string. Optionally pass a string to add as LIMIT to the query. |
Definition at line 1028 of file icbasic.module.
References icbasic_get_add_cv_withnames().
Referenced by dbsf_admin_database_table(), dbsf_get_dataset_path(), and dbsf_get_user_datasets().

| icbasic_get_resource_cvterm_and_prop | ( | $ | resource | ) |
Get cvterms and properties for a resource
| $resource | ID or name of resource to get cvterms and properties for. |
Definition at line 872 of file icbasic.module.
Referenced by _dbsf_generate_options(), dbsf_admin_database_table(), and dbsf_get_user_datasets().
| icbasic_get_resource_name_id | ( | $ | resource, | |
| $ | name_as_key = FALSE | |||
| ) |
Get 1+ resource names/IDs by providing 1+ resource IDs/names
| $resource | A string or list array of IDs or uniquename of resources to fetch | |
| $name_as_key | A boolean, if true then the key of the returned array is the uniquename. |
Definition at line 736 of file icbasic.module.
| icbasic_init | ( | ) |
Implements of hook_init
Definition at line 27 of file icbasic.module.
| icbasic_link_unlink_resources | ( | $ | subject, | |
| $ | rel, | |||
| $ | object = NULL, |
|||
| $ | replace = FALSE | |||
| ) |
Link two resources with a relationship
| $subject | The resource_ID or uniquename of the subject of the relationship | |
| $rel | The name of a relationship such as 'part_of' or 'uses' | |
| $object | The resource_ID or uniquename object of the relationship | |
| $replace | Whether to fail if an existing relationship exists (FALSE), replace it (TRUE) or simply delete it ('DELETE'). If $object is NULL and $replace is DELETE then all relationships $rel for $subject are removed. |
Definition at line 923 of file icbasic.module.
References icbasic_get_add_cv_withnames().
Referenced by dbsf_admin_newdataset_form_submit().

| icbasic_populate_cvterms | ( | $ | table_type, | |
| $ | object_name, | |||
| $ | cvname, | |||
| $ | cvterm_array | |||
| ) |
Populate a _cvterm Chado table
| $table_type | Type of table linked to teh _cvterm table Currently, only feature and resource table sets are supported | |
| $object_name | Name of reference feature/resourc | |
| $cvname | Name of CV to which the cvterms belong to |
| $cvterm_array | A list array of cvterms to add to the _cvterm table |
Definition at line 474 of file icbasic.module.
References icbasic_add_cv().
Referenced by dbsf_add_software_blast(), dbsf_add_software_ssaha2(), and dbsf_admin_newdataset_form_submit().

| icbasic_populate_prop | ( | $ | table_type, | |
| $ | object_name, | |||
| $ | cvterm_id, | |||
| $ | property_array | |||
| ) |
Populate a IC Chado property table
| $table_type | Type of table linked to the -prop table. Currently only feature and resource are allowed | |
| $object_name | Name of reference feature/resource | |
| $cvterm_id | CV term ID used to link the property | |
| $property_array | An array of property values to insert with the above cvterm and reference |
Definition at line 404 of file icbasic.module.
Referenced by dbsf_add_software_blast(), and dbsf_add_software_ssaha2().
| icbasic_validate_ic_id | ( | $ | accession = NULL |
) |
Validate and InsectaCentral accession ID.
| $accession | ID to validate |
Definition at line 184 of file icbasic.module.
| icbasic_validate_seq_dna | ( | $ | seq = NULL |
) |
Validate that a sequence is with IUPAC DNA alphabet only
Xs are allowed
| $seq | string of sequence to validate |
Definition at line 209 of file icbasic.module.
Referenced by dbsf_blast_form_validate(), and dbsf_ssaha2_form_validate().
| icbasic_validate_seq_protein | ( | $ | seq = NULL |
) |
Validate a protein sequence using IUPAC amino acids
Xs are allowed
| $seq | Sequence string to validate |
Definition at line 266 of file icbasic.module.
Referenced by dbsf_blast_form_validate().
| icbasic_write_fastafile | ( | $ | infile = NULL, |
|
| $ | outfile = NULL, |
|||
| $ | delete = NULL | |||
| ) |
Write a FASTA file to a destination
Used when uploading from a form
| $infile | Full path to input file, e.g. one uploaded into temp dir /tmp/temp.txt | |
| $outfile | Desired destination (including filename) for FASTA file. | |
| $delete | A boolean of whether to delete the input file after transfer. |
Definition at line 1089 of file icbasic.module.
Referenced by dbsf_batch_upload_fasta().
1.5.5