Skip to content

Commit

Permalink
Remove for check for valid alleles - this is now done later to includ…
Browse files Browse the repository at this point in the history
…e also user-provided ones
  • Loading branch information
riasc committed Feb 27, 2024
1 parent e44668b commit fe10948
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions workflow/scripts/combine_optitype_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@
def main():
alleles = []

# load alleles
allele_list = load_alleles('workflow/scripts/valid_alleles/netmhcpan.txt')

#print(allele_list)

for alfile in sys.argv[1].split(' '):
with open(alfile, 'r') as f:
next(f)
Expand All @@ -21,25 +16,21 @@ def main():
for i in range(1,7):
# modify header
modname = 'HLA-' + line_list[i]
if modname in allele_list:
if modname not in alleles:
alleles.append(modname)
if modname not in alleles:
alleles.append(modname)
# remove duplicates
alleles = list(set(alleles))


output = open(sys.argv[2], 'w')
for i in alleles:
output.write(i + '\n')
output.close()


def load_alleles(alleles_file):
alleles = []
with open(alleles_file, 'r') as f:
for line in f:
alleles.append(line.rstrip())
return alleles


main()

0 comments on commit fe10948

Please sign in to comment.