R package changelog
0.2.1
Changes:
- Charts are drawn by the geneviewer JavaScript library (https://github.com/nvelden/geneviewer-js), which the package ships in
inst/htmlwidgets/lib/. TheGC_functions describe the chart as a chart spec and the library draws it. Charts look and behave the same: the same functions, arguments, defaults, checks and messages, the same Shiny inputs, and the same drawing, checked against the charts of the examples, vignettes and tests of 0.2.0. - The package ships geneviewer-js 0.3.11, with the fixes for empty charts, hidden labels and tooltips below.
- Code that read the internals of a chart,
widget$x, must usewidget$x$spec:widget$xis nowlist(spec = ), the chart spec, which holds the arguments of theGC_functions as given, under the names of the spec. The R code that built the chart for the browser is gone. - The default icons of the toolbar are inline SVG copies of the same Font Awesome glyphs, so they show without an icon font. Custom icons by Font Awesome name (
GC_toolbar(icons = )) still work: the package still loads Font Awesome. geneviewer_theme()andgeneviewer_palette()read the built-in themes and palettes from the library (itsthemes.json); they give the same settings and colours. The options of a theme's components have the names of the chart spec:cornerRadius(wascorner_radius),normalColor,invertedColorandlowColor(werenormal_color, ...),textStyleandmarkerStyleinlegend(werelegendTextOptionsandlegendOptions), andlineStyleinsequence(wassequenceStyle).GC_theme()still takes the old names, also mixed with the new ones in one theme.- Functions that only style a chart (
GC_genes(),GC_labels(),GC_title(), ...) no longer prepare the whole dataset to check their arguments, which adds up on large data. - FileSaver.js is no longer bundled: the library saves images with the browser's own download. jsonlite is now imported.
Bug fixes:
- Links made with
GC_links(group = )beforeGC_normalize()move with their genes; they stayed at the old positions, so they pointed at the wrong place. Links given asdata(e.g. frommummer_alignment()) keep their positions, with a warning to add them afterGC_normalize(). read_fasta()gives every sequence with alocationastrand, also in files whose locations are all forward. Before, such a file had nostrandcolumn, and in a folder with other files its rows gotNA, soGC_chart(strand = "strand")stopped with "Invalid strand values found".read_bed()reads files whose columns are separated by spaces (in a file without any tab); it read each line as one column. Columns after the twelve of BED are namedV13,V14, ...; the 13th wasNA..read_fasta()on a folder without FASTA files stops with "No .fasta files found in the specified directory.", as the other readers; it gave an empty table.read_gff()is about 10 times faster on large files: the attributes of all rows are read at once.get_introns()(andGC_transcript()): an intron keeps the columns that are the same for all exons and UTRs of its transcript (e.g. its gene or group) and isNAin the others. It copied the exon before it, so a label of each exon, e.g.GC_labels("exon_id"), was repeated on the intron after it.- Clearer errors for wrong arguments:
GC_grid(margin = )takes pixels or a percentage of a chart height in pixels;GC_legend(group = )one column;GC_scale(scale_breaks = )andGC_links(measure = )one value;GC_links(value1 = , value2 = )both or neither, of the same length. They gave errors such as "missing value where TRUE/FALSE needed" or "No links found", andvalue1withoutvalue2was ignored. GC_cluster(separate_strands = TRUE, prevent_gene_overlap = TRUE)warns that neither is applied, which is what happens; it said "Resetting to NULL". The help ofGC_grid()says that a number forwidthis pixels (it said a percentage), and the example ofGC_genes()no longer passesprevent_overlapandgene_overlap_spacing, which are not options.- Tooltips (
GC_tooltip()) show the values of the data as text: markup in a value, e.g. in a qualifier of a GenBank file from someone else, ran in the page of who viewed the chart. Theformatteris still HTML, so put tags such as<b>or links there, not in the data. mummer_alignment()reads a folder whose path has spaces. The files are copied to a working folder inoutput_dirfirst, so only that path must be without spaces.GC_zoom(range = )andGC_zoom(min = )are checked in themodeof an earlierGC_zoom()call when the call gives none:GC_zoom(mode = "absolute") %>% GC_zoom(range = c(100, 2000))stopped with the error for a relative range.show = FALSEinGC_labels(),GC_coordinates(),GC_scaleBar(),GC_clusterTitle(),GC_clusterLabel()andGC_clusterFooter()hides what an earlier call shows, e.g.GC_coordinates() %>% GC_coordinates(show = FALSE, cluster = 2); before, it changed nothing. Hidden labels need no label column. With nothing shown before, the chart is unchanged, as before.- A chart of data without rows, e.g. after a Shiny filter that leaves nothing, takes the
GC_functions:GC_labels("name")stopped with "label column not found in data", andGC_transcript()with an internal error. The chart has no clusters and draws as an empty chart, with its title and other options; before, the page stayed blank with "Cannot read properties of null". genbank_to_fasta()writes records without aVERSIONline, named by theirACCESSION, else theirLOCUSname, else the file name; without aDEFINITION, the header is the name only. Such records were left out without a message, so the FASTA file could be empty andmummer_alignment()failed later with another error.read_gbk()reads features whose key does not start with a letter, such as5'UTR,3'UTRand-10_signal. Their lines were added to the feature before them, so a CDS followed by a5'UTRgot a secondgene(gene.1ingbk_features_to_df()). Qualifiers without a value, such as/pseudo, are kept, with the value""; they were dropped. A feature without qualifiers gets itsregion; it wasNA.read_gbk()reads the whole sequence (ORIGIN) of records of more than a million bases, such as bacterial genomes. From base 1,000,001 the lines of the sequence were read as the start of a new section, so the sequence ended at base 1,000,020, without a message.GC_links(group = )works on data with a column namedclusterwhen the clusters of the chart are another column, e.g.GC_chart(data, cluster = "genome"). When that column came before the cluster column, it was read in place of the clusters, so links were missing or the call stopped with "No links found". The column is now left out of the links. Links by that column itself (group = "cluster") stop with a message to rename it.GC_normalize()spaces the genes over the whole range of their cluster, as documented. It shared the total gap between as many gaps as there are genes, one too many, so every gap was too small and the cluster ended before its last gene did: genes at 10-40, 90-120 and 130-160 became 10-40, 60-90 and 110-140, and are now 10-40, 70-100 and 130-160. Genes that are already evenly spaced stay where they are. A givengapis now the gap drawn; it was (n - 1) / n of it for n genes. Charts made withGC_normalize()change: genes after the first move to the right, the last gene of a cluster by the size of one gap.- A second
GC_toolbar(buttons = )orGC_legend(order = )call replaces the buttons or order of the first, as other options do; before, the first call's list was kept. read_gff()reads GTF and GFF2 files: attributes written askey "value"become columns without the quotes, and folders are searched for.gtfand.gff2files too. A key repeated in one row (e.g.tagin GTF, orDbxreftwice) keeps its values joined with",", as GFF3 writes several values of one key; before, every attribute column of the file became a list column, with a warning.read_fasta()joins repeated[key=value]fields the same way.gbk_features_to_df()andread_fasta()now give the full span of spliced genes whose exons are listed from right to left, as injoin(complement(5441..5600),complement(5095..5373))(common in fungal and other eukaryotic GenBank files).gbk_features_to_df()took the first and the last number, so the gene was drawn reversed and too short, andread_fasta()kept only the first exon. A location crossing the origin of a circular genome now keeps its first part ingbk_features_to_df()too, as inread_fasta().read_bed()reads BED12 files in which every row has one block; it stopped with "non-character argument".read_fasta()skips an empty FASTA file with the warning of a file without keys, instead of an internal error message.protein_blast()with only the query cluster (e.g. one GenBank file) gives each gene as its own hit; before, R crashed, because pwalign was given nothing to align.GC_legend(order = )with one group name, e.g.order = "B", orders the legend; before, the chart was blank.protein_blast()can be run on its own result, e.g. again with another query cluster: the columnsBlastP,identity,similarityandscoreof the data are replaced. Before, it stopped with "Columnscorenot found".read_gff()andread_bed()combine the files of a folder when a column holds numbers in one file and text in another, e.g. chromosomes named1andX. The text columns (seqid,source,type,strandandphaseof GFF files;chrom,name,strandanditemRgbof BED files) are now always character, andscoreis always numeric, withNAfor a score of".". Before, the files could not be combined.GC_normalize()keeps a column namedclusterwhen the clusters of the chart are another column, e.g.GC_chart(data, cluster = "operon"); before, it was overwritten with the cluster names.GC_links()withoutgroupordatastops with "Either 'group' or 'data' must be provided."; before, the error was "argument is of length zero".GC_title(show = FALSE)hides a title set by an earlierGC_title()call; before, it changed nothing.- Options given as named vectors, e.g.
GC_pattern(color = c(A = "white")), are sent as named lists, so they no longer depend on a deprecated behaviour of jsonlite and its message. GC_zoom_to()says that it needs shiny when shiny is not installed.
0.2.0
New features:
GC_labels(adjustLabels = "spread")puts the gene labels on one line below the lowest gene, moved apart where they would overlap, with a line from each label to its gene, as in gene order figures.leaderLinesets the distance from the genes to the labels (length) and the style of the lines, e.g.leaderLine = list(length = 30, stroke = "grey"), orleaderLine = FALSEfor no lines.spreadPosition = "top"puts the labels above the highest gene instead. Lines follow labels that are dragged, and start at the top of the gene when a label is dragged above it, and the labels are spread again for the genes in view when zoomed in. Themes style the lines too: they take thelineColorofGC_theme(), can be set withGC_theme(labels = list(leaderLine = list(...))), and each built-in theme draws them to match its other lines.GC_zoom()adds a zoom slider below the clusters. Drag a handle to change the window, drag the window to move it, click the track to move the window there, and double-click the slider or use the new reset zoom button of the toolbar to show everything again; the arrow keys, Home and End work on a focused handle or window. Genes, labels, links, coordinates and annotations follow the window and are cut off at the edges of the plot area, and the axis shows the ticks of the window.mode = "relative"(default) shows the same share of every cluster,mode = "absolute"the same base pairs;rangesets the window shown first,minthe narrowest window,update = "release"draws only when the slider is let go, andoverviewshows the genes of each cluster in the slider. Saved images leave out the slider and the room it takes, so they look as if the chart had none. In Shiny,GC_events(zoom = TRUE)reports the window asinput$<outputId>_zoomon the first render and after every change, with the base pairs each cluster shows and arangeto pass back toGC_zoom(range = ), andGC_zoom_to()sets it from the server. Redraws from Shiny with the same data, range and mode keep the window the user picked; a newGC_events(render_id = )marks a new load, which starts atrangeagain.GC_toolbar()sets the chart's toolbar: when it shows ("hover","always"or"never"), its corner, which buttons it has, the size and colours of its icons and tooltips, and the icons themselves, by Font Awesome name (e.g.icons = list(reset = "arrows-to-circle")). Its tooltips and save menu take a border, corner radius, shadow and font. Colours, size and the tooltip style can also be set for a theme withGC_theme(toolbar = list(...)). The built-in themes style the toolbar to fit: their tooltip style for its tooltips and menu, and icon colours of the theme (the ECharts toolbox colours for the ECharts-based themes, muted grey that lights up on dark, black and grey for print), so the icons stay visible on the dark theme.GC_events(select = TRUE)selects several elements: Shift-, Ctrl- or Cmd-click adds or removes one, and dragging on empty space draws a box that selects the elements inside it.input$<outputId>_selectionlists all selected elements;input$<outputId>_selectstays the one selected last. Withdrag = TRUE, dragging a selected element or pressing the arrow keys moves all selected labels, titles, scales and legend parts together, as one step to undo.GC_events(drag = TRUE)can move legend labels and markers, each on its own. Save their positions withGC_element_style("legend", group = ..., part = "label"or"marker", moveX = ..., moveY = ...). A drag no longer counts as a click, so dragging a legend item does not hide its genes.- With
GC_events(drag = TRUE), moves can be undone, redone and reset: undo, redo and reset icons appear next to the download icon once something has been moved, and Ctrl/Cmd+Z, Ctrl/Cmd+Shift+Z and Ctrl+Y work after clicking the chart. Reset moves every element back to where it was first drawn, keeping positions set withGC_element_style(), as one step that can be undone. Withselect = TRUE, the arrow keys move the selected text or scale (Shift: 10 pixels). Steps of one element reportinput$<outputId>_draglike a drag, with a newactionfield ("drag","nudge","undo"or"redo"); steps of more elements reportinput$<outputId>_movesonce. The download icon and its formats can now also be used with the keyboard. Drags now move by whole pixels, also when the chart is scaled. GC_events(drag = TRUE)can move a whole scale axis or scale bar from its line, ticks or text. Save per-cluster positions withGC_element_style("scale", cluster = ..., moveX = ..., moveY = ...)or the"scaleBar"component.GC_events(rendered = TRUE, render_id = )reports successful chart updates through Shiny'sinput$<outputId>_renderedand a bubblinggeneviewer:renderedbrowser event. The event carries the update identifier, chart DOM ID (chartId) and widget dimensions. An omittedrender_idgenerates a unique ID per update across charts on the page. It fires after drawing and click setup, and does not fire on resize or failed draws.GC_events()makes a chart report clicks to Shiny:input$<outputId>_clickgives the part of the chart that was clicked ("genes","labels","scale","clusterTitle", ...), its cluster, and the row of the clicked gene or link or the legend group, e.g. to show the details of a gene.highlight = TRUEoutlines the part under the mouse. Charts are not clickable unless it is set. Every part of the chart is now marked with adata-componentattribute and each cluster withdata-cluster, for CSS and JavaScript.GC_events()can report double-clicks independently of clicks, enable individual gene and label selection with keyboard access, and exclude legend clicks from settings handlers. Selection and hidden legend groups survive redraws and resize for the same data. The payloads of a gene or label includestyle, how it is drawn (colours, opacity, border, shape, text and font), so an editor can show the current values.GC_element_style()edits or resets one element: a gene, gene label or coordinate by row ID (andend = "start"or"end"for a coordinate), so sorting and repeated names do not redirect an edit, or the title or subtitle of a cluster title, footer or label byclusterandpart. Labels, titles and subtitles can also change their displayed text, and coordinates can be hidden. Generated R code can record these calls to reproduce visual edits. WithGC_events(select = TRUE)all of these elements can be selected one by one.GC_legend(groupStyle = )styles the legend entry of a group: its text, e.g.list(tnsA = list(fontStyle = "italic"))for italic gene names, and its marker throughmarker, e.g.list(A = list(marker = list(stroke = "black"))).GC_transcript(groupStyleExons = , groupStyleIntrons = , groupStyleUTRs = )style all exons, introns or UTRs of a group, with the options of the matchingitemStyle;style_bysets the column they are matched against, e.g.style_by = "transcript"to style one transcript.GC_coordinates(groupStyle = )styles the coordinates of the genes of a group:show = FALSEleaves them out,tickstyles their ticks and the other options their text, e.g.list(other = list(show = FALSE))to show the coordinates of the named genes only.style_bysets the column they are matched against.GC_genes(style_by = )andGC_labels(style_by = )set the columngroupStyleis matched against, to style genes or labels by another column than the one that sets their colours, e.g. labels by their text:GC_labels(label = "name", style_by = "name", groupStyle = list(tnsA = list(fill = "white"))).GC_scale(scale_break_padding = )also takes the padding around automatic scale breaks in base pairs, e.g."500bp", for the same room around every break; a number is still a percentage. A gap too short for the padding gets no break.GC_scale(breaks = )also takes a data frame withstartandendcolumns and, for breaks per cluster, aclustercolumn, e.g.data.frame(cluster = c("A", "B"), start = c(5000, 8000), end = c(9000, 12000)), to set different breaks for each cluster in one call.GC_labels(groupStyle = )styles the labels of all genes of a group at once, e.g.groupStyle = list(tnsA = list(fill = "white"))for white labels on dark genes. TheitemStyleof a label takes precedence over the style of its group.GC_genes(groupStyle = )styles all genes of a group at once, with the options ofitemStyle, e.g.groupStyle = list(promoter = list(marker = "box", fill = "grey")). TheitemStyleof a gene takes precedence over the style of its group.GC_theme()sets the default look of the whole chart: start from a built-in theme ("default","classic","dark","vintage"and"infographic"with the colours of the ECharts default (version 5), dark, vintage and infographic themes,"publication"for journal figures, after common journal figure guidelines (Arial, 7 pt text, black text and axes, italic gene labels, colour-blind safe colours), or"bw": black and white with a pattern per group, in the same style), set the font, text and line colours, background, gene colours and patterns of all components at once, and change the options of any component (e.g.labels = list(fontSize = "10px")).textScalescales all text at once (e.g.textScale = 1.5), with the title and the default cluster label width growing with it. Options set with the otherGC_functions always take precedence over the theme, whatever the order of the calls.geneviewer_theme()returns the settings of a built-in theme.GC_pattern()fills genes, exons and legend markers with a pattern per group, for black and white figures. There are 16 patterns ("diagonal","dots","crosshatch","checkerboard","bricks","inverseDots"and more). Patterns, pattern colours and backgrounds can be set per group, andbackground = NULLdraws the patterns on top of the gene colours. They are kept in the PNG from the save button.- The save button can now save charts as SVG, with all clusters, links, legends and titles in one vector file for publications. Hover the download icon and pick "Save as SVG" or "Save as PNG".
- Gene colours can be set by the name of a geneviewer palette, besides the d3 colour schemes:
"okabeIto"(colour-blind safe),"classic"(clear colours),"vivid"(bright colours for dark backgrounds),"dark"(soft colours for dark backgrounds),"vintage"(muted colours),"infographic"(strong colours),"greys"and"blues", inGC_theme(palette = )and thecolorSchemeofGC_genes(),GC_transcript()andGC_color().geneviewer_palette()returns their colours. GC_links(label_position = "link")writes the measure of each link (e.g. its identity) in the middle of the link instead of with the gene label: only where it fits within its link and clear of the others, white on dark links. Zoomed in withGC_zoom(), links widen and more measures are written. Links fromdata(e.g. an alignment) can be labelled this way too.GC_cluster(prevent_gene_overlap = "nested")moves only the genes that lie inside another gene, e.g. an ORF in another reading frame, to the tracks below; the other genes stay on the first track, also where they overlap.GC_cluster(overlap_min = )keeps genes that overlap by no more than a number of base pairs, or a share of the shorter gene (e.g."10%"), on the same track, so genes that share a base or a stop codon are not split. Withstyle_by = "geneTrack",GC_genes()andGC_labels()style the genes and labels of each track, e.g.groupStyle = list("2" = list(markerHeight = 8))to draw the genes of the second track smaller.GC_labels(adjustLabels = "hide")hides labels that overlap another one instead of turning them; zoomed in, they come back when there is room.GC_links(colorBarOptions = )places the color bar:positionputs it in a corner of the plot area ("bottomright", the default,"bottomleft","topright"or"topleft") or, with"legend", in the legend, before the groups or, withlegendSide = "right", after them, lying down in the legend's font, as tall as the legend markers and set apart from the groups;orientation = "horizontal"lays it down as one line with the title, the lowest measure, the bar and the highest, or withlabels = "below", the title above the bar and ticks below it, as many as fit. The title of a lying bar is bold. Charts with inverted links stack the two bars. A bar meant for the legend stands in the bottom right corner when the chart has no legend. By default the bar stands bottom right, as before.GC_links(low_color = )sets the colour of links with the lowest identity (white by default), e.g. the background colour on a dark chart.GC_genes(corner_radius = )rounds the corners of the "arrow", "boxarrow" and "box" markers (e.g.corner_radius = 3for soft corners; the inner corners of arrows stay sharp) and sets those of "rbox". Exons takecornerRadiusinstyleExons, and themes ingenes = list(corner_radius = ).GC_legend(corner_radius = )rounds the corners of the legend markers.GC_links(vmin = , vmax = )set the measures of the lightest and the full link colour, and the ends of the colour bar (0 and 100 by default): e.g.vmin = floor(min(alignment$identity))spreads the colours over the identities of an alignment, so differences are easier to see. Measures outside are drawn in the colour of the nearest end.GC_legend(align = )aligns the legend to the left, centre or right, likeGC_title():"left"(default),"center"or"right". Each row of a legend that wraps is aligned on its own, andxmoves the legend from that position. Themes take it inlegend = list(align = ).GC_title(),GC_clusterTitle()andGC_clusterFooter()now have a documentedalignargument ("left","center"or"right"), which is checked; it was only taken through.... The cluster title and footer take one per cluster, e.g.align = c("left", "right").GC_clusterLabel(align = )aligns the lines of the cluster labels to the left, centre (default) or right of their margin, e.g.align = "left"so the names and the species below them start at the same place.xmoves the labels from that position.GC_clusterLabel(subtitle = )adds a second line below each cluster label, e.g. the species, styled withsubtitleFont(11px and not bold by default).spacingsets the pixels between the last line of the title and the subtitle (by default 1.2 times their mean font size), and the two are centred together on the cluster. Themes colour the subtitle like the other text, and the dark, vintage and publication themes like their other subtitles.GC_title(),GC_clusterTitle()andGC_clusterFooter()now have a documentedspacingargument for the pixels between the title and the subtitle, which is checked; it was only taken through.... The cluster title and footer take one per cluster.GC_trackMouse()takes the styles of the coordinate tooltip (e.g.backgroundColor,fontSize) andcursor.
Enhancements:
read_fasta()is about 4-5 times faster on large FASTA files.- Charts are drawn faster and are much smaller in HTML pages, Shiny apps and R Markdown documents. Gene labels are placed without laying out the page again for each label, and are only checked against the labels near them: a cluster of 4,000 labelled genes is drawn about 10 times faster, also on resize. The gene data is sent to the browser once instead of twice, and protein sequences (the
translationandsequencecolumns) are left out unless an option names them, e.g. a tooltipformatterwith{translation}, so a chart of the erythromycin BlastP example is 32 KB instead of 261 KB. They stay in the chart in R, and the row data of Shiny events no longer includes them unless they are shown. protein_blast()is about 3 to 9 times faster and gives the same results. The aligned sequences are now read from all alignments at once and identity and similarity are counted for all pairs at once, so parallel processing is no longer needed: theparallelargument is ignored and theparallelpackage is no longer a dependency.
Changes:
- The documentation of
protein_blast()now describes what it does: a global (Needleman-Wunsch) pairwise alignment of every protein pair, not BLASTP. Identity and similarity are counted over the full alignment, gaps included, so they can be lower than BLASTP values. The package description cites Needleman and Wunsch (1970) instead of the BLAST paper, and tooltips of its results say "Best hit" instead of "BlastP hit with". The function, itsBlastPcolumn and theerythromycin_BlastPdata keep their names. read_fasta()no longer needs Biostrings: it reads FASTA files with base R and gives the same result, including gzip-compressed files. It now also reads files with old Mac (\r) line endings.genbank_to_fasta()now writes totempdir()by default instead of next to the input file (useoutput_dir = NULLfor the old behaviour), and returns the path of the FASTA file invisibly.- knitr, rmarkdown, tidyr and biomaRt are no longer suggested: they are only used by the articles of the package website, which are not part of the package.
- MUMmer is now listed under
SystemRequirements, and the examples ofread_fasta(),read_gff(),read_bed(),gbk_features_to_df()andprotein_blast()run on example data. - FASTA and GFF readers now spread metadata with an internal helper instead of tidyr. Removing the tidyr dependency also avoids its stringr, stringi and purrr dependencies when they are not required by other packages, reducing Shinylive startup downloads.
- The padding around automatic scale breaks (
GC_scale(scale_breaks = TRUE, scale_break_padding = )) is now a share of the region shown, without the breaks, so all breaks get the same room around them; long breaks used to get much more padding than short ones. - With
GC_scale(axis_type = "range"), scale breaks are given in the positions of the data, like the annotations and the line, and move with the genes; they were taken as positions on the shifted axis. GC_align()leaves scale breaks out of the shared range: a cluster with breaks gets a range that much longer, so all clusters keep the same scale. The padding of the scale and the line is now a share of the range shown, without its breaks.GC_align()now shifts the clusters instead of stretching them, so all clusters keep the same scale: genes of the same length are drawn at the same width, also when the clusters differ in length. The alignment is kept whenGC_scale()is called afterwards, also withaxis_type = "range";GC_scale()used to undo it.- Cluster footers aligned "left" (the default) or "right" now line up with the genes and the cluster title: "left" started at the edge of the chart, in the left margin of the cluster (under a cluster label), and "right" ended one left margin short of the last gene. Footers that are not centred move right by the left margin of the cluster (50 pixels by default); an
xused to line them up with the genes (e.g.x = 50) can be removed. The examples in the vignettes are updated. - Links now fade to nearly white (10% of the link colour) at the lowest measure instead of white, so they stay visible on the background. The colour bar now runs from
vmintovmax(0% to 100% by default) instead of from the lowest to the highest measure in the data. - The title and labels of the link colour bar are now in sans-serif, like the other text; they used the serif font of the browser.
- With a theme background, the UTRs of transcripts are filled with the background instead of white.
- White legend markers (e.g. "No Hit" or a white custom colour) now get a light grey outline, so they stay visible on a white background.
- A cluster margin set with
GC_grid(margin = )is now kept byGC_clusterLabel()withoutwidth, whatever the order of the calls;GC_clusterLabel()called afterGC_grid()set the margin to 100px.GC_clusterLabel(width = )still sets the margin. - Options given as a list (e.g.
labelAdjustmentOptions,colorBarOptions = list(labelOptions = )) now keep the defaults of the options they leave out, at every level. - The geneviewer vignette has a new "Themes" section on
GC_theme(): the built-in themes, the global settings and palettes,textScale, options per component and making a theme of your own withgeneviewer_theme(). - The "Example charts" article has a new example: the blaKPC-2 plasmid pQEB1 and four variants, with links that show inversions and inserted transposons. Its data are in the new datasets
pQEB1_plasmids(genes) andpQEB1_alignment(a nucmer alignment), made bydata-raw/pQEB1_plasmids.Rfrom the GenBank files. - New tutorial "Reproducing a published figure: Tn7-like transposons", which rebuilds Fig. 3 of Peters et al. (2017) step by step: scale breaks, lining up on a gene, group styles for genes, labels and the legend, and saving as SVG. The "Example charts" article shows the finished chart, which also replaces an example chart in the README. Its data are in the new dataset
tn7_crispr_elements, made bydata-raw/tn7_crispr_elements.Rfrom the GenBank records. - The "Example charts" article has a new example for
GC_zoom(): the genomes of eleven coronaviruses from the four genera, after Fig. 1 of Chazal (2021) and ordered by subgenus, with the ORFs that lie inside another gene on a lower track and links between homologous genes. Its data are in the new datasetcoronavirus_genomes, with the homologous genes of closely related neighbouring genomes and their protein identity, made bydata-raw/coronavirus_genomes.Rfrom the GenBank records. - The "Example charts" article has a new example for
GC_labels(adjustLabels = "spread"): the mitochondrial gene order of the locust and human, after Fig. 3 of Jameson et al. (2003), with each circular genome rotated to start at COX1 and the gene labels on one line below the genes. Its data are in the new datasetmitochondrial_gene_order, made bydata-raw/mitochondrial_gene_order.Rfrom the RefSeq records.
Bug fixes:
read_fasta()reads the FASTA headers again with Biostrings 2.81 and later, which moved them out of the row names ofas.data.frame(); it found no keys and returned no rows.- Labels turned to avoid overlap (
GC_labels(adjustLabels = TRUE)) are no longer cut off: a label that would turn out of its cluster, e.g. above it or past the right end of the plot area, is now hidden, and comes back when there is room for it, e.g. when zoomed in. GC_annotation()draws a text annotation by default, as documented; its default type was"textAnnotation", which was not drawn. An unknowntypeis now an error that lists the types.GC_transcript()keeps theGC_events()andGC_toolbar()settings of the chart; they were lost when they were set before it.- The stylesheet of the chart no longer styles elements outside it: its rules for the
hovered,label,legendand gene classes only apply inside a chart. - Links can be clicked and highlighted with
GC_events(): they are drawn below the SVGs of the clusters, which took every click over the chart, so a click on a link was never reported. Drawing,GC_trackMouse()and saved SVG and PNG files are unchanged. mummer_alignment()now finds MUMmer on Windows; it looked for it with a Unix-only shell command and always reported it as not installed.mummer_alignment()now runs in a unique working subdirectory, preserving existing input and output files and cleaning up its own files on success or failure. Withremove_files = FALSE, files are retained in that subdirectory ofoutput_dir.- Bundled D3 and FileSaver.js now include their upstream license notices and copyright attribution.
- FASTA tests now skip when the optional Biostrings package is unavailable.
read_bed()no longer drops records when feature names contain "track", and preserves records across multiple track declarations.get_introns()only adds positive gaps between covered regions, including when exons and UTRs overlap, nest or are adjacent.- Tooltips of
protein_blast()results: genes of the query cluster are shown as "Query gene" instead of a hit with themselves (or "No Hit") at 100% identity, and genes without a hit no longer show empty "Identity: %" and "Similarity: %" lines. InGC_tooltip()formatters, a line whose fields all have no value is now left out. GC_links()leaves the chart unchanged when supplied an empty alignment.- GFF and FASTA metadata named
idno longer collides with internal record identifiers. - PNG export now rasterizes the same SVG snapshot as SVG export, so it works inside apps whose surrounding styles use modern CSS colors such as
oklch(). Backgrounds, patterns and the device pixel ratio are retained without parsing the app's stylesheets. The unused html2canvas dependency is no longer bundled. - In Shiny, fixed pixel chart widths now size the whole widget before drawing, so the title, clusters and legend share the requested width instead of shrinking the clusters into the output container. Switching back to a responsive chart restores the original output width; standalone and height sizing are unchanged.
- When
GC_links()is called more than once, the link labels of each call now use the options of that call (label,measure,labelStyle,value1,value2, ...); all link sets used those of the first call. A gene in more than one link set gets one label. - The
startandendof the line of a cluster (GC_sequence()) now stay with the genes withGC_scale(axis_type = "range"), like the annotations, whether they are set before or afterGC_scale(); they were taken as positions on the shifted axis. - The line of a cluster now stops at a scale break (
GC_scale(breaks = )orscale_breaks = TRUE) and starts again after it, so the break marks show a real gap; the line ran on between them. - A gene made taller or moved with
GC_genes(itemStyle = )(e.g.markerHeight,arrowheadHeightory) no longer moves the labels of the other genes in its cluster. The labels and track spacing used the size and position of whichever gene was drawn last. - Annotations now stay on their genes with
GC_scale(axis_type = "range"): the range axis moves the genes of each cluster to start at 1, and now moves the annotations of the cluster (x,x1,x2andposition) with them, whether they are added before or afterGC_scale(). They used to be drawn too far to the right. - A wrapped cluster label (
GC_clusterLabel()) keeps its<b>,<i>and<u>styles when the tagged text runs over two lines, e.g."pQEB1 <i>E. cloacae ECL-21</i>"; the tags were shown as text. The lines are now also measured without the tags, so they no longer break too early. - The legend of a chart with a fixed width (e.g.
GC_chart(width = "900px")) no longer gets smaller in a wider browser window: it was laid out at the width of the window and then scaled down into the chart, e.g. in a page saved withhtmlwidgets::saveWidget(). - The bottom of letters such as g, y and p in a title without a subtitle is no longer cut off: the default title height is now 40 pixels instead of 30, so
GC_title(height = )is no longer needed for titles of 16 or 18 pixels. - A named list of
customColors(inGC_color(),GC_genes()andGC_transcript()) that leaves out groups no longer makes those groups white: they keep the colours ofcolorScheme, the theme palette or the default colours, e.g.GC_color(customColors = list(Other = "grey"))only changes "Other".GC_color()now takescolorSchemetogether with a named list ofcustomColors. GC_transcript()no longer drops the settings of the whole chart made before it: the title, legend, theme andGC_grid()margins and direction are kept. Settings per cluster are for the old clusters and are set afterGC_transcript().GC_legend(backgroundColor = )now sets the legend background; it had no effect.- When a chart is redrawn in Shiny, styles of
GC_chart(style = )that are no longer set are removed; e.g. a background colour stayed after it was removed. GC_annotation(type = "symbol")no longer also draws a curve from x = 0 to x = 100.- The default gene colours now give 30 different colours. Groups 12 and 22, 13 and 26, 15 and 29, and 20 and 25 had the same colour; groups 22, 25, 26 and 29 now get new colours.
- Legend colours now match the gene colours when some genes have an
NAgroup. Genes with anNAgroup are now always white, also withcolorSchemeorcustomColors. GC_annotation(type = "arrow", arrowStyle = ...)now applies allarrowStyleoptions (e.g.stroke,strokeWidth,fillOpacity) to the arrow head; onlyfillwas used.- Arrow heads of
GC_annotation(type = "arrow")andtype = "textMarker"no longer take the size and colour of an arrow at the same position in another cluster or chart. GC_scale(breaks = ...)now works with breaks in any order; breaks not sorted by start put genes and axis ticks at the wrong position.GC_coordinates()no longer stops the chart from drawing when a cluster has no genes in view (e.g. afterGC_scale(start = , end = )); clusters below it and the bottom legend were missing.- The tooltip
mouseouthandler no longer relies on the deprecated globalwindow.event. - Each chart now uses its own
GC_tooltip()options; with several charts on a page, tooltips took the colours and font of another chart. Tooltips are now created inside the chart, so redraws (e.g. on resize) no longer add<style>tags to the page or (withGC_trackMouse()) extra tooltip elements. - Clicking a legend item no longer hides genes that were clicked off in the legend of another chart on the same page.
GC_trackMouse()now shows the right position to the right of scale breaks (it was too small by the width of the breaks on the left).- Charts no longer create the global JavaScript variables
toandlinearScale, which could overwrite variables of the same name on the page. - Gene labels from
GC_labels()and identity labels fromGC_links()no longer share element ids. The overlap check of a gene label used the identity label with the same id, so identity labels were rotated instead of the gene labels. GC_genes()andGC_transcript()no longer drop the colours fromGC_color()and the patterns fromGC_pattern()when called after them. TheircolorSchemeandcustomColorsnow also set the legend colours (when no cluster or selection is given), so the legend matches the genes.- Identity (or similarity) labels from
GC_links()and gene labels fromGC_labels()no longer overlap. Each gene now has one label with the gene name and, below it, its identity; when labels are rotated to avoid overlap, both are shown on one line (e.g. "eryK 64.1%"). - With
GC_cluster(prevent_gene_overlap = TRUE), labels of genes on the lower tracks are now drawn below their gene and rotate downwards when they overlap, instead of above the gene, under (and rotated into) the genes of the track above. A label stays above its gene when a gene of the next track is below it and the space above is free. itemStylevalues of 0 are no longer ignored inGC_labels(),GC_genes()andGC_transcript()(e.g.rotate = 0,y = 0orcornerRadius = 0for one gene); they fell back to the general option.GC_sequence(start = 0)andend = 0are no longer ignored; the line started at the first gene instead.GC_sequence(markerStyle = list(gap = ))is now a distance in pixels between each break marker and the break, the same for every break. It was a percentage of the marker's x position, so breaks further right opened wider. Charts that setgapget a narrower gap.- A percentage
GC_title(height = )orGC_legend(height = )now follows the chart height when the chart is resized; it kept the pixel height of the first draw. - Smaller fixes: legend items fade on hover again (an invalid CSS selector dropped the transition; it now only animates the opacity, so rotated gene labels no longer swing into place on every draw), legend items have unique ids, the 3' and 5' transcript labels have their own classes (
three-prime-label,five-prime-label), and unused or invalid styles were removed from the footer subtitle and the link layer. - The
GC_links()colour bar now shows a gradient for each link colour on the chart: the inverted gradient only when at least one link (in anyGC_links()set) joins opposite strands, and the normal gradient only when at least one link joins the same strand. Charts with only inverted links showed only the normal gradient, and charts with forward and reverse normal links showed an inverted gradient. The link data is no longer modified. GC_chart()no longer errors whenheightis a percentage (e.g.height = "100%").GC_cluster(prevent_gene_overlap = TRUE, cluster = ...)now stacks overlapping genes in the selected clusters instead of the first ones.read_gbk()no longer creates fake features from wrapped qualifier lines that start with a feature name (e.g. a/noteline starting with "gene") or from feature keys that start with another key (e.g.CDS_motifread asCDS).read_gbk()now keeps qualifier values intact (e.g. closing brackets in"... (PPTase)") and no longer errors on empty values (/pseudo="") or values that contain/key=.read_bed()no longer adds 1 tochromEnd,thickEndandblockSizes(BED ends are already 1-based), matchingrtracklayer::import.bed(). Values in these columns are now 1 lower than before. Block columns are now always lists, so single-row BED12 files no longer error and files where every row has the same number of blocks are read correctly.protein_blast()now works when the cluster column has a name other than"cluster"(set with theclusterargument).read_gff()now URL-decodes attribute values (e.g.%2Cto,), keeps values that contain=, trims spaces around keys, keeps#inside lines, stops at a##FASTAsection and no longer errors on rows with empty or missing attributes.read_fasta()now reads files with a single sequence that has alocation, keeps header values with spaces or square brackets intact (e.g.[protein=3-oxoacyl-[acyl-carrier-protein] reductase],OS=Homo sapiens), and uses the full span ofjoin()locations forstartandend.GC_scale(scale_breaks = TRUE)no longer errors on clusters with a single gene or with only overlapping genes.GC_scale(axis_type = "range")now shifts genes whenhidden = TRUE, only shifts the selected clusters (a single selected cluster no longer gets the genes of all clusters), keeps gene tracks fromGC_cluster(prevent_gene_overlap = TRUE), and passes...on to the scale options.GC_normalize(custom_gaps = ...)now measures the gap after a gene from its edges, so genes on the reverse strand get the right gap, and applies the gap after every gene with the given name.GC_clusterLabel(cluster = ...)without atitlenow labels each selected cluster with its own name instead of the names of the first clusters.- Arguments with one value per cluster no longer error in
if()checks: e.g.GC_labels(label = c("a", "b")),GC_genes(group = ...)andshow = c(TRUE, FALSE)inGC_labels(),GC_clusterLabel(),GC_clusterTitle(),GC_clusterFooter(),GC_coordinates(),GC_scaleBar()andGC_tooltip(). Arguments that take a single value (GC_title(show),GC_align(id, id_column),GC_transcript(type, transcript),GC_normalize(group)) now give a clear error. GC_legend()now gives an error for agroupcolumn that is not in the data, and when a legend is shown without any group. The checks testedlabels, which is not an argument (it foundbase::labels), so they never ran.- Links no longer take the colour of another link when a link cannot be drawn. Removed unused link label code that referred to an undefined
identityLabel. GC_grid(margin = list(top = , bottom = ))now works for charts with a percentage height (it errored), and the margins stay inside the chart height on standalone pages.genbank_to_fasta()now converts GenBank files with several records (one FASTA record per GenBank record); it errored before.mummer_alignment()no longer deletes unrelated files whose name contains<cluster1>_<cluster2>whenremove_files = TRUE; it now removes only the files MUMmer wrote. Cluster files are matched by exact file name (names likeBGC1+2work), file paths are quoted in the MUMmer commands, and names with spaces give a clear error.protein_blast(parallel = TRUE)now works on machines with one core (it tried to start 0 workers) and always stops its worker processes, also after an error. It uses at most 2 workers when_R_CHECK_LIMIT_CORES_is set (as inR CMD check).read_gbk()no longer addstranslation = NAto every feature without a translation (e.g.geneandsource).- Removed
.DS_Storefiles from the package and the unused internal functionscleanList()andadjust_to_range(). - Several geneviewer charts in one Shiny app (output IDs without a
-, or Shiny modules) no longer draw into each other's containers. The widget now uses its full element ID. - Charts on the same page no longer share settings through global JavaScript variables (e.g.
save_buttonof one chart was used by another chart after a resize). - Removed deprecated
.data$use in tidyselect calls (select(),pivot_wider()), which gave warnings with tidyselect >= 1.2.0.
0.1.11
Enhancements:
- Fix for setting tooltip and legend to FALSE
- Fix for links displayed behind graph
- Fix for getting proper strand directions in .gbk files
- Fix for passing additional CSS styles
- Add github actions to build Wasm assets for Shinylive
0.1.10
Enhancements:
- Several fixes to comply with CRAN policies.
0.1.9
Enhancements:
- Added tests for all core functions.
- Fix for applying custom colors in GC_color.
- Fix for setting direction in GC_grid.
- Prepared the package for CRAN release
0.1.8
Enhancements:
- Option to display transcripts using the GC_transcripts function.
0.1.7
Enhancements:
- Option to perform MUMmer alignments.
- Add option to add a color bar.
0.1.6
Enhancements:
- Option to perform BlastP between gene clusters.
- Add option to add links between genes in clusters.
0.1.5
Enhancements:
- Add preset markers for genes: arrow, boxarrow, box, cbox and rbox.
- Add options to load cluster information from GenBank and FASTA files.
0.1.4
Enhancements:
- Add option to add gene links.
- Change package name from GCVieweR to geneviewer.
0.1.3
Enhancements:
- Option to align a specified gene across clusters.
0.1.2
Enhancements:
- Options to add text, line, arrow, rectangle, symbol, terminator and promoter annotations to a GC_chart.
0.1.1
Enhancements:
- Introduced customizable margin settings for charts, clusters, titles, and legends.
- Added styling options for the containers of charts, clusters, titles, and legends.
- Implemented a new feature to display clusters side by side.
- Updated and expanded the documentation to reflect new features and usability improvements.
0.1.0
- Initial Beta release.
