• RTH
  • CRS-Cyanobacteria
  • Browse CRSs
  • CRS details
  • CRS alignments
  • Species conservation
  • Known structures
  • Help

CRS details

motifs_tbl = transpose(motifs)
motifs_paths_tbl = transpose(motifs_paths)
pos_tbl = transpose(pos)

phylo_tbl = transpose(phylo)

expr_tbl = transpose(expr)
para = window.location.href.match(/(?<=candidate=)(.*?)[^&]+/)
sv = {
  if ( para !== null ) {
    if ( motifs_list.includes(para[0]) ) {
      return para[0]
    }
  }
  return motifs_list[0] 
}

// Choose a single motif
viewof sel = Inputs.select(
  motifs_list,
  {
    label: 'Details for',
    value: sv
  }
)


html`<a href="https://rth.dk/resources/crs/cyanobacteria/msa.html?candidate=${sel}">View alignment</a>`
motifs_filtered = motifs_tbl.filter(function(row) {
  return row["CRS ID"] === sel
})

// Sort of transpose for improved overview
record = Object.keys(motifs_filtered[0]).
  map(x => new Object({key: x, value:  motifs_filtered[0][x]}))

Characteristics and scores

Inputs.table(record, {
  rows: 15,
  maxHeight: null,
  format: {
    'value': function(i) {
      if (String(i).match(/^K[0-9]+$/) !== null) {
        return html`<a href="https://www.kegg.jp/entry/${i}" target="_blank">${i}</a>`
      } else {
        return i
      }
    }
  }
})
html`<center><img src="https://rth.dk/resources/crs/cyanobacteria//data/R2R/${sel}.svg" class = 'r2r'/></center>`

Associated pathways

paths_filtered = motifs_paths_tbl.filter(function(row) {
  return row.motif === sel
})
Inputs.table(
  paths_filtered,
  {
    columns: ['KEGG ID', 'Title'],
    maxHeight: null,
    format: {
      'KEGG ID': function(i) {
        return html`<a href="https://www.kegg.jp/pathway/${i}" target="_blank">${i}</a>`
      }
    }
  }
)

Genomic loci

pos_filtered = pos_tbl.filter(function(row) {
  return row.motif === sel
})
Inputs.table(
  pos_filtered,
  {
    columns: ["species","NCBI-accession", "start", "end", "strand"],
    rows: 50,
    format: {
      'NCBI-accession': function(i) {
        return html`<a href="https://www.ncbi.nlm.nih.gov/search/all/?term=${i}" target="_blank">${i}</a>`
      }
    }
  }
)

Species conservation

phylo_filtered = phylo_tbl.filter(function(row) {
  return row.motif === sel
})

Plot.plot({
  marginLeft: 500,
  marginBottom: 70,
  marginTop: 50,
  height: 600,
  width: 1000,
  style: {
    'font-size': '18pt',
    'color': 'black',
    'text-shadow': '1pt 1pt 8pt white'
  },
  x: {
    label: 'Studied species containing the candidate (%)',
    grid: true
  },
  y: {
    label: 'Phylogenetic order:',
    labelAnchor: 'top'
  },
  marks: [
    Plot.barX(
      phylo_filtered,
      {
        x: 'ratio',
        y: 'order',
        fill: 'fill'
      }
    ),
    Plot.text(
      phylo_filtered,
      {
        x: 2,
        y: 'order',
        rotate: 0,
        textAnchor: 'start',
        text: 'lab',
        fontSize: '16pt',
        fontWeight: 'bolder'
      }
    )
  ]
})

(Relative to the NCBI taxonomy)

html`<a href="https://rth.dk/resources/crs/cyanobacteria/cons_og.html?candidate=${sel}">View species conservation of the CRS anchoring orthologous gene</a>`

Transcriptional Activity

expr_filtered = expr_tbl.filter(function(row) {
  return row.motif === sel
})

Plot.plot({
  marginLeft: 550,
  marginBottom: 70,
  marginTop: 50,
  height: 600,
  width: 1000,
  style: {
    'font-size': '18pt',
    'color': 'black',
    'text-shadow': '1pt 1pt 8pt white'
  },
  x: {
    label: 'Proportion of RNA-seq libraries in which candidate is expressed (%)',
    grid: true
  },
  y: {
    label: 'Species:',
    labelAnchor: 'top'
  },
  marks: [
    Plot.barX(
      expr_filtered,
      {
        x: 'ratio',
        y: 'genome',
        fill: 'fill'
      }
    ),
    Plot.text(
      expr_filtered,
      {
        x: 2,
        y: 'genome',
        rotate: 0,
        textAnchor: 'start',
        text: 'lab',
        fontSize: '16pt',
        fontWeight: 'bolder'
      }
    )
  ]
})