diff --git a/mkdocs/docs/admin/blast-databases.md b/mkdocs/docs/admin/blast-databases.md index 58d60b6..284ef7d 100644 --- a/mkdocs/docs/admin/blast-databases.md +++ b/mkdocs/docs/admin/blast-databases.md @@ -5,3 +5,66 @@ This documentation is still being developed as this module is being upgraded. +## How do I format my blast databases for use with Tripal BLAST? + +NCBI Blast+ comes with a program names `makeblastdb` which we will use to format a fasta file into a blast database. + +Arguements for makeblastdb command: + +- `-dbtype` indicates the type of sequence in the fasta file. It can be either `nucl` or `prot` +- `-parse_seqids` indicates that you want to parse the fasta headers to be used by the blast query program +- `-hash_index` creates an index for faster blast searches +- `-in FASTAFILE` indicates that the fasta file you replace the token FASTAFILE with should be the input (i.e. the source for the blast database). Note: gzipped fasta is not a supported type for your input file. +- `-input_type` indicates the type of file you provided to `-in` and it can be either `fasta` or `blastdb`. +- `-title` should be a human-readable title describing this blast database. I recommend using the full name of the assembly including the version and the accession if known. +- `-out GENOMEASSEMBLY` will be the filename of the blast database produced not including any file type suffix. The token GENOMEASSEMBLY should be replaced with an alphanumeric string uniquely describing the genome assembly that is the source for the blast database. + +### Nucleotide + +The command template to create a blast database from a nucleotide fasta file is: + +``` +makeblastdb -dbtype nucl -parse_seqids -hash_index -in FASTAFILE -input_type fasta -title "Genome Assembly Title with version" -out GENOMEASSEMBLY +``` + +An example which is actually how the demonstration blast database distributed with this module was created is: + +``` +makeblastdb -dbtype nucl -parse_seqids -hash_index -in Creinhardtii_281_v5.0.fa -input_type fasta -title "Chlamydomonas reinhardtii v5.6" -out Chlamydomonas_reinhardtii_v5.6 +``` + +and the output of the command was + +> Building a new DB, current time: 03/31/2024 22:10:54 +> New DB name: Chlamydomonas_reinhardtii_v5.6 +> New DB title: Chlamydomonas reinhardtii v5.6 +> Sequence type: Nucleotide +> Keep Linkouts: T +> Keep MBits: T +> Maximum file size: 1000000000B +> Adding sequences from FASTA; added 54 sequences in 1.82259 seconds. + +## Protein + +The command template to create a blast database from a protein fasta file is: + +``` +makeblastdb -dbtype prot -parse_seqids -hash_index -in FASTAFILE -input_type fasta -title "Genome Assembly Title with version" -out GENOMEASSEMBLY +``` + +An example which is actually how the demonstration blast database distributed with this module was created is: + +``` +makeblastdb -dbtype nucl -parse_seqids -hash_index -in Creinhardtii_281_v5.5.protein.fa -input_type fasta -title "Chlamydomonas reinhardtii v5.6 Protein" -out Chlamydomonas_reinhardtii_v5.6_protein +``` + +and the output of the command was + +> Building a new DB, current time: 03/31/2024 22:38:57 +> New DB name: Chlamydomonas_reinhardtii_v5.6_protein +> New DB title: Chlamydomonas reinhardtii v5.6 Protein +> Sequence type: Nucleotide +> Keep Linkouts: T +> Keep MBits: T +> Maximum file size: 1000000000B +> Adding sequences from FASTA; added 19526 sequences in 4.40205 seconds. diff --git a/mkdocs/docs/install/docker-demo.md b/mkdocs/docs/install/docker-demo.md index a231155..e44be6f 100644 --- a/mkdocs/docs/install/docker-demo.md +++ b/mkdocs/docs/install/docker-demo.md @@ -42,12 +42,12 @@ git checkout -b my-feature-or-fix ``` 4. Build the docker demonstration image. ``` -docker build --tag=tripalBlast:local ./ +docker build --tag=tripalblast:local ./ ``` 5. Create a container from the previous image in your current directory. The `--volume` part of this command will mount your current directory to the appropriate place inside the container. ``` -docker run --publish=80:80 -tid --name=tripalBlast --volume=`pwd`:/var/www/drupal/web/modules/contrib/tripal_blast tripalBlast:local -docker exec tripalBlast service postgresql restart +docker run --publish=80:80 -tid --name=tripalblast --volume=`pwd`:/var/www/drupal/web/modules/contrib/tripal_blast tripalblast:local +docker exec tripalblast service postgresql restart ``` Now you can interact with the Tripal site in your browser in all the same ways you would a regular Tripal site by going to https://localhost and logging in using the [Administrative username and password for the Tripal Docker](https://tripaldoc.readthedocs.io/en/latest/install/docker.html#development-site-information). diff --git a/src/Form/TripalBlastForm.php b/src/Form/TripalBlastForm.php index 86cfe12..709318b 100644 --- a/src/Form/TripalBlastForm.php +++ b/src/Form/TripalBlastForm.php @@ -210,8 +210,9 @@ public function buildForm(array $form, FormStateInterface $form_state, $query = $config_query_upload = \Drupal::config('tripal_blast.settings') ->get('tripal_blast_config_upload.allow_query'); + // We don't current support this well so disabling for now. $is_query_upload_true = $config_query_upload ?? TRUE; - if ($is_query_upload_true) { + if (FALSE) { // Upload a file as an alternative to enter a query sequence. $form['#attributes']['enctype'] = 'multipart/form-data'; @@ -263,8 +264,9 @@ public function buildForm(array $form, FormStateInterface $form_state, $query = '#default_value' => $defaults['SELECT_DB'], ]; + // We don't currently support this well so its being disabled for now. // Allow target upload - allow target configuration set to TRUE. - if ($config_query_upload) { + if (FALSE) { $form['#attributes']['enctype'] = 'multipart/form-data'; // diff --git a/src/Services/TripalBlastJobService.php b/src/Services/TripalBlastJobService.php index dae2c60..f39079c 100644 --- a/src/Services/TripalBlastJobService.php +++ b/src/Services/TripalBlastJobService.php @@ -247,6 +247,7 @@ public function jobsGetJobByJobId($job_id) { $config = \Drupal::service('tripal_blast.database_service') ->getDatabaseConfig($blastjob->target_blastdb); + $job->blastdb = new \stdClass(); $job->blastdb->db_name = $config['name']; $job->blastdb->db_path = $config['path']; $job->blastdb->linkout = new \stdClass(); diff --git a/src/Services/TripalBlastProgramBlastp.php b/src/Services/TripalBlastProgramBlastp.php new file mode 100644 index 0000000..83d39e9 --- /dev/null +++ b/src/Services/TripalBlastProgramBlastp.php @@ -0,0 +1,63 @@ +