Closed webermarcolivier closed 6 years ago
Yes, with:
cropped_record = record.crop((start, end))
cropped_record.plot()
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).
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
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.
Is there a way to plot a region start..end of a Genbank file?