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

Plotting specific coordinates from a gff3 file #44

Closed
soungalo opened this issue Sep 26, 2020 · 3 comments
Closed

Plotting specific coordinates from a gff3 file #44

soungalo opened this issue Sep 26, 2020 · 3 comments

Comments

@soungalo
Copy link

Suppose I have a gff3 file and I want to plot everything on chr1 positions 1000-2000.
Can you please provide some example code? Should I use the BiopythonTranslator class? How exactly? (maybe there should be an example in the documentation).
Thanks!

@veghp
Copy link
Member

veghp commented Sep 27, 2020

Hi, thanks for trying this package out. I think your question has been answered in #34 (comment).

Specifically, you can plot only a section of the record (from start to end):

start = 1000
end = 2000
record = BiopythonTranslator().translate_record(gff_records[0][start:end])
ax, _ = record.plot(figure_width=10, strand_in_label_threshold=7)

see the other thread for details, and please let me know if that solves the problem.

@veghp veghp closed this as completed Oct 16, 2020
@APengs494
Copy link

How to use GraphicFeature to change gene color from gff3 files.

@veghp
Copy link
Member

veghp commented Dec 6, 2021

Define your biopython translator with a custom set of colours, as described in the documentation: https://github.com/Edinburgh-Genome-Foundry/DnaFeaturesViewer#custom-biopython-translators

then you can use it to read your gff file and plot it.

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