forked from google/deepvariant
-
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.
Automated g4 rollback of changelist 564884573
PiperOrigin-RevId: 565106180
- Loading branch information
1 parent
5b54841
commit 3f35db0
Showing
3 changed files
with
71 additions
and
88 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
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 |
---|---|---|
|
@@ -51,14 +51,19 @@ def test_basic_commands(self, model_type, use_keras_model): | |
FLAGS.ref = 'your_ref' | ||
FLAGS.reads_tumor = 'your_tumor_bam' | ||
FLAGS.reads_normal = 'your_normal_bam' | ||
FLAGS.output_somatic_vcf = 'your_somatic_vcf' | ||
FLAGS.output_non_somatic_vcf = 'your_non_somatic_vcf' | ||
FLAGS.output_vcf = 'your_vcf' | ||
FLAGS.output_gvcf = 'your_gvcf' | ||
FLAGS.num_shards = 64 | ||
FLAGS.customized_model = '/opt/models/wgs/model.ckpt' | ||
FLAGS.use_keras_model = use_keras_model | ||
commands = run_deepsomatic.create_all_commands_and_logfiles( | ||
'/tmp/deepsomatic_tmp_output', used_in_test=True | ||
) | ||
|
||
extra_args_plus_gvcf = ( | ||
'--gvcf "/tmp/deepsomatic_tmp_output/[email protected]"' | ||
) | ||
|
||
self.assertEqual( | ||
commands[0][0], | ||
'time seq 0 63 | parallel -q --halt 2 --line-buffer' | ||
|
@@ -67,10 +72,11 @@ def test_basic_commands(self, model_type, use_keras_model): | |
' "your_normal_bam" --examples' | ||
' "/tmp/deepsomatic_tmp_output/[email protected]"' | ||
' --channels "insert_size"' | ||
' %s' | ||
' --vsc_max_fraction_indels_for_non_target_sample "0.5"' | ||
' --vsc_max_fraction_snps_for_non_target_sample "0.5"' | ||
' --vsc_min_fraction_indels "0.05" --vsc_min_fraction_snps "0.029"' | ||
' --task {}', | ||
' --task {}' % (extra_args_plus_gvcf), | ||
) | ||
call_variants_bin = ( | ||
'call_variants_keras' if use_keras_model else 'call_variants' | ||
|
@@ -92,8 +98,10 @@ def test_basic_commands(self, model_type, use_keras_model): | |
'--ref "your_ref" ' | ||
'--infile ' | ||
'"/tmp/deepsomatic_tmp_output/call_variants_output.tfrecord.gz" ' | ||
'--outfile "your_non_somatic_vcf" ' | ||
'--somatic_variants_path "your_somatic_vcf"' | ||
'--outfile "your_vcf" ' | ||
'--gvcf_outfile "your_gvcf" ' | ||
'--nonvariant_site_tfrecord_path ' | ||
'"/tmp/deepsomatic_tmp_output/[email protected]"' | ||
), | ||
) | ||
|
||
|
@@ -107,8 +115,8 @@ def test_sample_name_command(self, sample_name_tumor, sample_name_normal): | |
FLAGS.ref = 'your_ref' | ||
FLAGS.reads_tumor = 'your_tumor_bam' | ||
FLAGS.reads_normal = 'your_normal_bam' | ||
FLAGS.output_somatic_vcf = 'your_somatic_vcf' | ||
FLAGS.output_non_somatic_vcf = 'your_non_somatic_vcf' | ||
FLAGS.output_vcf = 'your_vcf' | ||
FLAGS.output_gvcf = None | ||
FLAGS.num_shards = 64 | ||
FLAGS.regions = None | ||
FLAGS.sample_name_tumor = sample_name_tumor | ||
|
@@ -158,8 +166,7 @@ def test_sample_name_command(self, sample_name_tumor, sample_name_normal): | |
'--ref "your_ref" ' | ||
'--infile ' | ||
'"/tmp/deepsomatic_tmp_output/call_variants_output.tfrecord.gz" ' | ||
'--outfile "your_non_somatic_vcf" ' | ||
'--somatic_variants_path "your_somatic_vcf"', | ||
'--outfile "your_vcf"' | ||
) | ||
|
||
@parameterized.parameters( | ||
|
@@ -184,8 +191,8 @@ def test_make_examples_extra_args_boolean( | |
FLAGS.ref = 'your_ref' | ||
FLAGS.reads_tumor = 'your_tumor_bam' | ||
FLAGS.reads_normal = 'your_normal_bam' | ||
FLAGS.output_somatic_vcf = 'your_somatic_vcf' | ||
FLAGS.output_non_somatic_vcf = 'your_non_somatic_vcf' | ||
FLAGS.output_vcf = 'your_vcf' | ||
FLAGS.output_gvcf = 'your_gvcf' | ||
FLAGS.num_shards = 64 | ||
FLAGS.make_examples_extra_args = make_examples_extra_args | ||
FLAGS.customized_model = '/opt/models/wgs/model.ckpt' | ||
|
@@ -200,7 +207,8 @@ def test_make_examples_extra_args_boolean( | |
' "your_normal_bam" --examples' | ||
' "/tmp/deepsomatic_tmp_output/[email protected]"' | ||
' --channels "insert_size"' | ||
' %s' | ||
' --gvcf' | ||
' "/tmp/deepsomatic_tmp_output/[email protected]" %s' | ||
' --vsc_max_fraction_indels_for_non_target_sample "0.5"' | ||
' --vsc_max_fraction_snps_for_non_target_sample "0.5"' | ||
' --vsc_min_fraction_indels "0.05" --vsc_min_fraction_snps "0.029"' | ||
|
@@ -213,26 +221,30 @@ def test_logging_dir(self): | |
FLAGS.ref = 'your_ref' | ||
FLAGS.reads_tumor = 'your_tumor_bam' | ||
FLAGS.reads_normal = 'your_normal_bam' | ||
FLAGS.output_somatic_vcf = 'your_somatic_vcf' | ||
FLAGS.output_non_somatic_vcf = 'your_non_somatic_vcf' | ||
FLAGS.output_vcf = 'your_vcf' | ||
FLAGS.output_gvcf = 'your_gvcf' | ||
FLAGS.num_shards = 64 | ||
FLAGS.logging_dir = '/tmp/deepsomatic_tmp_output/LOGDIR' | ||
FLAGS.customized_model = '/opt/models/wgs/model.ckpt' | ||
commands = run_deepsomatic.create_all_commands_and_logfiles( | ||
'/tmp/deepsomatic_tmp_output', used_in_test=True | ||
) | ||
|
||
self.assertEqual( | ||
commands[0][0], | ||
'time seq 0 63 | parallel -q --halt 2 --line-buffer' | ||
' /opt/deepvariant/bin/make_examples_somatic --mode calling' | ||
' --ref "your_ref" --reads_tumor "your_tumor_bam"' | ||
' --reads_normal "your_normal_bam" --examples' | ||
' "/tmp/deepsomatic_tmp_output/[email protected]"' | ||
' --channels "insert_size"' | ||
' --vsc_max_fraction_indels_for_non_target_sample "0.5"' | ||
' --vsc_max_fraction_snps_for_non_target_sample "0.5"' | ||
' --vsc_min_fraction_indels "0.05" --vsc_min_fraction_snps "0.029"' | ||
' --task {}', | ||
( | ||
'time seq 0 63 | parallel -q --halt 2 --line-buffer' | ||
' /opt/deepvariant/bin/make_examples_somatic --mode calling --ref' | ||
' "your_ref" --reads_tumor "your_tumor_bam" --reads_normal' | ||
' "your_normal_bam" --examples' | ||
' "/tmp/deepsomatic_tmp_output/[email protected]"' | ||
' --channels "insert_size" --gvcf' | ||
' "/tmp/deepsomatic_tmp_output/[email protected]"' | ||
' --vsc_max_fraction_indels_for_non_target_sample "0.5"' | ||
' --vsc_max_fraction_snps_for_non_target_sample "0.5"' | ||
' --vsc_min_fraction_indels "0.05" --vsc_min_fraction_snps "0.029"' | ||
' --task {}' | ||
), | ||
) | ||
|
||
@parameterized.parameters( | ||
|
@@ -246,8 +258,8 @@ def test_make_examples_regions(self, regions, expected_args): | |
FLAGS.ref = 'your_ref' | ||
FLAGS.reads_tumor = 'your_tumor_bam' | ||
FLAGS.reads_normal = 'your_normal_bam' | ||
FLAGS.output_somatic_vcf = 'your_somatic_vcf' | ||
FLAGS.output_non_somatic_vcf = 'your_non_somatic_vcf' | ||
FLAGS.output_vcf = 'your_vcf' | ||
FLAGS.output_gvcf = 'your_gvcf' | ||
FLAGS.num_shards = 64 | ||
FLAGS.regions = regions | ||
FLAGS.customized_model = '/opt/models/wgs/model.ckpt' | ||
|
@@ -263,7 +275,8 @@ def test_make_examples_regions(self, regions, expected_args): | |
' "your_normal_bam" --examples' | ||
' "/tmp/deepsomatic_tmp_output/[email protected]"' | ||
' --channels "insert_size"' | ||
' %s' | ||
' --gvcf' | ||
' "/tmp/deepsomatic_tmp_output/[email protected]" %s' | ||
' --vsc_max_fraction_indels_for_non_target_sample "0.5"' | ||
' --vsc_max_fraction_snps_for_non_target_sample "0.5"' | ||
' --vsc_min_fraction_indels "0.05" --vsc_min_fraction_snps "0.029"' | ||
|
@@ -278,8 +291,8 @@ def test_make_examples_extra_args_invalid(self): | |
FLAGS.ref = 'your_ref' | ||
FLAGS.reads_tumor = 'your_tumor_bam' | ||
FLAGS.reads_normal = 'your_normal_bam' | ||
FLAGS.output_somatic_vcf = 'your_somatic_vcf' | ||
FLAGS.output_non_somatic_vcf = 'your_non_somatic_vcf' | ||
FLAGS.output_vcf = 'your_vcf' | ||
FLAGS.output_gvcf = 'your_gvcf' | ||
FLAGS.num_shards = 64 | ||
FLAGS.make_examples_extra_args = 'keep_secondary_alignments' | ||
FLAGS.customized_model = '/opt/models/wgs/model.ckpt' | ||
|
@@ -309,8 +322,8 @@ def test_call_variants_extra_args( | |
FLAGS.ref = 'your_ref' | ||
FLAGS.reads_tumor = 'your_tumor_bam' | ||
FLAGS.reads_normal = 'your_normal_bam' | ||
FLAGS.output_somatic_vcf = 'your_somatic_vcf' | ||
FLAGS.output_non_somatic_vcf = 'your_non_somatic_vcf' | ||
FLAGS.output_vcf = 'your_vcf' | ||
FLAGS.output_gvcf = 'your_gvcf' | ||
FLAGS.num_shards = 64 | ||
FLAGS.call_variants_extra_args = call_variants_extra_args | ||
FLAGS.customized_model = '/opt/models/wgs/model.ckpt' | ||
|
@@ -338,8 +351,8 @@ def test_postprocess_variants_extra_args( | |
FLAGS.ref = 'your_ref' | ||
FLAGS.reads_tumor = 'your_tumor_bam' | ||
FLAGS.reads_normal = 'your_normal_bam' | ||
FLAGS.output_somatic_vcf = 'your_somatic_vcf' | ||
FLAGS.output_non_somatic_vcf = 'your_non_somatic_vcf' | ||
FLAGS.output_vcf = 'your_vcf' | ||
FLAGS.output_gvcf = 'your_gvcf' | ||
FLAGS.num_shards = 64 | ||
FLAGS.postprocess_variants_extra_args = postprocess_variants_extra_args | ||
FLAGS.customized_model = '/opt/models/wgs/model.ckpt' | ||
|
@@ -353,8 +366,10 @@ def test_postprocess_variants_extra_args( | |
'--ref "your_ref" ' | ||
'--infile ' | ||
'"/tmp/deepsomatic_tmp_output/call_variants_output.tfrecord.gz" ' | ||
'--outfile "your_non_somatic_vcf" ' | ||
'--somatic_variants_path "your_somatic_vcf" ' | ||
'--outfile "your_vcf" ' | ||
'--gvcf_outfile "your_gvcf" ' | ||
'--nonvariant_site_tfrecord_path ' | ||
'"/tmp/deepsomatic_tmp_output/[email protected]" ' | ||
'%s' % expected_args, | ||
) | ||
|
||
|