-
Notifications
You must be signed in to change notification settings - Fork 51
Tripal 4 sequence coordinate field #1700
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tripal 4 sequence coordinate field #1700
Conversation
|
You will need to update your PR with the most recent 4.x which includes a change to the YAML file organization for adding fields. Essentially, content types and fields are now broken down by cactegory so you will want to move the changes you originally made to default_chado.yml to genomic_chado.yml. |
…sequence_coordinates
e884fe8 to
b6e40af
Compare
…sequence_coordinates
|
YML file is modified and field files were pushed. |
|
Table formatter for sequence coordinates has been added. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great. But I have a few suggestions.
- We need to merge the 4.x branch (I tested your PR after doing this locally)
- For the list formatter, there is a trailing semicolon that shouldn't be there
I see for Tripal 3 for the list version of the formatter, the displayed value is generated by
$locations[] = $srcfeature . ':' . $fmin . '..' . $fmax . $strand;
and that phase is ignored. You are including phase, when present, which is good, and not including null values, also good.
I think we just need to do like you find intripal_chado/src/api/tripal_chado.query.api.php:928: $sql = mb_substr($sql, 0, -2); // Get rid of the trailing comma & space. - For the table formatter, in Tripal 3 it looks like
and here it looks like
Note that you are displaying the gene ID instead of the name of the sequence that it is located on, this needs to be changed to the name of the sequence that it is located on.
Update: This cannot currently be done, see issue #1767
-
same change for list formatter for the name of the sequence
-
My personal preference would be to have the "Strand" displayed before "Phase" - but that's just my preference.
-
Strand should be displaying
+- something is wrong here (the gene is feature_id=3 for my test)
select F.*, T.name from feature F left join cvterm T on F.type_id=T.cvterm_id;
feature_id | dbxref_id | organism_id | name | uniquename | residues | seqlen | md5checksum | type_id | is_analysis | is_obsolete | timeaccessioned | timelastmodified | name
------------+-----------+-------------+------------------------------+-------------------------------------------------------------+----------+--------+----------------------------------+---------+-------------+-------------+----------------------------+----------------------------+-----------------
3 | | 1 | orange1.1g015632m.g | orange1.1g015632m.g | | 0 | | 165 | f | f | 2024-01-24 02:41:43.475274 | 2024-01-24 02:41:43.475274 | gene
select * from featureloc where feature_id=3;
featureloc_id | feature_id | srcfeature_id | fmin | is_fmin_partial | fmax | is_fmax_partial | strand | phase | residue_info | locgroup | rank
---------------+------------+---------------+---------+-----------------+---------+-----------------+--------+-------+--------------+----------+------
2 | 3 | 1 | 4058459 | f | 4062210 | f | 1 | | | 0 | 0
Edit: You can fix this problem with quotes
$strand_symb = match( $strand_val ) {
'-1' => '-',
'1' => '+',
default => 'unknown',
};
- for the case of a truly unknown strand, I would prefer a blank instead of
unknownbut again my personal preference.
tripal_chado/src/Plugin/Field/FieldType/ChadoSequenceCoordinatesDefault.php
Outdated
Show resolved
Hide resolved
|
Some comments on this field. Where the |
|
Also, once the PR #1788 is merged, then this field should not have the problem with a |
|
@pdtouch the functionality Stephen mentioned is merged now so this field should work + be testable. Will you have time to update this PR based on the reviews? |
|
I will update the PR.
Thanks
…On Sat, Feb 24, 2024, 1:58 PM Lacey-Anne Sanderson ***@***.***> wrote:
@pdtouch <https://github.com/pdtouch> the functionality Stephen mentioned
is merged now so this field should work + be testable. Will you have time
to update this PR based on the reviews?
—
Reply to this email directly, view it on GitHub
<#1700 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAP6JTKAOMW6PRFNMFF2JY3YVJA73AVCNFSM6AAAAAA76GXV4CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRSGY3DSOJXGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
…oordinates-field: tv4g1-issue1414-data__sequence_coordinates
…oordinates-field: tv4g1-issue1414-data__sequence_coordinates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With my suggested changes I built a new docker and followed the testing steps. (I loaded the fasta, then the gff3.)
Coordinates appear as they should
Unfortunately, with the table formatter, the strand is not showing
I can add a test value for phase
sitedb=> update featureloc set phase=2 where featureloc_id=2;
and I have added another code suggestion to fix the strand, then the table format works too
tripal_chado/src/Plugin/Field/FieldType/ChadoSequenceCoordinatesDefault.php
Show resolved
Hide resolved
tripal_chado/src/Plugin/Field/FieldFormatter/ChadoSequenceCoordinatesFormatterTable.php
Outdated
Show resolved
Hide resolved
…oordinates-field: tv4g1-issue1414-data__sequence_coordinates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent, with these changes this is the exact code I tested, so I can now approve
Field Sequence Coordinates
Issue # 1414
Tripal Version: 4
Description :
This is required for Sequence Coordinates field to run in Tripal 4. Since the YML file for the field has been updated, this field should be active for the Gene page. The Tripal-3 version of this field can be viewed here:
https://github.com/tripal/tripal/tree/7.x-3.x/tripal_chado/includes/TripalFields/data__sequence_coordinates
Two formatters are present one for linear view of the coordinates and other for a tabular view.
Testing?
Build and run docker image as required and verify Tripal can be accessed from its URL.
Access docker container using branch name : tv4g1-issue1414-data__sequence_coordinates
Change max_filesize value in settings file :
/usr/local/etc/php/php.inito a high value say 12MB.service apache2 restartand exit from container. (This step is not required to just publish gene imported via Tripal -> Data Loaders -> Chado GFF3 File Loader )Log into Drupal/Tripal GUI and create Citrus Organism Tripal Content
Ref: https://tripal.readthedocs.io/en/latest/user_guide/example_genomics/organisms.html
Create Analysis content :
Ref: https://tripal.readthedocs.io/en/latest/user_guide/example_genomics/analyses.html
Structure -> Tripal Content Types -> Import type collection -> Genomic Content Types for viewing Gene content.
Load Feature Data (gene and sequence information)
Ref: https://tripal.readthedocs.io/en/latest/user_guide/example_genomics/genomes_genes.html
(Tripal -> Data Loaders -> Chado GFF3 File Loader )
Publish the gene (Content -> Tripal Content -> +Publish Tripal Content -> Chado Storage, Content Type: Gene -> Publish)
Click on the Tripal Content -> gene that was just created.
If the field is working properly, the gene entered via the GUI would be viewable and editable with the relevant coordinate information under Sequence Coordinates.
Structure -> Tripal Content Types -> Gene -> Edit -> Manage Display -> Change Sequence Coordinates formatter to "Chado sequence coordinates table formatter" and see coordinates being displayed as a table.