Hi. Thanks a ton. How can I check that?
I am working with Rehh package of R .
data2haplohh is a function within rehh. So my command goes like this:
chr2<-data2haplohh(hap_file= 'SNPs_only.chr2.impute.hap' , map_file='chr2mapf1.inp', recode.allele= TRUE)
The error I get is: " Error in read.table(map_file, row.names = 1) : duplicate 'row.names' are not allowed "
My Map_files are in required format
I really don't understand why I am facing this error. The files are in required format. Please help Thanks
1 answer
Have you checked whether the numbers of SNPs are the same in your map file and the hap file?
I suppose that your map file has no header, so the number of SNPs should equal the number of lines. In Unix you could easily check with >> wc -l In case the hap file contains only the haplotypes and no other information you should have two columns per genotype (for both alleles), so the number of columns should be double the number of SNPs. With awk you can quickly get this for large files as well >> awk '{print NF; exit}' hap-file (eventually include the -F option to define the column delimiter)
Basically the number columns for the haplotype should be double the number of lines in the map file, right?
Log in to answer this question.
Count row names and unique row names. If they are different, your input has duplicate row names and the program accepts object with unique row names (probably).
Hi Thanks for replying Can you tell me How to count and compare the number of row names and unique row names?