-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement SBOL sequence feature glyphs #64
Comments
ccb1482 introduced a new internal approach to drawing the same geom in multiple coordinate systems which eliminates the need to have separate functions or makeContent methods for each coordinate system. The 'standard' process for defining how a glyph geom is drawn should be:
For label geoms, the process is slightly different, because
|
Should features still have xmin/xmax to indicate reverse complements? For SBOL glyphs, features on the reverse strand should be below the origin? In #62, you introduced the 'forward' aesthetic - maybe this should be 'direction' instead and accept |
Good question. I think there are a few interlocking issues here. The
|
Implement the Synthetic Biology Open Standard (SBOL) sequence feature glyphs. The current rough plan for this is:
geom_<glyph>()
function for each sequence feature glyphgeom_gene_arrow()
becomes a wrapper forgeom_CDS()
and soft deprecatedgeom_subgene_arrow()
becomes a wrapper forgeom_polypeptide_region()
and soft deprecatedgeom_feature()
becomes a convenience geom that wraps all the glyph geoms and accepts atype
aesthetic. This allows a user to draw different types of sequence feature with a single layer, rather than having to add a new geom layer for each type, which could get tedious. This function will lack the flexibility of having different aesthetic mappings for different glyphs, as well as fine-tune control of glyph geometry, but it will still probably cover a large proportion of use cases. To maintain backward compatibility, if thetype
aesthetic is not mapped, it should draw promoters or locations with the currentgeom_feature()
interface, but this functionality will be soft-deprecatedxmin
,xmax
andforward
aesthetics to control the direction of directional glyphsgeom_gene_arrow()
/geom_gene_label()
by having a separategeom_<glyph>_label()
for each glyph (geom_CDS_label()
,geom_intron_label()
etc.). This is necessary to preserve the ggplot2 grammar, as a user might want to use different aesthetic mappings for glyphs and labels.geom_gene_label()
,geom_feature_label()
, andgeom_subgene_label()
would become wrappers and soft deprecatedgeom_<glyph>()
layers will also accept a label aesthetic which draws a text label for the feature with sensible defaultsI've opened a SBOL_glyphs branch to work on this, and added
geom_aptamer()
andgeom_aptamer_label()
as a starting point:Created on 2023-07-11 with reprex v2.0.2
To get the coordinates for the aptamer glyph, I downloaded the SVG files for the glyphs from the latest SBOL release then converted them to grid-compatible coordinates with the svgparser package:
This has the pleasing benefit that paths expressed as Bézier curves in the SVG are automatically converted into a series of short line segments, which sidesteps the trouble of transforming Béziers into polar coordinates. I think this method of extracting the glyph coordinates from the SVG assets should be the rule, though no doubt there will be some exceptions where this is not be best choice.
The text was updated successfully, but these errors were encountered: