Entering edit mode
Hi, why do sequence alignments with rowmasks still return the names of every row? Is there an easy way to get only the names of the sequences affected by the mask?
e.g.
origMAlign <- + readDNAMultipleAlignment(filepath = + system.file("extdata", + "msx2_mRNA.aln", + package="Biostrings"), + format="clustal") rowmask(origMAlign, invert = TRUE) <- c(1,2) rownames(origMAlign)
In the above example I'd like to get only the first two sequence names.
I can do it like so:
rownames(origMAlign)[which(!as.logical((coverage(rowmask(origMAlign)))))]
But that feels hacky.
Thanks,
Ben.
@Val: to get only the names of the masked sequences you need a minus before the
unlist()
:@Ben: a slightly simpler way is:
H.