lmb-embrapa / machado

This repository provides users with a framework to store, search and visualize biological data.
GNU General Public License v3.0
26 stars 14 forks source link

Jbrowse Can't load ref Seq #328

Closed wjwei-handsome closed 3 years ago

wjwei-handsome commented 3 years ago

Setup

Python version: Python 3.6.9 Operating system: CPython;Linux-4.15.0-142-generic-x86_64-with-Ubuntu-18.04-bionic

import sys; print(sys.version)
import platform; print(platform.python_implementation()); print(platform.platform())

(Please copy and run the above in your Python, and copy-and-paste the output)

Expected behaviour

show the Jbrowse

Actual behaviour

image

I'm trying to establish a web project. But I encountered an unsolvable problem in jbrowse. I configure the trackList.json just like your document at https://machado.readthedocs.io/en/latest/jbrowse.html. But I got an error as shown in the picture above. My trackList.json is here:

{ "formatVersion" : 1, "refSeqs": "http://1.14.226.153:8000/api/jbrowse/refSeqs.json?soType=chromosome&organism=AAA%20aaa", "names" : { "type" : "REST", "url" : "http://1.14.226.153:8000/api/jbrowse/names", }, "tracks" : [ { "category": "1. Reference sequence", "useAsRefSeqStore": true, "label": "ref_seq", "key": "REST Reference Sequence", "type": "JBrowse/View/Track/Sequence", "storeClass": "JBrowse/Store/SeqFeature/REST", "baseUrl": "http://1.14.226.153:8000/api/jbrowse", "query": { "organism": "AAA aaa" } }, { "category": "2. Genes", "baseUrl" : "http://1.14.226.153:8000/api/jbrowse", "key" : "Gene", "label" : "gene", "query" : { "organism": "AAA aaa", "soType" : "gene" }, "storeClass" : "JBrowse/Store/SeqFeature/REST", "type" : "JBrowse/View/Track/CanvasFeatures", "style": { "label": "name,id", "description": "display" } }, { "category": "2. Genes", "baseUrl" : "http://1.14.226.153:8000/api/jbrowse", "key" : "Transcript", "label" : "transcripts", "query" : { "organism": "AAA aaa", "soType" : "mRNA" }, "storeClass" : "JBrowse/Store/SeqFeature/REST", "type" : "JBrowse/View/Track/CanvasFeatures", "style": { "label": "name,id", "description": "display" } }, { "category": "2. Genes", "baseUrl" : "http://1.14.226.153:8000/api/jbrowse", "key" : "CDS", "label" : "CDS", "query" : { "organism": "AAA aaa", "soType" : "CDS" }, "storeClass" : "JBrowse/Store/SeqFeature/REST", "type" : "JBrowse/View/Track/CanvasFeatures" } ] }

So I sincerely need your help!

azneto commented 3 years ago

This message is shown in every jbrowse home page. If you pass some variables informing where the data is, it should work fine.

Try this:

http://1.14.226.153/jbrowse/?data=data%2FAAA%20aaa&tracks=ref_seq%2Cgene%2Ctranscripts%2CCDS

wjwei-handsome commented 3 years ago

This message is shown in every jbrowse home page. If you pass some variables informing where the data is, it should work fine.

Try this:

http://1.14.226.153/jbrowse/?data=da

This message is shown in every jbrowse home page. If you pass some variables informing where the data is, it should work fine.

Try this:

http://1.14.226.153/jbrowse/?data=data%2FAAA%20aaa&tracks=ref_seq%2Cgene%2Ctranscripts%2CCDS

Thanks for your answers, but my error still exists

image

I try to GET the url : http://1.14.226.153:8000/api/jbrowse/refSeqs.json?soType=chromosome&organism=AAA%20aaa , and it responded normally when i turn on the Django server. I am still confused about this.

azneto commented 3 years ago

The file refSeqs.json is generated by the API, so it depends on the Django server to be running. But I couldn't figure out yet why JBrowse can't load it.

wjwei-handsome commented 3 years ago

The file refSeqs.json is generated by the API, so it depends on the Django server to be running. But I couldn't figure out yet why JBrowse can't load it.

Thank you for your reply. Machado is a very good Django framework. I plan to use it as part of my database. If the Jbrowse problem cannot be solved, I think I can try without using the REST framework.

azneto commented 3 years ago

I recommend you load the reference data (the chromosomes) from the .fasta file. It'll be faster that way.

https://machado.readthedocs.io/en/latest/jbrowse.html#use-reference-from-fasta-file-optional

Once the reference track is setup, you should be able to visualize the features from the database.

wjwei-handsome commented 3 years ago

I recommend you load the reference data (the chromosomes) from the .fasta file. It'll be faster that way.

https://machado.readthedocs.io/en/latest/jbrowse.html#use-reference-from-fasta-file-optional

Once the reference track is setup, you should be able to visualize the features from the database.

Thanks, I'll try it. But I think REST is more elegant ✋.

azneto commented 3 years ago

The file refSeqs.json is generated by the API, so it depends on the Django server to be running. But I couldn't figure out yet why JBrowse can't load it.

Thank you for your reply. Machado is a very good Django framework. I plan to use it as part of my database. If the Jbrowse problem cannot be solved, I think I can try without using the REST framework.

You're welcome! I hope it's useful for you. Please, let us know whether the JBrowse configuration finally works for you and if have any problems.

azneto commented 3 years ago

Thanks, I'll try it. But I think REST is more elegant hand.

I think so too! The problem is that it takes too long to run a query in the database just the retrieve the chromosome sizes, while it happens almost immediately when you get it from the fasta file.

wjwei-handsome commented 3 years ago

Also, if I want to treat the repetitive sequence as a feature value and make it searchable, just like genes, mRNA, and peptides. I added some test data to PostgreSQL, and added my cvterm to the MACHADO_VALID_TYPES variable in the settings.py , like this: MACHADO_VALID_TYPES = ['gene', 'mRNA', 'polypeptide', 'natural_transposable_element'] But when I rebuild the index through “python manage.py rebuild_index” , nothing seems to have changed. I think I used the wrong method, so I want to ask your opinion.

azneto commented 3 years ago

This is not configurable yet. Currently, the rebuild_index will index only the types set in this variable:

OVERLAPPING_FEATURES = ["SNV", "QTL", "copy_number_variation"]

https://github.com/lmb-embrapa/machado/blob/9fc5d19e8d6e82bd6ff41226d43f0e89455b6e74/machado/search_indexes.py#L23

Feel free to add a new type to this variable. You're welcome to contribute a PR moving this variable to the settings.py file.

azneto commented 3 years ago

Inactive for more than 10 days

wjwei-handsome commented 3 years ago

Inactive for more than 10 days Sorry for not responding in time, because I took a long vacation before. I eventually plan to store the genome information in the data folder of Jbrowse.

azneto commented 3 years ago

That's all right. Please let us know about further development of your database and don't hesitate to contact us for assistance or suggestions.