How to plot a network without background connection or labels? R pegas
I believe you can adjust that by setting threshold = 0
in your plot()
call, that is:
plot(net, size = attr(net, "freq"), pie=ind.hap, fast = TRUE, legend=F, label=NULL, threshold = 0)
See help for ?pegas::plot.haploNet
for more details. Also please note that the post you mention (here) has a bug where the pie-chart is being coloured wrongly (I've made a comment about it and also posted a corrected answer here).
Identifying mutations between haplotypes using haploNet (pegas) in R
The pegas
package contains a function diffHaplo
, which specifies differences between haplotypes.
diffHaplo(haps50, a = "XX", b = "V")
To extract the DNA sequence of the frequent haplotype V
, the indexes in the object of class haplotype
will identify, which DNA sequence contains the haplotype.
# haplotype index from its name
i <- which(attr(haps50, "dimnames")[[1]] == "V")
# index of the first sequence with the haplotype
s <- attr(haps50, "index")[[i]][1]
The respective sequence can then be identified in the alignment fa
to save or print on screen.
write.dna(fa[s], file = "hapV.fas", format = "fasta", nbcol = -1, colsep = "")
paste(unlist(as.character(fa[s])), collapse = "")
Related Topics
Replace Nan Values in a List with Zero (0)
How to Install R-Packages Not in the Conda Repositories
Passing Arguments into Multiple Match_Fun Functions in R Fuzzyjoin::Fuzzy_Join
Check to See If a Value Is Within a Range
How to Create a Hyperlink Interactively in Shiny App
Drawing a Stratified Sample in R
Warning: Replacing Previous Import 'Head' When Loading 'Utils' in R
Removing Text Containing Non-English Character
R Plot: Using Italics and a Variable in a Title
Use Lapply for Multiple Regression with Formula Changing, Not the Dataset
Ggplot2: Fill Color Behaviour of Geom_Ribbon
Drawing a Tangent to the Plot and Finding the X-Intercept Using R
Wavelet Reconstruction of Time Series
R: Building a Simple Command Line Plotting Tool/Capturing Window Close Events
Merge Records Over Time Interval
How to Move the Bibliography in Markdown/Pandoc
How to Rename All Columns of a Data Frame Based on Another Data Frame in R