Skip to content

Commit

Permalink
Bug fixes for t1dgrs2 v2 pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
ngaddis committed Sep 20, 2024
1 parent 003180b commit d210a12
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@
"default": "",
"required": true
},
"gvcf": {
"type": "file",
"sample_id": {
"type": "str",
"default": "",
"required": true
},
"variant_list": {
"gvcf": {
"type": "file",
"default": "",
"required": true
},
"sample_id": {
"type": "str",
"variant_list": {
"type": "file",
"default": "",
"required": true
},
Expand Down Expand Up @@ -69,14 +69,14 @@
"output_dir": "<inputs.output_dir>extract_gvcf_variants",
"sample_id": "<inputs.sample_id>",
"gvcf": "<inputs.gvcf>",
"out_prefix": "<inputs.output_dir>extract_gvcf_variants/<inputs.sample_id>",
"variant_list": "<inputs.variant_list>",
"hla_variants_file": "<inputs.hla_variants_file>",
"non_hla_variants_file": "<inputs.non_hla_variants_file>",
"out_prefix": "<inputs.output_dir>extract_gvcf_variants/<inputs.sample_id>",
"pass_only": "<inputs.pass_only>",
"filter_by_gq": "<inputs.filter_by_gq>",
"hom_gq_threshold": "<inputs.hom_gq_threshold>",
"het_gq_threshold": "<inputs.het_gq_threshold>",
"hla_variants_file": "<inputs.hla_variants_file>",
"non_hla_variants_file": "<inputs.non_hla_variants_file>"
"het_gq_threshold": "<inputs.het_gq_threshold>"
},
"pipeline": {
"extract_gvcf_variants": {
Expand Down
24 changes: 15 additions & 9 deletions t1dgrs2_pipeline/v2.0/pipeline_config/t1dgrs2_tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"--target_dir",
"<inputs.target_dir>",
"--manifest_dir",
"<inputs.rti_manifest_dir>",
"<inputs.manifest_dir>",
"--downloaded_samples",
"<inputs.downloaded_samples>",
"--download_limit",
Expand Down Expand Up @@ -136,6 +136,12 @@
"variant_list": {
"type": "file"
},
"hla_variants_file": {
"type": "file"
},
"non_hla_variants_file": {
"type": "file"
},
"out_prefix": {
"type": "str"
},
Expand All @@ -154,22 +160,22 @@
"het_gq_threshold": {
"type": "int",
"default": 48
},
"hla_variants_file": {
"type": "file"
},
"non_hla_variants_file": {
"type": "file"
}
},
"cmd": [
"/opt/extract_gvcf_variants.pl",
"--sample_id",
"<inputs.sample_id>",
"--gvcf",
"<inputs.gvcf>",
"--out_prefix",
"<inputs.out_prefix>",
"--variant_list",
"<inputs.variant_list>",
"--hla_variants_file",
"<inputs.hla_variants_file>",
"--non_hla_variants_file",
"<inputs.non_hla_variants_file>",
"--out_prefix",
"<inputs.out_prefix>",
"--pass_only",
"<inputs.pass_only>",
"--filter_by_gq",
Expand Down
52 changes: 47 additions & 5 deletions t1dgrs2_pipeline/v2.0/scripts/batch_extract_gvcf_variants.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@
help = 'List of variants to extract',
type = str
)
parser.add_argument(
'--hla_variants_file',
required = True,
help = 'File listing HLA variants used for DQ imputation',
type = str
)
parser.add_argument(
'--non_hla_variants_file',
required = True,
help = 'File listing HLA variants not used for DQ imputation',
type = str
)
parser.add_argument(
'--argo_api_url',
required = False,
Expand All @@ -44,6 +56,34 @@
default = 50,
type = int
)
parser.add_argument(
'--pass_only',
required = False,
help = 'Limit extraction to variants designated PASS',
default = 0,
type = int
)
parser.add_argument(
'--filter_by_gq',
required = False,
help = 'Filter variatns by GQ',
default = 0,
type = int
)
parser.add_argument(
'--hom_gq_threshold',
required = False,
help = 'GQ threshold for homozygous variants',
default = 99,
type = int
)
parser.add_argument(
'--het_gq_threshold',
required = False,
help = 'GQ threshold for heterozygous variants',
default = 48,
type = int
)
args = parser.parse_args()

# Function to get the number of running workflows
Expand Down Expand Up @@ -100,13 +140,15 @@ def get_running_workflows():
wf_arguments = {
"working_dir": sample_working_dir,
"output_dir": sample_output_dir,
"sample_id": file_id,
"gvcf": path,
"variant_list": args.variant_list,
"sample_id": file_id,
"pass_only": 0,
"filter_by_gq": 0,
"hom_gq_threshold": 99,
"het_gq_threshold": 48
"hla_variants_file": args.hla_variants_file,
"non_hla_variants_file": args.non_hla_variants_file,
"pass_only": args.pass_only,
"filter_by_gq": args.filter_by_gq,
"hom_gq_threshold": args.hom_gq_threshold,
"het_gq_threshold": args.het_gq_threshold
}
file_wf_arguments = working_dir + file_id + '.json'
with open(file_wf_arguments, 'w', encoding='utf-8') as f:
Expand Down
10 changes: 6 additions & 4 deletions t1dgrs2_pipeline/v2.0/scripts/extract_gvcf_variants.pl
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@

my $sample_id = '';
my $gvcf = '';
my $out_prefix;
my $variant_list = '';
my $hla_variants_file = '';
my $non_hla_variants_file = '';
my $out_prefix;
my $pass_only = 0;
my $filter_by_gq = 0;
my $hom_gq_threshold = 99;
Expand All @@ -23,14 +25,14 @@
GetOptions (
'sample_id=s' => \$sample_id,
'gvcf=s' => \$gvcf,
'out_prefix=s' => \$out_prefix,
'variant_list=s' => \$variant_list,
'hla_variants_file' => \$hla_variants_file,
'non_hla_variants_file' => \$non_hla_variants_file
'out_prefix=s' => \$out_prefix,
'pass_only:i' => \$pass_only,
'filter_by_gq:i' => \$filter_by_gq,
'hom_gq_threshold:i' => \$hom_gq_threshold,
'het_gq_threshold:i' => \$het_gq_threshold,
'hla_variants_file' => \$hla_variants_file,
'non_hla_variants_file' => \$non_hla_variants_file
) or die("Invalid options");

sub flip {
Expand Down

0 comments on commit d210a12

Please sign in to comment.