Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault even for small file and huge amount of memory #3

Closed
vicbp1 opened this issue Oct 14, 2021 · 8 comments
Closed

Segmentation fault even for small file and huge amount of memory #3

vicbp1 opened this issue Oct 14, 2021 · 8 comments

Comments

@vicbp1
Copy link

vicbp1 commented Oct 14, 2021

Hi Ying
I am trying to run IBDkin in a data set of 85K individuals (2.8M SNPs). The average size of each compressed hapibd output is 50GB. I am running the following line in a machine with 500Gb

for i in $(seq 1 5); do ${IBDkin} --ibdfile ibd.txt --map geneticmap.txt --ind complete_list_individuals_freeze1 --range ranges.txt --nthreads 60 --out kinship_analysis_part${i} --outmask --outcoverage --kinship 0.03125 --part 5 ${i} ; done

Even when I run just for the small chr (~27Gb) I got the Segmentation fault error when ibdkin is reading the hapibd file.

First pass ...
reading /21_split1.ibd.gz
Segmentation fault (core dumped)

Do you have any recommendation?

Another question, does ibdkin have any bias related to the kinship coeffient inferences for recent admixed individuals?

@YingZhou001
Copy link
Owner

Hi Victor,

Thanks for reaching.
Based on your situation, I will try to add option "--part 10 1" to your command. If the problem is still there, I will check the input files.

Best,
Ying

@vicbp1
Copy link
Author

vicbp1 commented Oct 14, 2021

Thank for your answer!
I double checked the inputs and they look ok. For values like --part 10, 20, or 50 the result is the same even when I increase the memory availability (700G). Just for one chr that I had a different error : Error!, maker ranges for chromosome do not cover the position 21138926

Even when my data have that region

Any thoughts?

@YingZhou001
Copy link
Owner

YingZhou001 commented Oct 14, 2021

Hi Victor, I don't think this is a memory problem.
Did you check the range file? it should cover all your markers.
And also check the chromosome identifier, it should be in the same codes for all input files.
If the range file is good, I will cehck 1) ibd file, compare the format with the example to look difference. 2) for each IBD segment, the end position should be larger than the start position. 3) the genetic map, both the physical and genetic positions should be in increasing order.

Best,
Ying

@vicbp1
Copy link
Author

vicbp1 commented Oct 15, 2021

Hi Ying,

I found that there was something wrong during the compression of the files and now is working
Thank you so much for your time!

@vicbp1
Copy link
Author

vicbp1 commented Oct 18, 2021

Hi Ying,

After checking all my files and running again I have found this error:

Error!, maker ranges for chromosome do not cover the position 4160868

What it means exactly? Do I have to modify my range sfile?

@YingZhou001
Copy link
Owner

YingZhou001 commented Oct 19, 2021 via email

@bguo068
Copy link

bguo068 commented Oct 20, 2021

Hi @YingZhou001,

It has been a while since we met via Zoom in the MCMC workshop this summer :).
Victor and I are from the same group. We looked at this issue together this afternoon. We figured that the issue was caused by the memory overflow from str1 or str2 to chr.

char str1[BUFF1], str2[BUFF1];
int tmpid;
int chr, id1, id2;

for(i = 0; i < buffi; i++){
if(i % N != th_index)continue;
sscanf(strbuff[i], "%s %*s %s %*s %*s %f %f %f", str1, str2, &p1, &p2, &l);

It would not be an issue if the sample names are short. But we happened to have long sample names in our IBD input files (as long as 58 bytes, longer than buffer size (BUFF1 or 32) .

#define BUFF 128
#define BUFF1 32

After we edited #define BUFF1 32 to #define BUFF1 128, #define BUFF 128 to #define BUFF 512 and recompiled the code, it runs without crashing immediately. Hope it runs smoothly to the end. @vicbp1

@YingZhou001
Copy link
Owner

YingZhou001 commented Oct 20, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants