Big coordinates not handled
See original GitHub issueHi,
I’m testing out your tool to see if it’s suited to my needs e.g. visualize primers in a pretty way.
from dna_features_viewer import GraphicFeature, GraphicRecord
import matplotlib.pyplot as plt
sequence = "TCAAGCTTGCCATCTCTTCATGTTAGGAAACAAAAAGCCCTAGAAGCAGAATTAGATGCTCAGCACTTATCAGAAACTTT"
record = GraphicRecord(sequence=sequence, features=[
GraphicFeature(start=112173530, end=112173530+20, strand=+1, color="#ffd700",
label="Primer1"),
GraphicFeature(start=112173530+50, end=112173530+70, strand=-1, color="#cffccc",
label="Primer2"),
])
zoom_start1, zoom_end1 = 112173530, 112173530+30 # coordinates of the "detail"
zoom_start2, zoom_end2 = 112173530+40, 112173530+80
cropped_record1 = record.crop((zoom_start1, zoom_end1))
cropped_record2 = record.crop((zoom_start2, zoom_end2))
fig, (ax1, ax2, ax3) = plt.subplots(1, 3, figsize=(14, 3))
# PLOT THE WHOLE SEQUENCE
ax1.set_title("Whole sequence", loc='left', weight='bold')
record.plot(ax=ax1)
ax1.fill_between((zoom_start1, zoom_end1), +80, -80, alpha=0.15)
ax1.fill_between((zoom_start2, zoom_end2), +80, -80, alpha=0.15)
# PLOT THE SEQUENCE DETAILS
cropped_record1.plot(ax=ax2)
cropped_record1.plot_sequence(ax=ax2)
ax2.set_title("Sequence detail", loc='left')
#
cropped_record2.plot(ax=ax3)
cropped_record2.plot_sequence(ax=ax3)
ax3.set_title("Sequence detail", loc='left')
fig.savefig('overview_and_detail.png')
I copied some of your code and replaced some values to suit a real life situation and the program returns ValueError: out-of-bound cropping
.
Can the tool not handle big coordinates?
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (8 by maintainers)
Top Results From Across the Web
Rhino can't handle world coordinates sometimes
One workaround is to use a local coordinate system. Which means picking consistent point near te stuff you work with, and then systematically...
Read more >Large coordinates truncated in PLY - Agisoft Metashape
Large coordinates truncated in PLY. ... big numbers, so the problem may be caused by the viewer software that could not handle big...
Read more >Coordinates remain very high when converting projections
ArcGIS handles the conversion correctly, it writes x first (longitude), then y (latitude) in the geojson file, from a dataset in WGS84. So...
Read more >[FIXED] Large coordinates does not display properly
So you are always working with large coordinates. Almost every software can not display point clouds with such coordinates.
Read more >leaflet does not handle projected coordinates and confuses ...
A user asked me why sp and rgdal are broken because leaflet does not display sp objects read in using rgdal. It is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m not entirely sure about your scenario but here is some alternative code which (I hope) does the same thing:
I am not sure why the x coordinates are truncated for you but it could be due to Matplotlib’s way of writing the coordinates. Have you noticed that there is a “+1.1217e8” notation under the axis, indicating that you should add 112,170,000 to the x-coordinate.
Thanks!