ELIMINATING DUPLICATED MARKERS

675 views
Skip to first unread message

Cinthya

unread,
Apr 11, 2012, 12:04:36 PM4/11/12
to R/qtl discussion
Hello group,

Please can anyone share with me the code to eliminate duplicated
markers. I already identified them using:

print(dup <- findDupMarkers(snpmap, exact.only=FALSE))

but I do not know how to eliminate the duplicated ones and keep the
marker that represents the group.

Thanks for any help,
Cinthya

Karl Broman

unread,
Apr 11, 2012, 12:52:43 PM4/11/12
to rqtl...@googlegroups.com
unlist(dup) will create a vector with just the names of the duplicate markers.
You can then use drop.markers to remove them from the cross object.

snpmap.nodup <- drop.markers(snpmap, unlist(dup))

karl

> --
> You received this message because you are subscribed to the Google Groups "R/qtl discussion" group.
> To post to this group, send email to rqtl...@googlegroups.com.
> To unsubscribe from this group, send email to rqtl-disc+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rqtl-disc?hl=en.
>

Cinthya

unread,
Apr 12, 2012, 1:30:06 PM4/12/12
to R/qtl discussion
Thanks for the code Karl,

Now I am trying to eliminate duplicated genotypes
I have them identified using the following code
cg <- comparegeno(snpmap.nodup)
wh <- which(cg > 0.9, arr=TRUE)
wh <- wh[wh[,1] < wh[,2],]
wh
but again I can not eliminate just one of the duplicate pairs.
I hope you can help me!

Cinthya

Karl Broman

unread,
Apr 12, 2012, 7:25:27 PM4/12/12
to rqtl...@googlegroups.com
Try:

cg <- comparegeno(snpmap.nodup)
wh <- which(cg > 0.9, arr=TRUE)

wh <- wh[wh[,1] < wh[,2],,drop=FALSE]
snpmap.nodup <- subset(snpmap.nodup, ind= -wh[,1])

In the second-to-last line, 'drop=FALSE' ensures that the result is a matrix even if it has just one row. That way wh[,1] will still work.

karl

Reply all
Reply to author
Forward
0 new messages