ERROR: Duplicate row.names not allowed
1
0
Entering edit mode
7.0 years ago

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

R rehh • 4.7k views
ADD COMMENT
2
Entering edit mode

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).

ADD REPLY
0
Entering edit mode

Hi Thanks for replying Can you tell me How to count and compare the number of row names and unique row names?

ADD REPLY
1
Entering edit mode
7.0 years ago
Wietje ▴ 240

Have you checked whether the numbers of SNPs are the same in your map file and the hap file?

ADD COMMENT
0
Entering edit mode

Hi. Thanks a ton. How can I check that?

ADD REPLY
0
Entering edit mode

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?

ADD REPLY

Login before adding your answer.

Traffic: 1587 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6