download_from_synapse

ukbppp_dl.common.download_from_synapse(synapse_id: str, download_location: str = './ukb_ppp_dl/data', login_kwargs: dict[str, Any] = {}, verbose: bool = False) tuple[str, bool]

Download a Synapse file unless it already exists locally.

Parameters:
  • synapse_id (str) – Synapse entity ID for the file to download.

  • download_location (str, default="./ukb_ppp_dl/data") – Directory where the file should be stored. Typical values are local project data folders.

  • login_kwargs (Dict[str, Any], optional) –

    Keyword arguments forwarded to synapseclient.Synapse.login(). Common keys include "authToken" (str), "email" (str) and "profile" (str). See synapseclient.Synapse.login() for more information.

    Alternatively, you can configure your Synapse credentials in a .synapseConfig file and leave this argument empty to use the default login behaviour. You can find more information about .synapseConfig in the Synapse documentation.

  • verbose (bool, default=False) – Whether to print status messages about login and download decisions.

Returns:

A tuple containing the expected or downloaded file path and a boolean flag indicating whether the download was skipped because the file already existed.

Return type:

tuple[str, bool]