Go to the source code of this file.
Definition in file dbsf.module.
| _dbsf_generate_options | ( | $ | software_name | ) |
Get software options, their values and the FAPI type
| $software_name | Name of software to generate options for |
Definition at line 1200 of file dbsf.module.
References dbsf_get_software_resources(), and icbasic_get_resource_cvterm_and_prop().
Referenced by dbsf_blast_form(), and dbsf_ssaha2_form().

| dbsf_admin_blast_page | ( | ) |
Create HTML for the administration BLAST page
Menu as admin/dbsf/blast
Definition at line 2202 of file dbsf.module.
References dbsf_admin_database_table(), and dbsf_check_software_active().

| dbsf_admin_database_files_table | ( | ) |
Builds a table with all files which could be added as datasets
Definition at line 1112 of file dbsf.module.
References dbsf_get_software(), and icbasic_get_add_resource().
Referenced by dbsf_admin_dataset_page().

| dbsf_admin_database_table | ( | $ | software = NULL |
) |
Builds a table containing all datasets that have been uploaded
| $software | Optionally, software to create the table for. Defaults to NULL i.e. all |
Definition at line 1024 of file dbsf.module.
References dbsf_get_resource_roles(), dbsf_get_software(), dbsf_get_software_resources(), icbasic_get_add_resource(), icbasic_get_linked_resources(), and icbasic_get_resource_cvterm_and_prop().
Referenced by dbsf_admin_blast_page(), dbsf_admin_dataset_page(), and dbsf_admin_ssaha2_page().

| dbsf_admin_dataset_page | ( | ) |
Produce HTML for the 'administrate dataset page'.
Menu admin/dbsf/dataset
Definition at line 210 of file dbsf.module.
References dbsf_admin_database_files_table(), and dbsf_admin_database_table().

| dbsf_admin_dataset_perms_form | ( | $ | form_state | ) |
Implements hook_form()
| $form_state | hook_form data |
Definition at line 924 of file dbsf.module.
References dbsf_get_role(), and icbasic_get_add_resource().

| dbsf_admin_dataset_perms_form_submit | ( | $ | form, | |
| &$ | form_state | |||
| ) |
Implements hook_form_submit()
dbsf_admin_dataset_perms_form_validate()
| $form | hook_form data | |
| $form_state | hook_form data |
Definition at line 974 of file dbsf.module.
References dbsf_link_unlink_resource_role().

| dbsf_admin_dataset_variables_form | ( | $ | form_state | ) |
Implements hook_form()
| $form_state | hook_form data |
Definition at line 412 of file dbsf.module.
| dbsf_admin_dataset_variables_form_submit | ( | $ | form, | |
| &$ | form_state | |||
| ) |
Implements hook_form_submit()
| $form | hook_form data | |
| $form_state | hook_form data |
Definition at line 496 of file dbsf.module.
References icbasic_get_add_resource().

| dbsf_admin_dataset_variables_form_validate | ( | $ | form, | |
| &$ | form_state | |||
| ) |
Implements hook_form_validate()
| $form | hook_form data | |
| $form_state | hook_form data |
Definition at line 457 of file dbsf.module.
| dbsf_admin_link_dataset_software_form | ( | $ | form_state, | |
| $ | software = NULL | |||
| ) |
Implements hook_form()
| $form_state | hook_form data | |
| $software | Which software to produce form for |
Definition at line 761 of file dbsf.module.
References dbsf_get_software(), and icbasic_get_add_resource().

| dbsf_admin_link_dataset_software_form_submit | ( | $ | form, | |
| &$ | form_state | |||
| ) |
Implements hook_form_submit()
| $form | hook_form data | |
| $form_state | hook_form data |
Definition at line 887 of file dbsf.module.
References dbsf_link_unlink_software_resource().

| dbsf_admin_link_dataset_software_form_validate | ( | $ | form, | |
| &$ | form_state | |||
| ) |
Implements hook_form_validate()
| $form | hook_form data | |
| $form_state | hook_form data |
Definition at line 826 of file dbsf.module.
References dbsf_get_dataset_path().

| dbsf_admin_newdataset_form | ( | $ | form_state | ) |
Implements hook_form()
| $form_state | hook_form data |
Definition at line 532 of file dbsf.module.
References icbasic_get_add_cv_withnames(), and icbasic_get_add_resource().

| dbsf_admin_newdataset_form_submit | ( | $ | form, | |
| &$ | form_state | |||
| ) |
Implements hook_form_submit()
| $form | hook_form data | |
| $form_state | hook_form data |
Definition at line 703 of file dbsf.module.
References dbsf_link_unlink_resource_role(), icbasic_get_add_resource(), icbasic_link_unlink_resources(), and icbasic_populate_cvterms().

