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

Allele data can also be used via internet link in sample sheet #211

Merged
merged 3 commits into from
Aug 31, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading