Skip to content

Commit

Permalink
changed name of columns that were being searched in filtered.maf inpu…
Browse files Browse the repository at this point in the history
…t file for tag_by_variant_classification.
  • Loading branch information
rnaidu committed Sep 26, 2024
1 parent e807105 commit 2d06597
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions postprocessing_variant_calls/maf/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,12 +727,12 @@ def tag_traceback(self, cols, tagging):

def tag_by_variant_classification(self, output_dir, ref_lst):
maf = add_dummy_columns(self.data_frame, MAF_DUMMY_COLUMNS)

# start tagging the input MAF with the 5 categories

def is_exonic_or_silent(row, ref_lst):
exonic_result = IS_EXONIC_CLASS(
row.Hugo_Symbol, row.Variant_Classification, row.vcf_pos
row.Hugo_Symbol, row.Variant_Classification, row.Start_Position
)
if exonic_result:
if row.Transcript_ID in ref_lst:
Expand Down
8 changes: 4 additions & 4 deletions postprocessing_variant_calls/maf/tag/tag_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,13 +525,13 @@
# ("Start_Position", "Start"),
# ("Reference_Allele", "Ref"),
# ("Tumor_Seq_Allele2", "Alt"),
("vcf_pos", "Start"),
("VCF_REF", "Ref"),
("VCF_ALT", "Alt"),
("Start_Position", "Start_Position"),
("Reference_Allele", "Reference_Allele"),
("Tumor_Seq_Allele2", "Tumor_Seq_Allele2"),
("Variant_Classification", "VariantClass"),
("Hugo_Symbol", "Gene"),
("Call_Confidence", "Call_Confidence"),
("EXON", "Exon"),
("Exon_Number", "Exon_Number"),
("Transcript_ID", "TranscriptID"),
("Comments", "Comments"),
("HGVSc", "cDNAchange"),
Expand Down
10 changes: 5 additions & 5 deletions postprocessing_variant_calls/maf/tag/tag_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,6 @@ def format_var(variant):
columns = map(lambda x: getattr(variant, x), MAF_TSV_COL_MAP.keys())
return "\t".join(map(str, columns)) + "\n"
except AttributeError:
return
missing_columns = set(MAF_TSV_COL_MAP.keys()) - set(
filter(lambda x: not x.startswith("_"), dir(variant))
)
Expand Down Expand Up @@ -413,7 +412,7 @@ def reformat_tx(txID, tx_df):

# start tagging by variant classification process
final_maf = mafa.tag_by_variant_classification(output_dir, tx_isoform_lst)

# Create exonic, silent, and nonpanel files.
file_names = [
EXONIC_FILTERED,
Expand All @@ -438,13 +437,13 @@ def reformat_tx(txID, tx_df):

# Reformat the row
formatted_variant = format_var(variant)

# Determine which file(s) to write to based on the tag
if "exonic" in tag:
variant_tuple = (
variant.Hugo_Symbol,
variant.Variant_Classification,
variant.vcf_pos,
variant.Start_Position,
)
transcript_id = reformat_tx(variant.Transcript_ID, tx_df)

Expand All @@ -456,13 +455,14 @@ def reformat_tx(txID, tx_df):
Chromosome=variant.Chromosome,
Variant_Classification=variant_tuple[1], # VariantClass
Variant_Type=variant.Variant_Type,
vcf_pos=variant_tuple[2], # Start coordinate
Start_Position=variant_tuple[2], # Start coordinate
Tumor_Sample_Barcode=variant.Tumor_Sample_Barcode,
caller_Norm_Sample_Barcode=variant.caller_Norm_Sample_Barcode,
Transcript_ID=transcript_id, # TranscriptID
)
formatted_exonic_variant_row = format_var(variant)
files[0].write(formatted_exonic_variant_row)

if "silent" in tag:
files[1].write(formatted_variant)
if "nonpanel_exonic" in tag:
Expand Down

0 comments on commit 2d06597

Please sign in to comment.