-
Notifications
You must be signed in to change notification settings - Fork 19
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
Can this align multiple chromosomes ? #12
Comments
Currently, pyGenomeViz does not have the functionality to align and visualize multiple chromosomes. I recommend that you check other tools such as GENESPACE and MCscan(jcvi), which enable you to align and visualize multiple chromosomes. |
An additional question that might lead to another feature. |
@gunjanpandey I don't have a method built just yet since I only recently started playing around with these plots. However, I am working on a solution currently. Not sure if anything will come of it though :) |
The following is an answer regarding the chromosome or contig inversion option. It may not be a complete answer, but it may be helpful. Genbank reverse complement sequences can be easily obtained by using the reverse_complement method implemented in BioPython's SeqRecord. Below is an example code. from pygenomeviz import Genbank, GenomeViz, load_dataset
gbk_files, _ = load_dataset("enterobacteria_phage")
gv = GenomeViz(fig_track_height=0.7)
# Normal direction
gbk = Genbank(gbk_files[0])
track1 = gv.add_feature_track(f"{gbk.name} (normal)", size=gbk.range_size)
track1.add_genbank_features(gbk)
# Reverse direction
gbk_reverse = Genbank(gbk_files[0], reverse=True)
track2 = gv.add_feature_track(f"{gbk_reverse.name} (reverse)", size=gbk_reverse.range_size)
track2.add_genbank_features(gbk_reverse, facecolor="skyblue")
gv.savefig("genbank_example_plot.png") |
This comment was marked as off-topic.
This comment was marked as off-topic.
Close as the issue is resolved in major upgrade v1.0.0 Code Example from pygenomeviz import GenomeViz
from pygenomeviz.align import MUMmer
from pygenomeviz.parser import Genbank
from pygenomeviz.utils import load_example_genbank_dataset, ColorCycler
ColorCycler.set_cmap("tab10")
gbk_files = load_example_genbank_dataset("saccharomyces")
gbk_list = list(map(Genbank, gbk_files))
gv = GenomeViz(feature_track_ratio=0.1)
gv.set_scale_bar(ymargin=2.0)
# Plot chromosomes
for gbk in gbk_list:
color = ColorCycler()
track = gv.add_feature_track(gbk.name, gbk.get_seqid2size(), space=0.01, label_kws=dict(color=color))
for segment in track.segments:
segment.add_feature(segment.start, segment.end, plotstyle="bigrbox", fc=color, lw=0.5)
# Run MUMmer alignment
align_coords = MUMmer(gbk_list).run()
# Plot MUMmer alignment links
if len(align_coords) > 0:
for ac in align_coords:
gv.add_link(ac.query_link, ac.ref_link, color="grey", inverted_color="red", curve=True, filter_length=1000)
gv.savefig("result.png") result.png |
Can this align multiple chromosomes? something like this?
If yes, please explain how.
The text was updated successfully, but these errors were encountered: