-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #535 from UW-GAC/feature/phenotype-inventory-workf…
…low-input Generate input for the phenotype inventory workflow
- Loading branch information
Showing
8 changed files
with
612 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Temporary script to create some test data. | ||
# Run with: python manage.py shell < add_phenotype_inventory_input_example_data.py | ||
|
||
from anvil_consortium_manager.tests.factories import ( | ||
ManagedGroupFactory, | ||
WorkspaceGroupSharingFactory, | ||
) | ||
|
||
from primed.cdsa.tests.factories import CDSAWorkspaceFactory | ||
from primed.dbgap.tests.factories import dbGaPWorkspaceFactory | ||
from primed.miscellaneous_workspaces.tests.factories import OpenAccessWorkspaceFactory | ||
from primed.primed_anvil.tests.factories import StudyFactory | ||
|
||
# Create a dbGaP workspace. | ||
fhs = StudyFactory.create(short_name="FHS", full_name="Framingham Heart Study") | ||
workspace_dbgap = dbGaPWorkspaceFactory.create( | ||
dbgap_study_accession__dbgap_phs=7, | ||
dbgap_study_accession__studies=[fhs], | ||
dbgap_version=33, | ||
dbgap_participant_set=12, | ||
dbgap_consent_code=1, | ||
dbgap_consent_abbreviation="HMB", | ||
workspace__name="DBGAP_FHS_v33_p12_HMB", | ||
) | ||
|
||
|
||
# Create a CDSA workspace. | ||
workspace_cdsa = CDSAWorkspaceFactory.create( | ||
study__short_name="MESA", | ||
workspace__name="CDSA_MESA_HMB", | ||
) | ||
|
||
# Create an open access workspace | ||
workspace_open_access = OpenAccessWorkspaceFactory.create( | ||
workspace__name="OPEN_ACCESS_FHS", | ||
) | ||
workspace_open_access.studies.add(fhs) | ||
|
||
|
||
# Share workspaces with PRIMED_ALL | ||
primed_all = ManagedGroupFactory.create(name="PRIMED_ALL") | ||
WorkspaceGroupSharingFactory.create( | ||
workspace=workspace_dbgap.workspace, group=primed_all | ||
) | ||
WorkspaceGroupSharingFactory.create( | ||
workspace=workspace_cdsa.workspace, group=primed_all | ||
) | ||
WorkspaceGroupSharingFactory.create( | ||
workspace=workspace_open_access.workspace, group=primed_all | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.