dportik / dadi_pipeline

An accessible and flexible tool for fitting demographic models with dadi using custom or published models (available here), conducting goodness of fit tests, and plotting.
GNU Lesser General Public License v3.0
63 stars 30 forks source link

does the pipeline incorporates correction for ancestral state misidentification? #15

Closed upasana3 closed 3 years ago

upasana3 commented 3 years ago

Hi,

Thank you for writing the pipeline. I find it straightforward and easy to use. I am trying to fit a simple 1D model to one of my populations and want to correct for the ancestral state misidentification. I was not sure if the pipeline is built to correct for the misidentification of the ancestral state. If not, is it possible to incorporate this correction into the pipeline, and what would be a good way to do so? I am new to dadi and python and any help would be greatly appreciated.

Thank you again! Upasana

dportik commented 3 years ago

Hello Upasana, The pipeline does not currently have the ability to correct misidentified ancestral states. You may wish to check on the dadi-user group for how to do this. I think there are a few posts on this topic. If you can find an answer and reply here with the solution, I can help you implement it in the code.

upasana3 commented 3 years ago

Hi Daniel,

Thank you for your response. The suggested way is to add one more parameter (p_misid) to the model using: func_anc = Numerics.make_anc_stat_misid_func(func) and optimizing p_misid with other parameters. This would require adding the upper and lower bounds for the added parameter (p_misid). I tried to incorporate this in the pipeline. I added "func_anc = Numerics.make_anc_stat_misid_func(func)" to Optimize.Functions.py (modified script is attached herewith). I also added one more parameter bounds and increased the number of parameters being optimized by 1 in "My_dadi_Run_Optimizations.py". This seems to work. Would this be the right approach? Please correct me if I am wrong. Thank you again for your time!

Upasana Dhakal


From: Daniel Portik notifications@github.com Sent: Monday, January 11, 2021 2:28 PM To: dportik/dadi_pipeline dadi_pipeline@noreply.github.com Cc: Upasana Dhakal upasanad@ksu.edu; Author author@noreply.github.com Subject: Re: [dportik/dadi_pipeline] does the pipeline incorporates correction for ancestral state misidentification? (#15)

Hello Upasana, The pipeline does not currently have the ability to correct misidentified ancestral states. You may wish to check on the dadi-user group for how to do this. I think there are a few posts on this topic. If you can find an answer and reply here with the solution, I can help you implement it in the code.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/dportik/dadi_pipeline/issues/15#issuecomment-758171654, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AP4OVKRWGHTYS3PK4LPYRLTSZNGN5ANCNFSM4VZRJTLQ.

upasana3 commented 3 years ago

This is the link to the discussion in the user group about correcting for ancestral state misidentification. https://groups.google.com/g/dadi-user/c/zMDg5uKvf_Y/m/QSEp83FBCQAJ


From: Upasana Dhakal upasanad@ksu.edu Sent: Monday, January 11, 2021 10:06 PM To: dportik/dadi_pipeline reply@reply.github.com Subject: Re: [dportik/dadi_pipeline] does the pipeline incorporates correction for ancestral state misidentification? (#15)

Hi Daniel,

Thank you for your response. The suggested way is to add one more parameter (p_misid) to the model using: func_anc = Numerics.make_anc_stat_misid_func(func) and optimizing p_misid with other parameters. This would require adding the upper and lower bounds for the added parameter (p_misid). I tried to incorporate this in the pipeline. I added "func_anc = Numerics.make_anc_stat_misid_func(func)" to Optimize.Functions.py (modified script is attached herewith). I also added one more parameter bounds and increased the number of parameters being optimized by 1 in "My_dadi_Run_Optimizations.py". This seems to work. Would this be the right approach? Please correct me if I am wrong. Thank you again for your time!

Upasana Dhakal


From: Daniel Portik notifications@github.com Sent: Monday, January 11, 2021 2:28 PM To: dportik/dadi_pipeline dadi_pipeline@noreply.github.com Cc: Upasana Dhakal upasanad@ksu.edu; Author author@noreply.github.com Subject: Re: [dportik/dadi_pipeline] does the pipeline incorporates correction for ancestral state misidentification? (#15)

Hello Upasana, The pipeline does not currently have the ability to correct misidentified ancestral states. You may wish to check on the dadi-user group for how to do this. I think there are a few posts on this topic. If you can find an answer and reply here with the solution, I can help you implement it in the code.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/dportik/dadi_pipeline/issues/15#issuecomment-758171654, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AP4OVKRWGHTYS3PK4LPYRLTSZNGN5ANCNFSM4VZRJTLQ.

dportik commented 3 years ago

Hi Upasana, This should do it, although I didn't see any modified scripts attached. Based on the code for Numerics.make_anc_stat_misid_func(), it appears that the last parameter in the parameters list will be the fraction misidentification. Thanks for taking the time to research this.