galaxy-genome-annotation / python-apollo

Python library for talking to Apollo API
MIT License
11 stars 11 forks source link

begin to refactor gff3 #33

Closed nathandunn closed 4 years ago

nathandunn commented 4 years ago
FAIL: test_delete_features (test.organism_test.OrganismTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/galaxy-genome-annotation/python-apollo/test/organism_test.py", line 131, in test_delete_features
    assert len(feats_before['features']) > 0
AssertionError: 
Traceback (most recent call last):
  File "/home/travis/build/galaxy-genome-annotation/python-apollo/test/organism_test.py", line 149, in test_delete_features_cn
    assert len(feats_before['features']) > 0



nathandunn commented 4 years ago

@hexylena / @abretaud Please feel free to contribute. Otherwise I will get to it.

Mostly trying to replicate this: https://github.com/GMOD/Apollo/blob/develop/tools/data/add_features_from_gff3_to_annotations.pl

nathandunn commented 4 years ago

Looking at this code here:

https://biopython.org/wiki/Gene_predictions_to_protein_sequences

all of the examples use mRNA as top, instead of gene.

When we use gene at the top, this GFF3 parser completely ignores the rest of the features instead of capturing the structure appropriately.

abretaud commented 4 years ago

Thanks! I'll review it fully probably next week! If you have time (I can do it otherwise!) I'd love to have this function return proper json, with a list of top level features ids and their corresponding apollo internal ids. It could be useful when you load a gff and want to be able to change things on features that were loaded.

nathandunn commented 4 years ago

@abretaud Not entirely sure where you want the IDs added (during the download or when added), but I'll be on vacation early next week. If you open a ticket in Apollo (if its not being returned there) I can add it there. Otherwise, feel free to add / update whatever you want to and merge at your leisure.

abretaud commented 4 years ago

Thanks for your work @nathandunn! I've some changes to fix problems I found with my gff, it should be much better than 4.2.2 now I'm going to merge this and to release 4.2.3 now, we can always improve it in future releases