8000 Adjust for mouse alleles by skrakau · Pull Request #31 · nf-core/epitopeprediction · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Adjust for mouse alleles #31

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

Merged
merged 3 commits into from
Aug 25, 2020
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
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ jobs:
- name: Run peptides test
run: |
nextflow run ${GITHUB_WORKSPACE} -profile test_peptides,docker
- name: Run peptides test on H2 allele
run: |
nextflow run ${GITHUB_WORKSPACE} -profile test_peptides_h2,docker
- name: Run proteins test
run: |
nextflow run ${GITHUB_WORKSPACE} -profile test_proteins,docker
4 changes: 2 additions & 2 deletions bin/epaa.py
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ def make_predictions_from_variants(variants_all, methods, alleles, minlength, ma
df.reset_index(inplace=True)

for c in df.columns:
if '*' in str(c):
if ('HLA-' in str(c)) or ('H-2-' in str(c)):
idx = df.columns.get_loc(c)
df.insert(idx + 1, '%s affinity' % c, df.apply(lambda x: create_affinity_values(str(c), int(x['length']), float(x[c]), x['Method'], max_values_matrices, allele_string_map), axis=1))
df.insert(idx + 2, '%s binder' % c, df.apply(lambda x: create_binder_values(float(x['%s affinity' % c]), x['Method']), axis=1))
Expand Down Expand Up @@ -890,7 +890,7 @@ def make_predictions_from_peptides(peptides, methods, alleles, protein_db, ident
df[c] = df.apply(lambda row: row[0].get_metadata(c)[0], axis=1)

for c in df.columns:
if '*' in str(c):
if ('HLA-' in str(c)) or ('H-2-' in str(c)):
idx = df.columns.get_loc(c)
df.insert(idx + 1, '%s affinity' % c, df.apply(lambda x: create_affinity_values(str(c), int(x['length']), float(x[c]), x['Method'], max_values_matrices, allele_string_map), axis=1))
df.insert(idx + 2, '%s binder' % c, df.apply(lambda x: create_binder_values(float(x['%s affinity' % c]), x['Method']), axis=1))
Expand Down
18 changes: 18 additions & 0 deletions conf/test_peptides_h2.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* -------------------------------------------------
* Nextflow config file for running tests
* -------------------------------------------------
* Defines bundled input files and everything required
* to run a fast and simple test. Use as follows:
* nextflow run nf-core/epitopeprediction -profile test_peptides_h2
*/

params {
max_cpus = 2
max_memory = 6.GB
max_time = 48.h

// Input data
peptides = 'https://raw.githubusercontent.com/nf-core/test-datasets/epitopeprediction/testdata/peptides/peptides.tsv'
alleles = 'https://raw.githubusercontent.com/nf-core/test-datasets/epitopeprediction/testdata/alleles/alleles.H2.txt'
}
8 changes: 8 additions & 0 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,14 @@ else {
allele_file = file(params.alleles)
}

if ( params.input ){
allele_file.eachLine{line ->
if (line.contains("H2-")) {
exit 1, "Mouse allele provided: $line. Not compatible with reference ${params.genome}. Currently mouse alleles are only supported when using peptide sequences as input (--peptides)."
}
}
}

if ( params.mhc_class != 1 && params.mhc_class != 2 ){
exit 1, "Invalid MHC class option: ${params.mhc_class}. Valid options: 1, 2"
}
Expand Down
1 change: 1 addition & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ profiles {
test { includeConfig 'conf/test.config' }
test_variant_tsv { includeConfig 'conf/test_variant_tsv.config' }
test_peptides { includeConfig 'conf/test_peptides.config' }
test_peptides_h2 { includeConfig 'conf/test_peptides_h2.config' }
test_proteins { includeConfig 'conf/test_proteins.config' }
}

Expand Down
0