BGI-shenzhen / PopLDdecay

PopLDdecay: a fast and effective tool for linkage disequilibrium decay analysis based on variant call format(VCF) files
MIT License
186 stars 55 forks source link

How the calculated the decay line by nonlinear regression to the LD plot? #10

Open sekhwal opened 3 years ago

sekhwal commented 3 years ago

Hi, I am trying to add the non-linear regression tendency line to the Linkage Disequilibrium (LD) plot. I followed the manual document of PopLDdecay and got the plot. However, I am looking to make plot like above where r2 only goes until 0.5 and physical distance until 500 kb. Got the plot using PopLDdecay. Out Prefix

However,

I am looking the LD plot like this with dots. Picture1

hewm2008 commented 3 years ago

Dear @sekhwal You can try to increase these three parameters [ -bin1 -break -bin2 ]when you draw, it will smooth your curve, like : Perl plot_XXX.pl -bin1 1000 -break 10000 -bin2 1000

By the way :
This situation may be caused by the following two reasons:

A:
Ref assembly quality is too poor (poor assembly ref).

Due to the relationship between the r2 of ld decay and the physical distance, when the Ref scaffols connected to LG, the order of the scaffols is wrong or the length of N inserted in the middle is seriously wrong, this is very likely to affect the result.

Solution: In this case, you can return to the original scaffold coordinates and take the long scaffolds to analyze or use Perl plot_XXX.pl -bin1 1000 -break 10000 -bin2 1000

B: may the SNP density is too low,SNP dataset is too small.

SNP of RAD or GBS sequencing or chip data may cause this situation .

Solution: In this case, You can try to increase these three parameters [ -bin1 -break -bin2 ]when you draw, it will smooth your curve, like : Perl plot_XXX.pl -bin1 1000 -break 10000 -bin2 1000

sekhwal commented 3 years ago

Hi, Thank you for your reply. However, the parameters did not improve the plot significantly. I am looking a decay line and the all the dots as similar example LD plot here (Fig.2 in gray color). Also, please let me know how to make plot where r2 only goes until 0.5 and physical distance until 500 kb Please let me know if I am able to make like example LD plot using PopLDdecay. I just got like this using parameters:: segi_Fig

hewm2008 commented 3 years ago

the decay line fluctuation is Due to youre poor assembly ref ( Ref assembly quality is too poor ).

a) PopLDdecay-3.41/bin/PopLDdecay -MaxDist 500 can make the physical distance to 500 kb b)
update the -bin1 -bin2 to 100000 or more big ; as plot_XXX.pl -bin1 10000 -break 100000 -bin2 10000

Due to the relationship between the r2 of ld decay and the physical distance, when the Ref scaffols connected to LG, the order of the scaffols is wrong or the length of N inserted in the middle is seriously wrong, this is very likely to affect the result.

Solution: In this case, you can return to the original scaffold coordinates and take the long scaffolds to analyze or use Perl plot_XXX.pl -bin1 10000 -break 100000 -bin2 10000