xavierdidelot / TransPhylo

Reconstruction of transmission trees using genomic data
http://xavierdidelot.github.io/TransPhylo/
GNU General Public License v2.0
60 stars 22 forks source link

Generation time first to Sampling time? #26

Closed dpenas-u closed 1 year ago

dpenas-u commented 1 year ago

Hello,

I am working with the TransPhylo program to infer transmission in some real TB clusters. When running the inference, it is necessary to set up a gamma distribution for the generation time (the delay from infection to transmission) and for the sampling time (the delay from infection to sampling). I have been wondering whether the sampling time is added to the generation time or not.

From the definition of both parameters, I understand that both start from the same time (the time at which an individual is infected) and, therefore, it might be better to establish a sampling distribution that is shifted X time to the right with respect to the generation time. I assume that one individual is more likely to infect another before they are detected and sampled. However, once an individual is identified, they are either treated or isolated, which greatly reduces their probability of infecting another individual.

It would be very helpful if you could clarify this question.

Thank you very much in advance and sorry for any inconvenience.

xavierdidelot commented 1 year ago

No, the sampling time is not added to the generation time. So for example if you set the two distributions to be the same (which is what happens by default) then transmission is equally likely to happen before or after sampling. There are some situations where we would want this behaviour. If you want transmission to be more likely to happen before sampling for your TB analysis, you can make this happen by setting the sampling distribution to have a higher mean than the generation time distribution. If you wanted to have the sampling time be added to the generation time, there would need to be changes to the code.