@alignviewers_bp.route('<STR_LIT>')<EOL>def igv():
chrom = request.args.get('<STR_LIT>')<EOL>if chrom == '<STR_LIT>':<EOL><INDENT>chrom = '<STR_LIT:M>'<EOL><DEDENT>start = request.args.get('<STR_LIT:start>')<EOL>stop = request.args.get('<STR_LIT>')<EOL>locus = "<STR_LIT>".format(chrom,start,stop)<EOL>LOG.debug('<STR_LIT>', locus)<EOL>chromosome_build = request.args.get('<STR_LIT>')<EOL>LOG.debug('<STR_LIT>', chromosome_build)<EOL>samples = request.args.getlist('<STR_LIT>')<EOL>bam_files = request.args.getlist('<STR_LIT>')<EOL>bai_files = request.args.getlist('<STR_LIT>')<EOL>LOG.debug('<STR_LIT>', bam_files)<EOL>display_obj={}<EOL>fastaURL = '<STR_LIT>'<EOL>indexURL = '<STR_LIT>'<EOL>cytobandURL = '<STR_LIT>'<EOL>gene_track_format = '<STR_LIT>'<EOL>gene_track_URL = '<STR_LIT>'<EOL>gene_track_indexURL = '<STR_LIT>'<EOL>if chromosome_build == "<STR_LIT>" or chrom == '<STR_LIT:M>':<EOL><INDENT>fastaURL = '<STR_LIT>'<EOL>indexURL = '<STR_LIT>'<EOL>cytobandURL = '<STR_LIT>'<EOL>gene_track_format = '<STR_LIT>'<EOL>gene_track_URL = '<STR_LIT>'<EOL>gene_track_indexURL = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>fastaURL = '<STR_LIT>'<EOL>indexURL = '<STR_LIT>'<EOL>cytobandURL = '<STR_LIT>'<EOL>gene_track_format = '<STR_LIT>'<EOL>gene_track_URL = '<STR_LIT>'<EOL>gene_track_indexURL = '<STR_LIT>'<EOL><DEDENT>display_obj['<STR_LIT>'] = {<EOL>'<STR_LIT>' : fastaURL,<EOL>'<STR_LIT>' : indexURL,<EOL>'<STR_LIT>' : cytobandURL<EOL>}<EOL>display_obj['<STR_LIT>'] = {<EOL>'<STR_LIT:name>' : '<STR_LIT>',<EOL>'<STR_LIT:type>' : '<STR_LIT>',<EOL>'<STR_LIT>': gene_track_format,<EOL>'<STR_LIT>': '<STR_LIT:file>',<EOL>'<STR_LIT:url>' : gene_track_URL,<EOL>'<STR_LIT>' : gene_track_indexURL,<EOL>'<STR_LIT>' : '<STR_LIT>'<EOL>}<EOL>sample_tracks = []<EOL>counter = <NUM_LIT:0><EOL>for sample in samples:<EOL><INDENT>if bam_files[counter]:<EOL><INDENT>sample_tracks.append({ '<STR_LIT:name>' : sample, '<STR_LIT:url>' : bam_files[counter],<EOL>'<STR_LIT>' : bai_files[counter],<EOL>'<STR_LIT>' : <NUM_LIT>, '<STR_LIT>' : <NUM_LIT>})<EOL><DEDENT>counter += <NUM_LIT:1><EOL><DEDENT>display_obj['<STR_LIT>'] = sample_tracks<EOL>if request.args.get('<STR_LIT>'):<EOL><INDENT>display_obj['<STR_LIT>'] = True<EOL><DEDENT>else:<EOL><INDENT>display_obj['<STR_LIT>'] = False<EOL><DEDENT>return render_template('<STR_LIT>', locus=locus, **display_obj )<EOL>
Visualize BAM alignments using igv.js (https://github.com/igvteam/igv.js)