Skip to content
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

File Relationships #1

Closed
spficklin opened this issue Oct 21, 2020 · 6 comments
Closed

File Relationships #1

spficklin opened this issue Oct 21, 2020 · 6 comments

Comments

@spficklin
Copy link
Member

We are missing the ability to have relationships between files such that one could supercede the other or files could be grouped

@dsenalik
Copy link
Collaborator

I have wondered about this for files that naturally come in pairs, such as fastq forward + reverse reads, or vcf + index file.
With minimal changes we could add a "File Name" column to the download field.
For example
addfilename

@dsenalik
Copy link
Collaborator

dsenalik commented Apr 17, 2021

I really want this, but others may not, so I implemented this additional column as an optional setting, default is off.
That required building the whole administration page interface, so while I was in there I threw in a help page too!
See pull request #20

@dsenalik
Copy link
Collaborator

dsenalik commented Nov 4, 2021

My Nov. 4 commit to pull request #20 resolves this by adding a way to enter a display_name value, which is the name displayed to the user. Comments welcomed!

@dsenalik
Copy link
Collaborator

dsenalik commented Jul 25, 2022

To-do notes for a possible problem to fix. Under php 8 this becomes worse, but the new filename column in the chado.fileloc table seems to be missing its schema

Error observed is Warning: array_key_exists() expects parameter 2 to be array, null given in chado_insert_record() (line 609 of /var/www/2020-02-18/drupal-7.69/sites/all/modules/tripal/tripal_chado/api/tripal_chado.query.api.inc).

To test:

$x = chado_get_schema('fileloc');
var_dump($x['fields']);

... part of output omitted ...
  ["size"]=>
  array(3) {
    ["type"]=>
    string(7) "varchar"
    ["length"]=>
    int(1024)
    ["not null"]=>
    bool(false)
  }
  ["filename"]=>
  NULL
}

Found the bug in tripal_file.install line 808,
$schema['fields']['filename'] = $filename_schema;
forgot to define this variable!

@dsenalik
Copy link
Collaborator

pull #27

As far as relationships go, it is a very simple change to add a file_relationship table to this module. Then we can use the sbo__relationship field. And just a little more work to create the autocomplete for the widget for this field.

My first use case is for a vcf file, I would like to link it to the fasta file of the reference genome that was used for read mapping, using the sequence ontology term reference_genome (SO:0001505)

@dsenalik
Copy link
Collaborator

While there may be additional aspects to file relationships to consider, I am closing this with merged #27
Any further work on relationships will probably only happen in Tripal 4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants