-2

I have following data set. I want to extract marker every 5 cM (fourth column distance in cM) e.g 0, 5, 10, 15 for each chromosome i.e. 1 - 12. where each chromosome has marker at 0 to 100 or even cM distance. So we need to take marker on each chromosomes taking. Could you please guide me how I can do it.

e.g data format

Group   SNP Marker         Chromosome    Mbp        cM
Common  solcap_snp_sl_15058   1          0.05       0
Common  solcap_snp_sl_15051   1          0.3       2.9
Common  solcap_snp_sl_15050   1          0.3       2.9
Common  solcap_snp_sl_15049   1          0.3       5.0
Common  CL004303-0524         1          0.31      2.9
Common  solcap_snp_sl_24809   1          0.32      10
-              -              .          .           .
-                        .         .          . 
Common  solcap_snp_sl_19393  12         64.48      92.8
Common  SGN-U317539_snp      12         64.78      93.7
Common  solcap_snp_sl_54088  12         64.82      94
Common  solcap_snp_sl_31405  12          4.91       95
Common  SGN-U567105_snp715_solcap_snp_sl_31389  12  64.99   97.2
Common  CL009067-0206   12  65.14   99.1
Common  solcap_snp_sl_31353 12  65.15   99.1

Like marker at 0 then at 5 then 10 same for each chromsomes if possible.

Group   SNP Marker         Chromosome    Mbp        cM    
Common  solcap_snp_sl_15058   1          0.05       0    
Common  solcap_snp_sl_15049   1          0.3       5.0    
Common  solcap_snp_sl_24809   1          0.32      10
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
user3459293
  • 320
  • 1
  • 3
  • 11
  • It's not clear for me. Can you add example of requested output? – Adii_ Oct 15 '14 at 09:42
  • Like marker at 0 then at 5 then 10 same for each chromsomes if possible. Group SNP Marker Chromosome Mbp cM Common solcap_snp_sl_15058 1 0.05 0 Common solcap_snp_sl_15049 1 0.3 5.0 Common solcap_snp_sl_24809 1 0.32 10 Thanks – user3459293 Oct 16 '14 at 10:54

1 Answers1

0
dat[dat$cM %in% seq(0, max(dat$cM), 5), ]

will do the trick.

Sven Hohenstein
  • 80,497
  • 17
  • 145
  • 168