| dbsf_admin_newdataset_form_validate | ( | $ | form, | |
| &$ | form_state | |||
| ) |
Implements hook_form_validate()
| $form | hook_form data | |
| $form_state | hook_form data |
Definition at line 614 of file dbsf.module.
References icbasic_get_add_resource().

| dbsf_admin_page | ( | ) |
Produce HTML for the 'administrate software page'.
Menu admin/settings/dbsf
Definition at line 166 of file dbsf.module.
| dbsf_admin_software_page | ( | ) |
Produce HTML for the 'administrate software page'.
Menu admin/dbsf/software Grabs available plugins as well.
Definition at line 273 of file dbsf.module.
| dbsf_batch_save_data | ( | $ | data = NULL, |
|
| &$ | context | |||
| ) |
Save an array to be used for the batch API. see batch_set()
| $data | A variable to store to $context | |
| $context | The variable used by batch API to store data |
Definition at line 1295 of file dbsf.module.
| dbsf_batch_upload_fasta | ( | $ | batch_file_data, | |
| &$ | context | |||
| ) |
Upload FASTA as used in a batch operation.
Needed because we use the same create_fasta function more than once
| $batch_file_data | Associative array with following keys.
| |
| $context | Array from batch_api |
Definition at line 1255 of file dbsf.module.
References dbsf_formatdb_fastafile(), and icbasic_write_fastafile().

| dbsf_blast_batch_finished | ( | $ | success, | |
| $ | results, | |||
| $ | operations | |||
| ) |
Implements hook_batch_finish
Handles the final operations of the BATCH API
| $success | See Drupal's BATCH API | |
| $results | See Drupal's BATCH API | |
| $operations | See Drupal's BATCH API |
Definition at line 2906 of file dbsf.module.
References dbsf_parameter_daemon().

| dbsf_blast_form | ( | $ | form_state, | |
| $ | sample_data = FALSE | |||
| ) |
Implements hook_form()
| $form_state | hook_form data | |
| $sample_data | Boolean, if TRUE then fill form with sample data |
Definition at line 2334 of file dbsf.module.
References $user, _dbsf_generate_options(), and dbsf_get_user_datasets().

| dbsf_blast_form_submit | ( | $ | form, | |
| &$ | form_state | |||
| ) |
Implements hook_form_submit()
| $form | hook_form data | |
| $form_state | hook_form data |
Definition at line 2701 of file dbsf.module.
References dbsf_blastall_software_pars(), dbsf_get_dataset_path(), and icbasic_create_uid().

| dbsf_blast_form_validate | ( | $ | form, | |
| &$ | form_state | |||
| ) |
Implements hook_form_validate()
| $form | hook_form data | |
| $form_state | hook_form data |
Definition at line 2626 of file dbsf.module.
References icbasic_validate_seq_dna(), and icbasic_validate_seq_protein().

| dbsf_blast_page | ( | $ | sample_data = FALSE |
) |
Creates HTML for the BLAST page
Menu as dbsf/blast
| $sample_data | If true then the form will be prefilled with sample data |
Definition at line 2288 of file dbsf.module.
References dbsf_check_blast().

| dbsf_blast_result_form | ( | $ | form_state, | |
| $ | uid, | |||
| $ | blastfile | |||
| ) |
Implements hook_form()
Used to produce a table of results with checkboxes which we can then select for processing (e.g. downloading). This form is themed.
| $form_state | Form API variable | |
| $uid | Unique Identifier of algorithm's BLAST search | |
| $blastfile | Full path to BLAST results as an XML file |
Definition at line 3182 of file dbsf.module.
References dbsf_blast_result_xml().

| dbsf_blast_result_page | ( | $ | submission_uid = NULL |
) |
Produces HTML results for a BLAST
| $submission_uid | The UID relating to the submission. This is not the same as the individual BLAST algorithm UID as users can perform multiple algorithm searches from one form |
Definition at line 3097 of file dbsf.module.
| dbsf_blast_result_xml | ( | $ | blastfile = NULL |
) |
Parses a BLAST XML file.
| $blastfile | Full path to BLAST XML file |
Definition at line 2962 of file dbsf.module.
Referenced by dbsf_blast_result_form().
| dbsf_blastall_software_pars | ( | $ | data, | |
| $ | algorithm | |||
| ) |
Prepares the BLAST software cmdline parameters
They will then be return to a file for parsing by the daemon
| $data | Associative array with BLAST option key/values for parsing into a parameter string | |
| $algorithm | The BLAST algorithm used TODO: Integrate it into $data |
Definition at line 2835 of file dbsf.module.
Referenced by dbsf_blast_form_submit().
| dbsf_check_blast | ( | $ | software | ) |
Checks if BLAST is setup correctly
Use this function as a template for plugins.
| $software | The name of software to check |
Definition at line 2247 of file dbsf.module.
References dbsf_check_software_active(), and dbsf_get_softwareprop().
Referenced by dbsf_blast_page().

