Question: .lgen to .ped conversion failing
1
gravatar for dharl
5.6 years ago by
dharl70
India
dharl70 wrote:

So I have converted the reprt.txt and map.txt files into .lgen formats. But my conversion from .lgen to bed file keeps failing due to memory issue even though I try to run it chromosome wise. 

Here are the first few lines of my files: 

DGKH413ADHJW:Plink_working dlekshmi$ head HNPGenotypes.lgen
1 HNP_DNA_1 rs1000000 C C
2 HNP_DNA_1 rs1000002 A G

DGKH413ADHJW:Plink_working dlekshmi$ head HNPGenotypes.fam
1 HNP_DNA_1 0 0 0 0
2 HNP_DNA_1 0 0 0 0

DGKH413ADHJW:Plink_working dlekshmi$ head HNPGenotypes.map
12 rs1000000 0 126890980
3 rs1000002 0 183635768

 

I generated the files based on this code: 

https://github.com/dhibar/ADNI_Genetics_Convert_to_PLINK according to the presentation: http://www2.warwick.ac.uk/fac/sci/statistics/staff/academic-research/nichols/presentations/ohbm2014/imggen/Hibar_ImgGen-CommonVar_OHBM2014.pdf

 

There are whole there are 70000SNPs for over 100 samples. So on the whole around 7 million.  Any help will be appreciated. 

snp plink • 1.7k views
ADD COMMENTlink modified 4.6 years ago by marwa.cs9130 • written 5.6 years ago by dharl70
1

Does this fail in PLINK 1.90?  If so, can you describe the memory error in more detail?

ADD REPLYlink written 5.6 years ago by chrchang5236.9k

This is the error I get. yes I run this on 1.9

Reading pedigree information from [ HNPGenotypes.fam ] 
plink(7973,0xa02711a8) malloc: *** mach_vm_map(size=1048576) failed (error code=3)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
*****************************************************
* FATAL ERROR    Exhausted system memory            *
*                                                   *
* You need a smaller dataset or a bigger computer...*
*                                                   *
* Forced exit now...                                *
*****************************************************
ADD REPLYlink modified 6 months ago by RamRS27k • written 5.6 years ago by dharl70
1

Double-check your version; that's a v1.07 error message.

ADD REPLYlink written 5.6 years ago by chrchang5236.9k

You mean 70 million, not 7. I'd suggest breaking your input into 70 files, 1 million lines each, convert to bed and combine them. Would that work?

ADD REPLYlink written 5.6 years ago by RamRS27k

Hi, 

sorry it was a mistake, it 7 million. I edited the number now. Well I tried doing it per chromosome... and it gave me the same error. maybe I should split it into smaller files.. but i donot know how to combine them 

ADD REPLYlink written 5.6 years ago by dharl70

Smaller files might help, yes, unless PLINK offers memory allocation/optimization options.

Combining BED files is fairly simple. You'd have to split your input files and use a name the split files with a numeric index in them (like part.1, part.2, ... part.99, ...)

Each part file would yield a BED file that you can name similarly (part.1.bed, part.2.bed, ... part.99.bed, ...)

You'd then run a loop in the shell, grep the lines that do not start with a '#' and append to the master BED file. Something like this:

for i in $(seq 1 99)

do

grep "^[^#]" part.${i}.bed >>bigBedFile.bed

done
ADD REPLYlink written 5.6 years ago by RamRS27k

Unfortunately, this doesn't work since PLINK .bed is not the same as UCSC Genome Browser .bed.

ADD REPLYlink written 5.6 years ago by chrchang5236.9k

Oh, this is the other bed, the binary format. Oops, I should be more careful. Thank you!

ADD REPLYlink written 5.6 years ago by RamRS27k

Hello all, I am new in plink analysis, Conversion to plink format keeps failing due to an error.

Error: failed to open HNPGenotypes.fam

Converting raw genotype output from BeadStudio CSV files to Plink format

Any help will be appreciated

ADD REPLYlink modified 6 months ago by RamRS27k • written 4.6 years ago by marwa.cs9130
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: 1823 users visited in the last hour