Skip to content

Commit

Permalink
Add option to enter alleles as internet link to samplesheet
Browse files Browse the repository at this point in the history
  • Loading branch information
alina-bauer committed Aug 31, 2023
1 parent 50812f9 commit e6e441e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 5 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,10 @@ 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()]
else:
alleles = [Allele(a) for a in args.alleles.split(";")]

peptide_lengths = []
if args.peptides:
Expand Down
8 changes: 6 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,9 +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()]
else:
alleles = [Allele(a) for a in args.alleles.split(";")]

print("alleles nach sache: ", alleles)
# initialize MartsAdapter, GRCh37 or GRCh38 based
ma = MartsAdapter(biomart=references[args.reference])

Expand Down

0 comments on commit e6e441e

Please sign in to comment.