-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathvisualize.R
More file actions
27 lines (19 loc) · 934 Bytes
/
visualize.R
File metadata and controls
27 lines (19 loc) · 934 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#######
# Purpose: Visualize fastANI core-genome comparison
# Usage: Rscript <this_script> <query sequence in fasta format> <subject sequence> <fastANI visualization output>
# Output: <fastANI visualization output filename>.pdf
# Uses genoPlotR package: http://genoplotr.r-forge.r-project.org
#Parse command line arguments
query_fasta=commandArgs(TRUE)[1]
subject_fasta=commandArgs(TRUE)[2]
fastANI_visual_file=commandArgs(TRUE)[3]
library(genoPlotR)
#Read fastANI output
comparison <- try(read_comparison_from_blast(fastANI_visual_file))
#Read sequences into genoPlotR objects
Query <- try(read_dna_seg_from_file(query_fasta))
Ref <- try(read_dna_seg_from_file(subject_fasta))
plotTitle = paste(query_fasta, subject_fasta, sep=" v/s ")
pdf( paste(fastANI_visual_file,".pdf",sep="") )
plot_gene_map(dna_segs=list(Query, Ref), comparisons=list(comparison), main=plotTitle, scale=FALSE, scale_cex=1, n_scale_ticks=4)
dev.off()