GithubHelp home page GithubHelp logo

tripal / tripal_analysis_blast Goto Github PK

View Code? Open in Web Editor NEW
2.0 9.0 6.0 405 KB

This module extends the Tripal Analysis Module and provides a method for loading XML results from the NCBI blast program. Blast results appear on each feature page.

License: GNU General Public License v3.0

PHP 94.77% CSS 1.72% JavaScript 3.51%
tripal ncbi-blast integration hacktoberfest

tripal_analysis_blast's Introduction

alt tag

Tripal 4 (Drupal 10)

               _   _                 _____                 _                                  _
     /\       | | (_)               |  __ \               | |                                | |
    /  \   ___| |_ ___   _____      | |  | | _____   _____| | ___  _ __  _ __ ___   ___ _ __ | |_
   / /\ \ / __| __| \ \ / / _ \     | |  | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __|
  / ____ \ (__| |_| |\ V /  __/     | |__| |  __/\ V /  __/ | (_) | |_) | | | | | |  __/ | | | |_
 /_/    \_\___|\__|_| \_/ \___|     |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__|
                                                                  | |
                                                                  |_|

Compatibility

Target Drupal Version 10.2.x-dev

Tested on PostgreSQL 13 + PostgreSQL 16

Drupal 10.2.x 10.3.x
PHP 8.1 Grid81-102-Badge Grid81-103-Badge
PHP 8.2 Grid82-102-Badge Grid82-103-Badge
PHP 8.3 Grid83-102-Badge Grid83-103-Badge

Code Coverage

This project uses Code Climate to determine the quality of our codebase and the coverage of our test suite. Compatibility above is based on passing of this test suite.

Test Coverage

Maintainability

Current Timeline

Required for Tripal 4.alpha3 Release

  • Display suite / page work
  • Importers: Publications
  • Search (ElasticSearch + Views)

How to get involved!

This upgrade to Drupal 10 is a community effort. As such, we NEED YOUR HELP!

  • To get involved, please join our Tripal Slack and comment in the #core-dev channel.
    • Alternatively, feel free to contact Lacey-Anne Sanderson through Slack direct message.
    • We can use help both with programming, documentation, outreach and welcome all individuals from all backgrounds!
  • We prefer automated testing for all Pull Requests (PRs) and are happy to guide you through the process!
    • Just comment on the issue if you need help designing tests
    • If you need help implementing tests see our documentation
  • If more documentation would be helpful, please create an issue here and we'll add it.

Documentation

Documentation for Tripal 4 has begun on ReadtheDocs.

Tripal Docker

Tripal Docker is currently focused on Development and Automated Testing. There will be a production focused Tripal Docker soon and if you're interested in helping or providing tips -please join us on our Slack channel!

For more information about how to use our fully functional development docker, see our documentation on ReadtheDocs!

tripal_analysis_blast's People

Contributors

abretaud avatar almasaeed2010 avatar bradfordcondon avatar chunhuaicheng avatar dsenalik avatar jwest60 avatar spficklin avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tripal_analysis_blast's Issues

NCBI NR parser

this issue was spawned from tripal/tripal#284 originally created by @btski

image

However, I see your point that it does look a bit odd. I think what you're suggesting is that you would have expected the hit name to just be the accession (e.g. XP_002302784.1) and the hit description to be the full text. Is this right?

but note @mpoelchau 's comment:

my main concern would be that the GenBank defline format (and RefSeq) seems to have changed since NCBI deprecated GI numbers.

https://ncbi.github.io/cxx-toolkit/pages/ch_demo#ch_demo.T5

GenBank fasta defline format now seems to be gb|accession|locus instead of gi|GInumber|gb|accession

blast xml results/parsing not working (database not configured)

I am exactly following the tutorial shown in the Tripal and Tripal Blast docs.
While trying to upload XML file as given here https://tripal.readthedocs.io/en/latest/user_guide/example_genomics/func_annots/blast.html

I am unable to see the database in the dropdown. The databases are not getting shown in the Blast tool page as well.
It is mentioned that

visit the Blast Settings page and configure a database under the "BLAST Parsing" section.

but I have already done it. I still tried it again many times but not getting "ExPASy Swiss-Prot" and "NCCBI nr" in the "Configured Database" panel even though I am selecting them from the dropdown to configure them.

I am using Drupal 7.100 with PHP8.1 in Ubuntu.

blast result parsing 1
blast result parsing 2
blast result parsing 3
blast result parsing 4

if no hits for a gene the output is confusing

Consider this gene page with no hits

screen shot 2018-11-08 at 10 15 49 am

Note the blank db name, and the figure drawn despite no hits (which is confusing).

if (count($items) == 0) {
$element[0] = array(
'#type' => 'markup',
'#markup' => 'There are no blast results.',
);
return;
}

Note that items isnt empty so the above code doesnt return. I instead propose:

foreach ($items as $delta => $item) {
if (!isset($item['parsed'])) {
continue;
}
$blast_result = $item['parsed'];
$hits_array = $blast_result->hits_array;
$db = $blast_result->db;
$analysis = $blast_result->analysis;
$pager_id = $feature_pager_id + $i;
$total_records = count($hits_array);

screen shot 2018-11-08 at 10 23 13 am

As you can see, in this case, our parsed result is empty. So in the above code, lets add a check for ->db and add a "no db" in the db name. And for $hits_array = $blast_result->hits_array;, return with a message similar to "No hits" without drawing the graph.

Error Installing 7.x-3.x

Hello,

We've encountered an error trying to install the latest dev version of this module:

drush en tripal_analysis_blast
The following extensions will be enabled: tripal_analysis_blast
Do you really want to continue? (y/n): y
WD tripal_chado: chado_select_record: the foreign key definition for [error]
'cv_id' on table 'cvterm' returned no results where the definition
supplied was Array
(
    [name] => format
)

[site http://default] [TRIPAL ERROR] [TRIPAL_CHADO] chado_select_record: the foreign key definition for 'cv_id' on table 'cvterm' returned no results where the definition supplied was Array(    [name] => format)
PDOException: SQLSTATE[23502]: Not null violation: 7 ERROR:  null    [error]
value in column "cvterm_id" violates not-null constraint
DETAIL:  Failing row contains (18, null, analysis, null). in
/home/vagrant/sites/HWG/includes/database/database.inc:2227
Stack trace:
#0 /home/vagrant/sites/HWG/includes/database/database.inc(2227):
PDOStatement->execute(NULL)
#1 /home/vagrant/sites/HWG/includes/database/pgsql/database.inc(106):
DatabaseStatementBase->execute(NULL, Array)
#2 /home/vagrant/sites/HWG/includes/database/pgsql/query.inc(96):
DatabaseConnection_pgsql->query(Object(DatabaseStatementBase), Array,
Array)
#3
/home/vagrant/sites/HWG/sites/all/modules/tripal/tripal_chado/includes/tripal_chado.mapping.inc(114):
InsertQuery_pgsql->execute()
#4
/home/vagrant/sites/HWG/sites/all/modules/tripal_analysis_blast/tripal_analysis_blast.install(461):
tripal_chado_add_cvterm_mapping(NULL, 'analysis', NULL)
#5
/home/vagrant/sites/HWG/sites/all/modules/tripal_analysis_blast/tripal_analysis_blast.install(85):
tripal_analysis_blast_create_entity_type()
#6 /home/vagrant/sites/HWG/includes/module.inc(926):
tripal_analysis_blast_install()
#7 /home/vagrant/sites/HWG/includes/module.inc(494):
module_invoke('tripal_analysis...', 'install')
#8
/home/vagrant/.config/composer/vendor/drush/drush/commands/core/drupal/environment_7.inc(143):
module_enable(Array)
#9
/home/vagrant/.config/composer/vendor/drush/drush/commands/pm/pm.drush.inc(1167):
drush_module_enable(Array)
#10
/home/vagrant/.config/composer/vendor/drush/drush/includes/command.inc(422):
drush_pm_enable('tripal_analysis...')
#11
/home/vagrant/.config/composer/vendor/drush/drush/includes/command.inc(231):
_drush_invoke_hooks(Array, Array)
#12
/home/vagrant/.config/composer/vendor/drush/drush/includes/command.inc(199):
drush_command('tripal_analysis...')
#13
/home/vagrant/.config/composer/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(67):
drush_dispatch(Array)
#14
/home/vagrant/.config/composer/vendor/drush/drush/includes/preflight.inc(66):
Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#15 /home/vagrant/.config/composer/vendor/drush/drush/drush.php(12):
drush_main()
#16 {main}

From the looks of it, it seems that the cv_term mapping is incomplete:

$identifier = array(
    'cv_id' => array('name' => 'format'),
    'name' => 'BLAST results'
  );
  $cvterm = tripal_get_cvterm($identifier);
  // $cvterm->cvterm_id <=== Ends up being null
  tripal_chado_add_cvterm_mapping($cvterm->cvterm_id, 'analysis', NULL);

Thanks!

Can not expand the blast information after upgrade to tripal_analysis_blast 7.x-3.1

Hi,

I have met problems with the layout of blast information (tripal v3, tripal_analysis_blast v7.3-3.0):

the layout of "SUMMARY" track was strange
image

And I have tried to fix this by upgrading the tripal_analysis_blast module to the latest 7.x-3.1, however, although the layout became normal after the upgrade, the detailed blast information cannot be expanded:

the blastp and interpro links turned into black and non-clickable.
image

This problem was still there even if I degrade back into tripal_analysis_blast v7.3-3.0.
How could I solve this problem?

And how could I add Blast analysis detail tag in the TOC of the gene page, just as the tripal v3 demo did:

image

Thank you!
Any suggestion would be appreciated.

Best wishes,

SongtaoGui

TripalImporter makes call to public.chado_analysis for nid

I get the below error on my site when visiting certain features. I believe its only occuring on features loaded since tripal 3 (ie not converted from nodes).

Warning: Missing argument 1 for db_query(), called in /data/www/html/hardwoods_dev/drupal-7.52/sites/all/modules/tripal_analysis_blast/includes/TripalImporter/BlastImporter.inc on line 847 and defined in db_query() (line 2401 of /data/www/html/hardwoods_dev/drupal-7.52/includes/database/database.inc).
Notice: Undefined variable: query in db_query() (line 2406 of /data/www/html/hardwoods_dev/drupal-7.52/includes/database/database.inc).
PDOException: SQLSTATE[HY000]: General error in BlastImporter->getResultObject() (line 847 of /data/www/html/hardwoods_dev/drupal-7.52/sites/all/modules/tripal_analysis_blast/includes/TripalImporter/BlastImporter.inc).

heres the offending code.

// Find node id for the analysis
if (module_exists('tripal_analysis')) {
$sql = "SELECT nid FROM {chado_analysis} WHERE analysis_id = :analysis_id";
$args = array(':analysis_id' => $analysis->analysis_id);
$ana_nid = db_query($sql, $args)->fetchField();
$analysis->nid = $ana_nid;
}

actually im confused on several levels.

  • why is this code executed in the importer?
  • my public.chado_analysis_table is totally empty.

PHP8 errors

Use of array_key_exists on an object is deprecated in PHP8
A simple fix in pull request #45

Continue in php 7.3

I get a bunch of warning about a switch statement using continue when it should use continue 2;.

"continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? BlastImporter.inc:553                                    [warning]
"continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? BlastImporter.inc:558                                    [warning]
"continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? BlastImporter.inc:569                                    [warning]
"continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? BlastImporter.inc:619                                    [warning]
"continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? BlastImporter.inc:636                                    [warning]
"continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? BlastImporter.inc:653                                    [warning]

I'll submit a fix for this soon.

regexp for hit Organism

Hi, just a little comment
I'm testing the regexp for Hit Organism, and for me
^.*?OS=(.*?)\s\w\w=.*$
doesnt work for detecting Arabidopsis thaliana in my entry:

<Hit_def>sp|P43288|KSG1_ARATH Shaggy-related protein kinase alpha OS=Arabidopsis
thaliana GN=ASK1 PE=2 SV=3</Hit_def>

but
^.*?OS=(.*?)\s\w=.*$
works fine :)

I post it here just in case its useful for someone not expert in regexp as me :)
thx bye!

Usage doc

Hi,
Now the 3.x module installs fine in our docker image, and I can load data with python-tripal and python-chado.
I'm just wondering what I'm supposed to do to display the blast results for the mRNA entities. Is it a field I should manually add to it (I couldn't find it in the list)? Do I need to publish blast results somehow?

Tripal v3 field has a few issues

  1. The [more] link isn't working. This is probably because it's being loaded by AJAX and the Javascript in the drupal behavior isn't being applied to it.
  2. The pager isn't working. But fixing this can wait until we create pager support for TripalFields (which is coming)

loading blast tabulated results

Hi, I want to ask if this module supports uploading blast tabulated results. The tabulated format has a bunch of additional attributes not defined in the XML DTD.

"Generating authentic blast xml output from tabular output is impossible because some of the information, like e.g. the actual alignments, is not present in the latter" (1). Redoing the blast would also take too much time.

If not, then I'm wondering how I might be able to implement this for myself. I'm a little hesitant about working with tables.

Thanks

BlastImporter Attempts to Find Node ID instead of Entity ID

At line 842, it tries to look for a non-existent db relation "chado_analysis".

 WD T_blastXML_load: PDOException: SQLSTATE[42P01]: Undefined table: 7 ERROR:  relation "chado_analysis" does[error]
not exist
LINE 1: SELECT nid FROM chado_analysis WHERE analysis_id = '4'
                        ^: SELECT nid FROM {chado_analysis} WHERE analysis_id = :analysis_id; Array
(
    [:analysis_id] => 4
)
 in BlastImporter->getResultObject() (line 842 of
/home/vagrant/code/drupal/sites/all/modules/tripal_analysis_blast/includes/TripalImporter/BlastImporter.inc).
FAILED: Rolling back database changes...  

I believe it should be looking for an entity id instead of node?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.