Question: ERROR: Duplicate row.names not allowed
0
gravatar for shrutishreyajha
23 months ago by
shrutishreyajha0 wrote:

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

rehh R • 2.2k views
ADD COMMENTlink modified 18 months ago by Biostar ♦♦ 20 • written 23 months ago by shrutishreyajha0
2

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 REPLYlink modified 23 months ago • written 23 months ago by cpad011212k

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

ADD REPLYlink written 23 months ago by shrutishreyajha0
1
gravatar for Wietje
23 months ago by
Wietje210
Germany
Wietje210 wrote:

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

ADD COMMENTlink written 23 months ago by Wietje210

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

ADD REPLYlink written 23 months ago by shrutishreyajha0

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 REPLYlink written 23 months ago by Wietje210
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2396 users visited in the last hour