-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
register missing combiner analysis script
- Loading branch information
1 parent
5c83cd8
commit db26cab
Showing
1 changed file
with
31 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from argparse import ArgumentParser | ||
|
||
from hail.vds import read_vds | ||
|
||
from cpg_utils import to_path | ||
from metamist.apis import AnalysisApi | ||
from metamist.models import Analysis, AnalysisStatus | ||
|
||
|
||
def get_sg_ids(vds: str) -> list[str]: | ||
return read_vds(to_path(vds)).variant_data.s.collect() | ||
|
||
|
||
def main(vds: str, dataset: str): | ||
aapi = AnalysisApi() | ||
am = Analysis( | ||
type='combiner', | ||
output=vds, | ||
status=AnalysisStatus('completed'), | ||
sequencing_group_ids=get_sg_ids(vds), | ||
meta=None, | ||
) | ||
aapi.create_analysis(project=dataset, analysis=am) | ||
|
||
|
||
if __name__ == '__main__': | ||
parser = ArgumentParser() | ||
parser.add_argument('--vds', help='VDS to register analysis for.') | ||
parser.add_argument('--dataset', help='Dataset to register analysis in.') | ||
args = parser.parse_args() | ||
main(args.vds, args.dataset) |