Skip to content

Commit

Permalink
Merge branch 'master' of github.com:lidaof/eg-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
lidaof committed Feb 7, 2019
2 parents dcef593 + 5f6ea5c commit 48a987e
Showing 1 changed file with 28 additions and 30 deletions.
58 changes: 28 additions & 30 deletions docs/local.rst
Original file line number Diff line number Diff line change
@@ -1,66 +1,64 @@
Local track files
=================

We realized that not every group can setup a web server with CORS enabled, since version 48.0.0,
we added the ability to read local track files or entire folder as a datahub, which means you can *upload* track files on
from your hard drive to the browser. The formats for the track files are the same as the ones used for
being hosted on a webserver.

.. note:: the track *uploaded* through the file upload dialog *cannot* be saved to browser's local
storage, thus, when you refresh the browser, your local tracks will gone. You need to
re-upload them (like re-grant the permission to the browser to read your local files).
This is a security setup of Javascript. You can create a ``hub.config.json`` file
to speicify files as a local datahub. Even though after every refresh your tracks are gone,
but it woule be easier to just upload the local datahub again then uploading individual tracks separately.

.. important:: Since the user need to give permission to the web browser to access
the files at local hard drive, so the local track **can not** be saved
into ``Session``. Please consider use HTTP(S) hosted tracks to work with the session function.
We realize that not every research group has the ability to set up a web server with CORS enabled. As of version 48.0.0,
we added the ability to read local track files or an entire folder as a datahub. This means the user can *upload* track files
from their hard drive to the browser. The format for these track files is the same as those that are hosted on a webserver.

.. note:: The tracks *uploaded* through the file upload feature *cannot* be saved to the browser's local
storage. Thus, when you refresh the browser your local tracks will be gone. Tracks need to be
re-upload to re-grant the browser permission to read local files.
This is a security setup of Javascript. To avoid uploading multiple files repeatedly, the user can create
a ``hub.config.json`` file to specify files as a local datahub. In this manner, after a refresh event the user
can just upload their local datahub again instead of uploading individual tracks separately.

.. important:: Since the user needs to give permission for the web browser to access
files on a local hard drive, tracks from a local hard drive **cannot** be saved
into ``Session``. Please consider using HTTP(S) hosted tracks to work with the session function.

Upload files as tracks
----------------------

To use your local track files, format your files to the correct format, open the ``Upload Track``
To use your local files, make sure to format your files correctly. First, open the ``Upload Track``
menu from ``Tracks``:

.. image:: _static/upload1.png

By default, you will be at ``Add Local Track`` tab. First, choose your track file format:
By default, you will be on the ``Add Local Track`` tab. Second, choose your track file format:

.. image:: _static/upload2.png

Second, choose your files, you can choose many files of same type if your track only contains one
file, like ``bigWig``, ``bigBed``, ``HiC``, ``bigInteract``, or you can only choose 2 (a pair of) files
if your track need an **index** file, like ``bedGraph``, ``methylC`` etc.
Third, choose your files. You can choose many files of same type if the track upload type only requires one
file (``bigWig``, ``bigBed``, ``HiC``, and ``bigInteract``) or if the track upload type requires a data
file and **index** file (``bedGraph``, ``methylC``, etc.) then you need to upload each pair individually.

.. image:: _static/upload3.png

Example of choose 2 local bigWig files:
Example upload of 2 local bigWig files:

.. image:: _static/upload4.png

The 2 bigWig tracks are added:
The 2 bigWig tracks are added to the browser view:

.. image:: _static/upload5.png

Example if choose 1 local bedGraph track, (please choose both track file and index file):
Example upload of 1 local Bedgraph track and its associated index file:

.. image:: _static/upload6.png

The bedGraph track is added:
The bedGraph track is added to the browser view:

.. image:: _static/upload7.png

Upload files or folder as datahub
Upload files or a folder as a datahub
---------------------------------

If you want to upload many different types of track files to the browser, you can do that too!
Choose the ``Add Local Hub`` tab from the track upload menu as before:

.. image:: _static/upload8.png

You would need to create a file called ``hub.config.json`` for the browser to configure your local data hub, an
example below::
Create a file called ``hub.config.json`` for the browser to configure your local data hub (example below)::

[
{
Expand All @@ -87,7 +85,7 @@ example below::
}
]

.. note:: Please note the ``name`` and ``options`` attribute specified in the file, the syntax is same as a remote datahub file.
.. note:: Please note the ``name`` and ``options`` attribute specified in this file. The syntax is the same as a remote datahub file.

.. note:: Track files not specified in ``hub.config.json`` will be skipped.

Expand All @@ -99,7 +97,7 @@ or choose many files by clicking the second button:

.. image:: _static/upload10.png

After upload either a folder or many files, your local datahub will be displayed: (please note the ``name``
and ``options`` specified in your ``hub.config.json`` file will be applied too)
After uploading either a folder or many files, your local datahub will be displayed: (Please note the ``name``
and ``options`` specified in your ``hub.config.json`` file will also be applied)

.. image:: _static/upload11.png

0 comments on commit 48a987e

Please sign in to comment.