Python package changelog
0.2.1
- The package draws with version 0.3.11 of the geneviewer JavaScript library, with the fixes for empty charts, hidden labels and tooltips below.
normalize()spaces the genes over the whole span 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, and a givengapis the gap drawn; it was (n - 1) / n of it for n genes. Charts made withnormalize()change. The R package has the same fix.links(group=)works on data with a column namedclusterwhen the clusters of the chart are another column, e.g.GC(data, cluster="genome"); it stopped with "cannot reindex on an axis with duplicate labels". That column is left out of the links. Links by that column itself (group="cluster") stop with a message to rename it.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 gotNone, whichGC(strand="strand")rejects.read_gff()andread_bed()give the column types of the R package 0.2.1, so the files of a folder can be combined when a column holds numbers in one file and text in another (e.g. chromosomes1andX).seqid,source,type,strandandphaseof GFF files, andchrom,name,strandanditemRgbof BED files are always text;scoreis always numbers,NaNfor a score of".". A score that is not a number becomesNaN, with a warning.- Links made with
links(group=)beforenormalize()move with their genes; they stayed at the old positions. Links given asdata(e.g. alignments) keep their positions, with a warning to add them afternormalize(). read_bed()reads files whose columns are separated by spaces (in a file without any tab), and names columns after the twelve of BEDV13,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.get_introns()(andtranscript()): an intron keeps the columns that are the same for all exons and UTRs of its transcript and is missing the others. It copied the exon before it, so a label of each exon, e.g.labels("exon_id"), was repeated on the intron after it.- Clearer errors for wrong arguments:
grid(margin=)takes pixels or a percentage of a chart height in pixels;legend(group=)one column;scale(scale_breaks=)andlinks(measure=)one value;links(value1=, value2=)both or neither, of the same length (a missingvalue2was ignored without a message). cluster(separate_strands=True, prevent_gene_overlap=True)warns that neither is applied, which is what happens; it said "Resetting to None". The docs ofgrid()say what awidthnumber is (pixels).- Tooltips (
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. 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.zoom(range=)andzoom(min=)are checked in themodeof an earlierzoom()when the call gives none:.zoom(mode="absolute").zoom(range=[100, 2000])stopped with the error for a relative range.show=Falseinlabels(),coordinates(),scale_bar(),cluster_title(),cluster_label()andcluster_footer()hides what an earlier call shows, e.g..coordinates().coordinates(show=False, cluster=2); 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 (or only rows without a start or end) takes the chart's methods:
labels("name")andlegend()stopped with "column not found in data", andnormalize()andtranscript()with an internal error. The chart has no clusters and draws as an empty chart. genbank_to_fasta()writes records without aVERSIONline, named by theirACCESSION, else theirLOCUSname, else the file name; without aDEFINITION, the header is the name only. They were left out without a message, so the FASTA file could be empty.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. Qualifiers without a value, such as/pseudo, are kept, with the value"", and a feature without qualifiers gets itsregion.read_gbk()reads the whole sequence (ORIGIN) of records of more than a million bases; it stopped at base 1,000,020, without a message.
0.2.0
- Charts in Jupyter notebooks, with the new
jupyterextra (pip install "geneviewer-py[jupyter]"): a cell that ends with a chart draws it. It works where anywidget does: JupyterLab, Jupyter Notebook, VS Code, Google Colab and marimo. chart.widget()gives the chart as a widget (geneviewer.jupyter.GCWidget) to keep in a variable. Its attributes hold the chart's events, as the inputs of a Shiny app do (widget.select,widget.zoom, ...),widget.on("select", callback)calls a function at each event,widget.zoom_to()moves the zoom slider, and settingwidget.chartdraws another chart in the same place.
0.1.0
The first release: the charts of the geneviewer R package and JavaScript library from Python, in Shiny for Python.
GC()makes a chart from a pandas DataFrame of genes, or from a GenBank file or folder. Its methods are theGC_functions of the R package (.labels(),.links(),.transcript(),.theme(), ...), with the same arguments in snake_case. A chart in Python and one in R with the same arguments give the same chart.geneviewer.shiny:output_geneviewer()and@render_geneviewershow a chart in a Shiny for Python app, its events are inputs such asinput.chart_select(), andzoom_to()moves the zoom slider from the server.- File readers:
read_gbk(),gbk_features_to_df(),read_gff(),read_fasta(),read_bed()andgenbank_to_fasta(), with the results of the R package's readers. - Alignment:
protein_blast()(with thealignextra) andmummer_alignment()(with MUMmer installed). geneviewer.datasets: the 11 example datasets of the R package.geneviewer_theme()andgeneviewer_palette()give the settings of the built-in themes and the colours of the palettes.
The package draws with version 0.3.10 of the geneviewer JavaScript library, which it includes.
