psathyrella / partis

B- and T-cell receptor sequence annotation, simulation, clonal family and germline inference, and affinity prediction
GNU General Public License v3.0
54 stars 36 forks source link

Simulating with user-defined parameters #305

Closed aeonsofmusic closed 3 years ago

aeonsofmusic commented 4 years ago

Hello,

I need to run a simulation with user-defined rearrangement and/or SHM parameters. I've gone through the CSVs in the hmm/ subdirectory of my parameter directory, and vaguely know what each CSV is for. However, I'm not quite sure how I am to generate a CSV that is readable for partis without having to pull parameters from a past partition/annotate command. Do you have any suggestions as to how I should manually create these parameter CSVs?

psathyrella commented 4 years ago

Yeah I think there are way too many parameters necessary to specify the families in a repertoire to make it very realistic to make the files from scratch by hand. If you have run partition or annotate in the past on the sample that you want the simulation to mimic, then the parameter dir was definitely created and persisted, so unless it was deleted by hand afterward you'd just need to pass that parameter dir to the simulation (if you didn't set --parameter-dir and partis used a default, the location will have been printed to std out). Since you describe that as "having to pull", perhaps they were deleted, in which case if you have a sample that you want the simulation to mimic, by far the easiest thing is to rerun cache-parameters (or annotate or partition, which run cache-parameters first automatically). If the sample is very large and will take longer to run than you want to wait, just set --n-random-queries to something at least of the order of tens of thousands, the parameter inference doesn't change much after that.

If you want to adjust simulation parameters by hand, there are a very large number of options for doing so, many of them described here, but again there's no practical way to adjust all parameters by hand in order to mimic a particular sample -- that's what parameter caching is for.

aeonsofmusic commented 4 years ago

Hello,

Thanks for your reply. I figured that I'd have to use the previously cached parameters to some extent while manually setting the SHM parameters using subcommands. My parameters have not been deleted, was just wondering if I could write parameters manually.

Again, thanks for the help!