Skip to content

Commit

Permalink
register missing combiner analysis script
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander-Stuckey committed Nov 4, 2024
1 parent 5c83cd8 commit db26cab
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions scripts/register_migging_combiner_analysis.py
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)

0 comments on commit db26cab

Please sign in to comment.