Skip to content
Prev 382910 / 398502 Next

find multiple mode, sorry for not providing enough information

You **might** do better pursuing this sort of thing on the Bioconductor site:
https://www.bioconductor.org/help/<https://urldefense.com/v3/__https://www.bioconductor.org/help/__;!!Fou38LsQmgU!441uqddHFvpuq6wfAy-jNNUZ8Dz_jGxN9itKerhoPxav-yjaqUkpwPhN4bJJ$>
They often have professionally written R packages tailored for genomics so that you don't need to shake and bake your own with all the dangers that entails (not least of which may be that your methodology is suspect).

Bert Gunter

"The trouble with having an open mind is that people keep coming along and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )

Thank you, Bert!

I just realized that I made a typo in the following email, so I modified it using the red font.  we are doing genomics work, but this is a understudied genomic research, so no professional packages. I admit that what I am doing is pretty explorative.
On Sun, Mar 15, 2020 at 9:11 PM Yuan Chun Ding <ycding at coh.org<mailto:ycding at coh.org>> wrote:
sorry, I just came back.

Yes,  Abby's understanding is right.
[1]  1    3   4   5   6    7   8   9  10  11  12  13  14  15  16  17  18  20   21   22    23     24   25   31
[1]   1   2   5   5  10   4   4   8   1    1    8    8    2    4    3    1    2    1     1   138  149    14    1     1

I have 2000 markers, this is just one example marker, the var1 is a VNTR marker with alleles 1, 3, 4 etc, a multi-allele marker; the corresponding frequency for each allele is 1,2 5 etc.  I want to convert this multi-allele marker to bi-allele markers by choosing a cutoff value; I would want the cut point to be allele 6 with frequency of 10, so allele 1 to allele 5 are considered as "short" allele, allele 6 to 31 as "long" allele;  then sliding to next rsing frequency peak, allele 8 with frequency of 8, etc.

maybe those rising peaks are not really multiple modes, but I want to do this type of data conversion.  I want to first determine the number of modes, then convert input dat file into m different input files, then perform Cox regression analysis for each converted file. I am stuck in the step of find out m rise peaks.

Thank you,

Ding

   tem <- as.data.frame(t(dat[i,,drop=F]))
  names(tem)<-"V1"
  tem <- tem[which(tem$V1!=""),,drop=F]
  tem2 <-separate(tem, col=V1, into=c("m1","m2"), convert = T)
  tem3 <-gather(tem2, marker, VNTR_repeats, m1:m2)
  tem4 <-as.data.frame(t(t(table(tem3$VNTR_repeats))))[,c(1,3)]
  tem4$Var1 <-as.numeric(as.character(tem4$Var1))
  tem4 <-tem4[order(tem4$Var1),]
  m<-