              .domain([0, 25])
              .range([0, 1])
 
-  # Using https://github.com/Caged/d3-tip
+  # tool tips using https://github.com/Caged/d3-tip
   #   [slightly modified in https://github.com/kbroman/d3-tip]
   eqtltip = d3.svg.tip()
                  .orient("right")

                 .domain(d3.range(4))
                 .rangePoints([left[2], right[2]], 1)

  # create SVGs
  svg = d3.select("div#cistrans").append("svg")
          .attr("width", totalw)
          .attr("height", totalh)

              markerClick[td] = 1
              d3.select(this).attr("opacity", 1).attr("fill",altpink).attr("stroke",purple)

    draw_pxgXaxis = (pxgXaxis, means, genotypes, chr, sexcenter) ->
      pxgXaxis.selectAll("line.PXGvert")
              .data(means)
              .enter()
              .append("line")
              .attr("class", "PXGvert")
              .attr("y1", top[2])
              .attr("y2", bottom[2])
              .attr("x1", (d,i) -> return if(chr is "X") then pxgXscaleX(i) else pxgXscaleA(i))
              .attr("x2", (d,i) -> return if(chr is "X") then pxgXscaleX(i) else pxgXscaleA(i))
              .attr("stroke", darkGray)
              .attr("fill", "none")
              .attr("stroke-width", "1")
      pxgXaxis.selectAll("line.PXGvert")
              .data(means)
              .transition().duration(250)
              .attr("x1", (d,i) -> return if(chr is "X") then pxgXscaleX(i) else pxgXscaleA(i))
              .attr("x2", (d,i) -> return if(chr is "X") then pxgXscaleX(i) else pxgXscaleA(i))
      pxgXaxis.selectAll("line.PXGvert")
              .data(means)
              .exit().remove()
      pxgXaxis.selectAll("text.PXGgeno")
              .data(genotypes)
              .enter()
              .append("text")
              .attr("class", "PXGgeno")
              .text((d) -> d)
              .attr("y", bottom[2] + pad.bottom*0.25)
              .attr("x",  (d,i) -> return if(chr is "X") then pxgXscaleX(i) else pxgXscaleA(i))
              .attr("fill", labelcolor)
      pxgXaxis.selectAll("text.PXGgeno")
              .data(genotypes)
              .transition().duration(250)
              .text((d) -> d)
              .attr("x",  (d,i) -> return if(chr is "X") then pxgXscaleX(i) else pxgXscaleA(i))
      pxgXaxis.selectAll("text.PXGgeno")
              .data(genotypes)
              .exit().remove()
      pxgXaxis.selectAll("text.PXGsex")
              .data(["Female", "Male"])
              .enter()
              .append("text")
              .attr("class", "PXGsex")
              .attr("id", "sextext")
              .text((d) -> d)
              .attr("y", bottom[j] + pad.bottom*0.75)
              .attr("x", (d, i) -> sexcenter[i])
              .attr("fill", labelcolor)
      pxgXaxis.selectAll("text.PXGsex")
              .data(["Female", "Male"])
              .transition().duration(250)
              .attr("x", (d, i) -> sexcenter[i])
      pxgXaxis.selectAll("text.PXGsex")
              .data(["Female", "Male"])
              .exit().remove()

    pxgYscale = null
    pxgXaxis = svg.append("g").attr("class", "probe_data").attr("id", "pxg_xaxis")
    plotPXG = (marker) ->
      pxgYscale = d3.scale.linear()
                     .domain([d3.min(probe_data.pheno),
                              d3.max(probe_data.pheno)])
