Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix citation columns misalignment #144

Merged
merged 3 commits into from
Nov 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 14 additions & 6 deletions AnnotatorCore.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,21 +661,25 @@ def processsv(svdata, outfile, previousoutfile, defaultCancerType, cancerTypeMap
outf.write("\t" + GENE_IN_ONCOKB_HEADER)
outf.write("\t" + VARIANT_IN_ONCOKB_HEADER)
outf.write("\tMUTATION_EFFECT")
outf.write("\tMUTATION_EFFECT_CITATIONS")
outf.write("\tONCOGENIC")
for l in levels:
outf.write('\t' + l)
outf.write("\tHIGHEST_LEVEL")
outf.write("\tCITATIONS")
outf.write("\tTX_CITATIONS")

for l in dxLevels:
outf.write('\t' + l)
outf.write("\tHIGHEST_DX_LEVEL")
outf.write("\tDX_CITATIONS")

for l in pxLevels:
outf.write('\t' + l)
outf.write("\tHIGHEST_PX_LEVEL\n")
outf.write("\tHIGHEST_PX_LEVEL")
outf.write("\tPX_CITATIONS")
outf.write("\n")

newcols = ncols + 8 + len(levels) + len(dxLevels) + len(pxLevels)
newcols = ncols + 11 + len(levels) + len(dxLevels) + len(pxLevels)

igene1 = geIndexOfHeader(headers, ['GENE1'])
igene2 = geIndexOfHeader(headers, ['GENE2'])
Expand Down Expand Up @@ -767,21 +771,25 @@ def processcnagisticdata(cnafile, outfile, previousoutfile, defaultCancerType, c
outf.write("\t"+GENE_IN_ONCOKB_HEADER)
outf.write("\t"+VARIANT_IN_ONCOKB_HEADER)
outf.write("\tMUTATION_EFFECT")
outf.write("\tMUTATION_EFFECT_CITATIONS")
outf.write("\tONCOGENIC")
for l in levels:
outf.write('\t' + l)
outf.write("\tHIGHEST_LEVEL")
outf.write("\tCITATIONS")
outf.write("\tTX_CITATIONS")

for l in dxLevels:
outf.write('\t' + l)
outf.write("\tHIGHEST_DX_LEVEL")
outf.write("\tDX_CITATIONS")

for l in pxLevels:
outf.write('\t' + l)
outf.write("\tHIGHEST_PX_LEVEL\n")
outf.write("\tHIGHEST_PX_LEVEL")
outf.write("\tPX_CITATIONS")
outf.write("\n")

ncols = 12 + len(levels) + len(dxLevels) + len(pxLevels)
ncols = 15 + len(levels) + len(dxLevels) + len(pxLevels)

i = 0
rows = []
Expand Down
5 changes: 2 additions & 3 deletions test_Annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,8 @@ def check_brca2_n3214i_without_cancertype(annotation):
assert annotation[MUTATION_EFFECT_INDEX] == 'Likely Loss-of-function'
assert annotation[ONCOGENIC_INDEX] == 'Likely Oncogenic'
assert annotation[HIGHEST_LEVEL_INDEX] == 'LEVEL_1'
assert annotation[LEVEL_1_INDEX] == 'Olaparib,Olaparib+Bevacizumab,Rucaparib,Niraparib'
assert annotation[LEVEL_2_INDEX] == 'Talazoparib,Olaparib'
assert annotation[LEVEL_3A_INDEX] == 'Rucaparib,Olaparib'
assert annotation[LEVEL_1_INDEX] == 'Olaparib,Rucaparib,Olaparib+Bevacizumab,Niraparib'
assert annotation[LEVEL_3A_INDEX] == 'Olaparib,Rucaparib,Talazoparib'

@pytest.mark.skipif(ONCOKB_API_TOKEN in (None, ''), reason="oncokb api token required")
def test_duplicated_treatments():
Expand Down