Skip to content

Commit

Permalink
Merge pull request #211 from alina-bauer/dev
Browse files Browse the repository at this point in the history
Allele data can also be used via internet link in sample sheet
  • Loading branch information
jonasscheid authored Aug 31, 2023
2 parents 50812f9 + 89259c6 commit 6700180
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
8 changes: 7 additions & 1 deletion bin/check_requested_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import csv
import argparse
import logging
import urllib.request

from epytope.Core.Allele import Allele
from epytope.Core.Peptide import Peptide
Expand Down Expand Up @@ -74,7 +75,12 @@ def __main__():
}

# get the alleles
alleles = [Allele(a) for a in args.alleles.split(";")]
if args.alleles.startswith("http"):
alleles = [Allele(a) for a in urllib.request.urlopen(args.alleles).read().decode("utf-8").splitlines()]
elif args.alleles.endswith(".txt"):
alleles = [Allele(a) for a in open(args.alleles, "r").read().splitlines()]
else:
alleles = [Allele(a) for a in args.alleles.split(";")]

peptide_lengths = []
if args.peptides:
Expand Down
2 changes: 1 addition & 1 deletion bin/check_samplesheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def check_samplesheet(file_in, file_out):
out_dir = os.path.dirname(file_out)
make_dir(out_dir)
with open(file_out, "w") as fout:
valid_header.append("file_type")
valid_header.append("inputtype")
fout.write(",".join(valid_header) + "\n")
for row in rows:
fout.write(",".join(row) + "\n")
Expand Down
9 changes: 7 additions & 2 deletions bin/epaa.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import epytope.Core.Generator as generator
import math
import json
import urllib.request

from epytope.IO.MartsAdapter import MartsAdapter
from epytope.Core.Variant import Variant, VariationType, MutationSyntax
Expand Down Expand Up @@ -1335,8 +1336,12 @@ def __main__():
)

# get the alleles
# alleles = FileReader.read_lines(args.alleles, in_type=Allele)
alleles = [Allele(a) for a in args.alleles.split(";")]
if args.alleles.startswith("http"):
alleles = [Allele(a) for a in urllib.request.urlopen(args.alleles).read().decode("utf-8").splitlines()]
elif args.alleles.endswith(".txt"):
alleles = [Allele(a) for a in open(args.alleles, "r").read().splitlines()]
else:
alleles = [Allele(a) for a in args.alleles.split(";")]

# initialize MartsAdapter, GRCh37 or GRCh38 based
ma = MartsAdapter(biomart=references[args.reference])
Expand Down

0 comments on commit 6700180

Please sign in to comment.