Skip to content
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

plot a region of genbank file #12

Closed
webermarcolivier opened this issue Aug 6, 2018 · 4 comments
Closed

plot a region of genbank file #12

webermarcolivier opened this issue Aug 6, 2018 · 4 comments

Comments

@webermarcolivier
Copy link

Is there a way to plot a region start..end of a Genbank file?

@Zulko
Copy link
Member

Zulko commented Aug 6, 2018

Yes, with:

cropped_record = record.crop((start, end))
cropped_record.plot()

@peterjc
Copy link

peterjc commented Jan 13, 2020

Beware that Biopython's SeqRecord cropping (which I assume is what the example shows) will only keep features fully within the crop region. Anything saddling the boundary is lost (trying to crop a feature and accurately describe it is filled with corner cases).

@Zulko
Copy link
Member

Zulko commented Jan 13, 2020

Hello - this is taken into account, and the .crop() method implements its own cropping of the GraphicRecord (it doesn't crop the original SeqRecord). In the result, annotations saddling the boundaries are still there but marked as "open-ended" on the sides, as you would expect. See for instance example overview_and_detail.py

@peterjc
Copy link

peterjc commented Jan 13, 2020

Excellent, I'd have to remind myself of the details but GenomeDiagram also had its own cropping (you give it a full record and tell it a start/stop), although I don't think we drew open ended edges like your example - that's a very nice visual cue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants