Choose aStock or Custom Genome
Paul Shannon
2022-07-24
chooseStockOrCustomGenome.RmdThe Standard Hosted Genomes
Jim Robinson and his team currently provide sixteen reference genomes:
- hg38
- hg19
- hg18
- mm10
- gorGor4
- panTro4
- panPan2
- susScr11
- bosTau8
- canFam3
- rn6
- danRer11
- danRer10
- dm6
- ce11
- sacCer3
Each includes some or all of:
- fasta sequence, with an index
- cytoband
- alternative chromosome names (e.g., “Chr1”, “chr1”, “1”)
- a reference gene annotation track (e.g., hg39 Refseq genes)
You specify your reference genome of interest for igvR like this:
setCustomGenome
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.
Full invocation - all arguments
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)Minimal invocation - just the DNA sequence
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")Set up a (typically local and private) reference genome web server
Any igv.js-compatible web server must have two capabilities:
- It must return byte ranges
- It must not enforce CORS restrictions (cross-origin GET or POST requests)
I have used an easily installed, easily configured Python FLASK webserver for this. Here are the details,
Simple webserver script, localWebServer.py
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 &