| dbsf_check_software_active | ( | $ | software | ) |
Helper function to check if a software is active
| $software | ID or uniquename of software to check. |
Definition at line 185 of file dbsf.module.
Referenced by dbsf_admin_blast_page(), dbsf_admin_ssaha2_page(), dbsf_check_blast(), dbsf_check_ssaha2(), and dbsf_software_blast_core_settings_form().
| dbsf_cron | ( | ) |
| dbsf_delete_temp | ( | $ | file = NULL |
) |
Delete a file if older than 7 days.
Used with cron
| $file | File to delete |
Definition at line 1599 of file dbsf.module.
| dbsf_form_clear | ( | $ | form, | |
| &$ | form_state | |||
| ) |
This submit button will clear any form which calls it, incl. storage and values
Used as a hook_form_validate
| $form | hook_form data | |
| $form_state | hook_form data |
Definition at line 1009 of file dbsf.module.
| dbsf_formatdb_fastafile | ( | $ | infile, | |
| $ | file_type = 'protein' | |||
| ) |
Format a FASTA file for BLAST
| $infile | Full path to file to format. | |
| $file_type | Either 'protein' or 'nucleotide' |
Definition at line 1367 of file dbsf.module.
Referenced by dbsf_batch_upload_fasta().
| dbsf_get_dataset_path | ( | $ | dataset | ) |
Get full path to a dataset
| $dataset | Dataset to get path for |
Definition at line 2014 of file dbsf.module.
References $dir, and icbasic_get_linked_resources().
Referenced by dbsf_admin_link_dataset_software_form_validate(), dbsf_blast_form_submit(), and dbsf_ssaha2_form_submit().

| dbsf_get_resource_roles | ( | $ | resource, | |
| $ | name_as_key = NULL | |||
| ) |
Get roles linked to a specific resource
| $resource | id ID or uniquename of resource to get data for | |
| $name_as_key | If TRUE, return array is not indexed by id but by the name of roles |
Definition at line 1973 of file dbsf.module.
Referenced by dbsf_admin_database_table(), and dbsf_get_user_datasets().
| dbsf_get_role | ( | $ | limit = NULL |
) |
Get drupal roles, optionally with a limit
| $limit | Optionally add a limit. It can be a two element array with first element to act as the column name and second as the value. or it can be a string to be added after WHERE. |
Definition at line 1166 of file dbsf.module.
Referenced by dbsf_admin_dataset_perms_form().
| dbsf_get_sequence | ( | $ | uid = NULL, |
|
| $ | database = NULL | |||
| ) |
Retrieve the sequence from a formatdb-ed dataset
Used when retrieving hits of BLAST reports
| $uid | the UID of the BLAST report, used to grab the database | |
| $database | Explicitly set the database to get the sequence from. It can be a string or a list array. |
Definition at line 1468 of file dbsf.module.
| dbsf_get_software | ( | $ | limit = NULL, |
|
| $ | name_as_key = NULL | |||
| ) |
Get all software
| $limit | Optionally add a limit. It can be an assoc. array where key is column, value is constraint or a string to append with an AND | |
| $name_as_key | If TRUE then return array has uniquename as the key and id as the value. |
Definition at line 1919 of file dbsf.module.
Referenced by dbsf_admin_database_files_table(), dbsf_admin_database_table(), and dbsf_admin_link_dataset_software_form().
| dbsf_get_software_resources | ( | $ | limit = NULL, |
|
| $ | name_as_key = FALSE | |||
| ) |
Get all resources linked for a specific software
| $limit | Aptionally an array or string to add a constraint. NB: The software table is aliased as s; resource as r; software_resource as sr and cvterm (linked with resource) as rcvterm | |
| $name_as_key | A boolean, if TRUE then return array uses names instead of IDs |
Definition at line 1857 of file dbsf.module.
Referenced by _dbsf_generate_options(), dbsf_admin_database_table(), and dbsf_get_user_datasets().
| dbsf_get_softwareprop | ( | $ | limit = NULL, |
|
| $ | name_as_key = FALSE | |||
| ) |
Get the properties from the softwareprop table
| $limit | Optionally add a limit. It can be a string to be added after WHERE or an array where they keys are the column names | |
| $name_as_key | If TRUE, set the return array to use the software uniquename as the key |
Definition at line 1812 of file dbsf.module.
Referenced by dbsf_check_blast(), and dbsf_check_ssaha2().
| dbsf_get_user_datasets | ( | $ | software_name | ) |
Get software datasets available to visitor/user
| $software_name | Name of software to get datasets for |
Definition at line 1402 of file dbsf.module.
References $user, dbsf_get_resource_roles(), dbsf_get_software_resources(), icbasic_get_linked_resources(), and icbasic_get_resource_cvterm_and_prop().
Referenced by dbsf_blast_form(), and dbsf_ssaha2_form().

