igvR 1.16.0
Jim Robinson and his team currently provide sixteen reference genomes:
Each includes some or all of:
You specify your reference genome of interest for igvR like this:
igv <- igvR()
setGenome(igv, "hg38")
If you wish to use a reference genome other than those offered, we provide a method setCustomGenome. Here is a sample invocation in which the stock hg38 reference genome is specified explicitly. This could be seen as redundant, but has the virtue of relying upon dependably available reference files.
See notes further below on one possible approach to serving your files if you need to do so yourself.
igv <- igvR()
setCustomGenome(igv,
id="hg38",
genomeName="Human (GRCh38/hg38)",
fastaURL="https://s3.amazonaws.com/igv.broadinstitute.org/genomes/seq/hg38/hg38.fa",
fastaIndexURL="https://s3.amazonaws.com/igv.broadinstitute.org/genomes/seq/hg38/hg38.fa.fai",
chromosomeAliasURL=NA,
cytobandURL="https://s3.amazonaws.com/igv.broadinstitute.org/annotations/hg38/cytoBandIdeo.txt",
geneAnnotationName="Refseq Genes",
geneAnnotationURL="https://s3.amazonaws.com/igv.org.genomes/hg38/refGene.txt.gz",
geneAnnotationTrackHeight=300,
geneAnnotationTrackColor="darkgreen",
initialLocus="chr5:88,621,308-89,001,037",
visibilityWindow=5000000)
Many of the arguments to this method default to NA. Here is a minimalist invocation:
setCustomGenome(igv,
id="hg38",
genomeName="Human (GRCh38/hg38)",
fastaURL="https://s3.amazonaws.com/igv.broadinstitute.org/genomes/seq/hg38/hg38.fa",
fastaIndexURL="https://s3.amazonaws.com/igv.broadinstitute.org/genomes/seq/hg38/hg38.fa.fai")
Any igv.js-compatible web server must have two capabilities:
I have used an easily installed, easily configured Python FLASK webserver for this. Here are the details,
from flask import Flask from flask_cors import CORS app = Flask(__name__, static_url_path='/static') CORS(app) @app.route('/') def serveStaticFiles(): return 'CORS and byte-range request flask webserver for igvR and igvShiny' if __name__ == "__main__": app.run(host='0.0.0.0', port='60050')
Place the files you wish to serve in, eg, http://locahhost:60050/static/. To run the python webserver:
bash> export FLASK_APP=serveStaticGenomeFiles.py bash> nohup flask run -p 60050 --host=0.0.0.0 &> flask.log &
FROM python COPY serveStaticGenomeFiles.py /app/ COPY requirements.txt /app/ WORKDIR /app RUN pip install -r requirements.txt ENTRYPOINT ["python"] CMD ["serveStaticGenomeFiles.py"]
Flask flask_cors
build: docker build -t flask-cors-server:latest . run: docker run -it \ -p 5000:60050 \ -v ~/s/examples/docker/flask/web:/app \ flask-cors-server stop: docker stop `docker ps | grep flask-cors-webserver | awk '{print $1}'`