Skip to content

Commit 5251f7e

Browse files
authored
Merge pull request #42 from NCI-GDC/feat/tumor-only
Feat/tumor only
2 parents 5968888 + 4e6d104 commit 5251f7e

File tree

4 files changed

+28
-12
lines changed

4 files changed

+28
-12
lines changed

aliquotmaf/filters/normal_depth.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,19 @@ def __init__(self, cutoff):
1111
super().__init__(name="NormalDepth")
1212
self.tags = ["ndp"]
1313
self.cutoff = cutoff
14-
self.logger.info("Using normal depth cutoff of {0}".format(cutoff))
14+
if cutoff is not None:
15+
self.logger.info("Using normal depth cutoff of {0}".format(cutoff))
16+
else:
17+
self.logger.info("Normal depth cutoff not in use")
1518

1619
@classmethod
1720
def setup(cls, cutoff):
1821
curr = cls(cutoff)
1922
return curr
2023

2124
def filter(self, maf_record):
25+
if self.cutoff is None:
26+
return False
2227
ndp = maf_record["n_depth"].value
2328
return ndp is not None and ndp <= self.cutoff
2429

aliquotmaf/merging/record_merger/impl/v1_0.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,12 @@ def maf_from_first_element(
184184
selected_caller = results[caller][0]
185185
break
186186

187+
# iterate over columns as defined by schema
187188
for column in self.columns:
188189
if column in self.allele_columns() or column == "callers":
189190
continue
190191

192+
# do something special with depth columns
191193
elif column in self.average_columns(tumor_only=tumor_only):
192194
vals = []
193195
for caller in callers:

aliquotmaf/subcommands/merge_aliquot/runners/gdc_1_0_0_aliquot_merged.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ def __add_arguments__(cls, parser):
6565
"--gatk4-mutect2-pair",
6666
help="Path to input protected GATK4 MuTect2 Pair MAF file",
6767
)
68+
parser.add_argument(
69+
"--gatk4-mutect2", help="Path to input protected GATK4 MuTect2 MAF file"
70+
)
6871

6972
def load_readers(self):
7073
"""
@@ -81,6 +84,7 @@ def load_readers(self):
8184
"caveman",
8285
"sanger_pindel",
8386
"gatk4_mutect2_pair",
87+
"gatk4_mutect2",
8488
]
8589

8690
for maf_key in maf_keys:
@@ -148,15 +152,18 @@ def do_work(self):
148152
peekable_iterator_class=FilteringPeekableIterator,
149153
)
150154

151-
# ndp filter
152-
ndp_filter = Filters.NormalDepth.setup(self.options["min_n_depth"])
155+
# Set up Normal Depth Filter for tumor-only or tumor-normal operation
156+
if self.options['tumor_only']:
157+
ndp_filter = Filters.NormalDepth.setup(None)
158+
else:
159+
ndp_filter = Filters.NormalDepth.setup(self.options["min_n_depth"])
153160
ndp_tag = ndp_filter.tags[0]
154161

155162
# Counts
156163
processed = 0
157164
try:
158165
for record in o_iter:
159-
166+
# progress update
160167
if processed > 0 and processed % 1000 == 0:
161168
self.logger.info(
162169
"Processed {0} overlapping intervals...".format(processed)

aliquotmaf/subcommands/vcf_to_aliquot/extractors/effects.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -296,14 +296,16 @@ def extract(
296296
effect["Exon_Number"] = effect["EXON"]
297297
effect["Hugo_Symbol"] = effect["SYMBOL"]
298298
effect["TRANSCRIPT_STRAND"] = effect["STRAND"]
299-
effect["1000G_AF"] = effect["AF"]
300-
effect["1000G_AFR_AF"] = effect["AFR_AF"]
301-
effect["1000G_AMR_AF"] = effect["AMR_AF"]
302-
effect["1000G_EAS_AF"] = effect["EAS_AF"]
303-
effect["1000G_EUR_AF"] = effect["EUR_AF"]
304-
effect["1000G_SAS_AF"] = effect["SAS_AF"]
305-
effect["ESP_AA_AF"] = effect["AA_AF"]
306-
effect["ESP_EA_AF"] = effect["EA_AF"]
299+
300+
# these don't exist in Tumor-only
301+
effect["1000G_AF"] = effect.get("AF", None)
302+
effect["1000G_AFR_AF"] = effect.get("AFR_AF", None)
303+
effect["1000G_AMR_AF"] = effect.get("AMR_AF", None)
304+
effect["1000G_EAS_AF"] = effect.get("EAS_AF", None)
305+
effect["1000G_EUR_AF"] = effect.get("EUR_AF", None)
306+
effect["1000G_SAS_AF"] = effect.get("SAS_AF", None)
307+
effect["ESP_AA_AF"] = effect.get("AA_AF", None)
308+
effect["ESP_EA_AF"] = effect.get("EA_AF", None)
307309

308310
# If VEP couldn't find this variant in dbSNP/etc., we'll say it's "novel"
309311
if effect["Existing_variation"]:

0 commit comments

Comments
 (0)