| dbsf_init | ( | ) |
TODO Foreign Keys Implements hook_init().
Definition at line 28 of file dbsf.module.
| dbsf_link_unlink_resource_role | ( | $ | resource, | |
| $ | role, | |||
| $ | switch = FALSE | |||
| ) |
Link a Drupal role with a resource
| $resource | The ID or uniquename of the resource to link | |
| $role | The ID or name of the Drupal role to link | |
| $switch | Boolean of whether to delete instead of linking an association. TRUE deletes. Also, TOGGLE links if unlinked and deletes if linked. |
Definition at line 1629 of file dbsf.module.
Referenced by dbsf_admin_dataset_perms_form_submit(), and dbsf_admin_newdataset_form_submit().
| dbsf_link_unlink_software_resource | ( | $ | software, | |
| $ | resource, | |||
| $ | switch = FALSE | |||
| ) |
Link a software with a specific resource
| $software | The ID or uniquename of the software to link | |
| $resource | The id or name of the resource to link | |
| $switch | Boolean of whether to delete instead of linking an association. TRUE deletes. Also, TOGGLE links if unlinked and deletes if linked. |
Definition at line 1722 of file dbsf.module.
Referenced by dbsf_admin_link_dataset_software_form_submit().
| dbsf_menu | ( | ) |
Implements hook_menu().
If it finds plugin files, it adds them too.
Definition at line 62 of file dbsf.module.
References dbsf_ssaha2_menu().

| dbsf_parameter_daemon | ( | $ | uid, | |
| $ | dir, | |||
| $ | par, | |||
| $ | software = 'blastall', |
|||
| $ | other_data = NULL | |||
| ) |
Create parameter file for daemon
| $uid | A unique identifier | |
| $dir | Directory of where to create the file | |
| $par | Contents to print, such as the parameters to be used by the software | |
| $software | Name of software used | |
| $other_data | A string or array with any other data which should be written. If it is an associative array, the data are printed as $key : $value |
Definition at line 1317 of file dbsf.module.
References $dir.
Referenced by dbsf_blast_batch_finished().
| dbsf_perm | ( | ) |
Implements hook_perm().
Definition at line 35 of file dbsf.module.
| dbsf_software_blast_core_settings_form | ( | $ | form_state | ) |
Implements hook_form()
| $form_state | hook_form data |
Definition at line 2047 of file dbsf.module.
References dbsf_check_software_active().

| dbsf_software_blast_core_settings_form_submit | ( | $ | form, | |
| &$ | form_state | |||
| ) |
Implements hook_form_submit()
| $form | hook_form data | |
| $form_state | hook_form data |
Definition at line 2160 of file dbsf.module.
| dbsf_software_blast_core_settings_form_validate | ( | $ | form, | |
| &$ | form_state | |||
| ) |
Implements hook_form_validate()
| $form | hook_form data | |
| $form_state | hook_form data |
Definition at line 2113 of file dbsf.module.
| dbsf_software_form | ( | $ | form_state | ) |
Implements of hook_form()
Used when selecting which software to make available
| $form_state | hook_form data |
Definition at line 336 of file dbsf.module.
| dbsf_software_form_submit | ( | $ | form, | |
| &$ | form_state | |||
| ) |
Implements hook_form_submit()
| $form | hook_form data | |
| $form_state | hook_form data |
Definition at line 385 of file dbsf.module.
| dbsf_software_select_page | ( | ) |
Produce HTML for the 'select software page'.
Menu dbsf/software
Definition at line 136 of file dbsf.module.
| dbsf_theme | ( | ) |
Implement hook_theme()
Definition at line 47 of file dbsf.module.
| dbsf_theme_blast_result_form | ( | $ | form | ) |
Themes BLAST result form
| $form | Form API form variable which will be themed. |
Definition at line 3283 of file dbsf.module.
1.5.5