Atkinson-Lab / Tractor

Scripts for implementing the Tractor pipeline
MIT License
44 stars 5 forks source link

Inclusion of stderr and other possible enhancements #34

Closed kscott-1 closed 4 months ago

kscott-1 commented 4 months ago

Hi again, I am currently running some Tractor analysis and have the need to compile multiple cohorts from separate Tractor runs and meta analyze the results. To do that, we need standard error in the output files in addition to the BETA & P columns. The way your code is written, it extracts these values from the coefficient matrix of each glm (through the matrix helper function). It only keeps BETA & P, however, standard error & z score are also values in that matrix. Z score may not be important, but standard error should be reported. The changes are minimal to allow for this, but it would change the output files by default for everyone. I would say it should be that way, but maybe not what you want. With more of a script overhaul, BETA/SE/P could become a parameter for the user to specify. After all, there are also cases where users may exclusively care about effect size and not P due to low sample size or something.

One other enhancement I would recommend is to allow the user to specify the number of decimals to round to. The script prints out to 6 decimals, but some users may want less. This is an easy change using an optional flag and the default set to 6 so that nothing changes for indifferent user. Edit: After second thought, P will always need to report as many decimals as possible, so this option could be confusing & probably not worth it since it would apply to non P cols only.

I may open a PR soon for the SE & rounding issues since I am already writing those for my own use case, but feel free to comment any thoughts.

Best - Kyle