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

Feature/1.3.0 release #74

Merged
merged 6 commits into from
Mar 7, 2025
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
4 changes: 4 additions & 0 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,8 @@ process {
withName: 'NEOANTIGENUTILS_NEOANTIGENINPUT' {
ext.args = "--kD_cutoff ${params.kd_cutoff}"
}

withName: 'NEOANTIGENEDITING_COMPUTEFITNESS' {
ext.args = "--a_param ${params.compute_fitness_a} --k_param ${params.compute_fitness_k} --w_param ${params.compute_fitness_w}"
}
}
4 changes: 4 additions & 0 deletions conf/prod.config
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,12 @@ params {
phylo_mcmc_samples = 2500
phylo_num_chains = 15
kd_cutoff = 500
compute_fitness_a = 22.897590714815188
compute_fitness_k = 1
compute_fitness_w = 0.22402192838740312

iedbfasta = 'https://raw.githubusercontent.com/mskcc/NeoantigenEditing/refs/heads/main/data/iedb.fasta'
cds = 'https://github.com/mskcc-omics-workflows/test-datasets/raw/neoantigen/neoantigen/Homo_sapiens.GRCh37.75.cds.all.fa.gz'
cdna = 'https://github.com/mskcc-omics-workflows/test-datasets/raw/neoantigen/neoantigen/Homo_sapiens.GRCh37.75.cdna.all.fa.gz'
gtf = 'https://github.com/mskcc-omics-workflows/test-datasets/raw/neoantigen/neoantigen/Homo_sapiens.GRCh37.75.gtf.gz'
}
4 changes: 4 additions & 0 deletions conf/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ params {
phylo_num_chains = 2
netmhc3 = true
kd_cutoff = 500
compute_fitness_a = 22.897590714815188
compute_fitness_k = 1
compute_fitness_w = 0.22402192838740312

iedbfasta = 'https://raw.githubusercontent.com/mskcc-omics-workflows/test-datasets/neoantigen/neoantigen/neoantigenEditing/data/iedb.fasta'
cds = 'https://github.com/mskcc-omics-workflows/test-datasets/raw/neoantigen/neoantigen/Homo_sapiens.GRCh37.75.cds.all.fa.gz'
cdna = 'https://github.com/mskcc-omics-workflows/test-datasets/raw/neoantigen/neoantigen/Homo_sapiens.GRCh37.75.cdna.all.fa.gz'
gtf = 'https://github.com/mskcc-omics-workflows/test-datasets/raw/neoantigen/neoantigen/Homo_sapiens.GRCh37.75.gtf.gz'
}
25 changes: 10 additions & 15 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,39 @@
},
"neoantigenediting/computefitness": {
"branch": "develop",
"git_sha": "05e49188ee9407e1b51dfb1a49d8b6133e9276bc",
"git_sha": "6aee6083154c666798e779c0aeb305614f4dcdd3",
"installed_by": ["modules", "neoantigen_editing"]
},
"neoantigenutils/convertannotjson": {
"branch": "develop",
"git_sha": "34505c4c67eabebab927561d3a8fca87c9efe788",
"git_sha": "e8ae6eb203cb5a49f98cacd4734090c182ad5f44",
"installed_by": ["modules"]
},
"neoantigenutils/formatnetmhcpan": {
"branch": "develop",
"git_sha": "939507da8ef974fa8b9f53abd5f9d54492bafab0",
"git_sha": "84f51051ee6735fc9dc8eea733eb84a54dc350bc",
"installed_by": ["modules", "netmhcstabandpan"]
},
"neoantigenutils/generatehlastring": {
"branch": "develop",
"git_sha": "34505c4c67eabebab927561d3a8fca87c9efe788",
"git_sha": "84f51051ee6735fc9dc8eea733eb84a54dc350bc",
"installed_by": ["modules", "netmhcstabandpan"]
},
"neoantigenutils/generatemutfasta": {
"branch": "develop",
"git_sha": "e6bbb12a2dc237b9ea18163e96dbe9d780ddce5f",
"git_sha": "e8ae6eb203cb5a49f98cacd4734090c182ad5f44",
"installed_by": ["modules", "netmhcstabandpan"]
},
"neoantigenutils/neoantigeninput": {
"branch": "develop",
"git_sha": "ba014f40a3aaccd6a78db44f62d697b77a790eb8",
"git_sha": "8b8e8d28b628b6244f4539cc405f2561fd733967",
"installed_by": ["modules"]
},
"netmhc3": {
"branch": "develop",
"git_sha": "0ccb264740ff8fe681f0e298133e52e51bf68994",
"git_sha": "26ac6cb270844a72838220ca239a22fcbe7f71f2",
"installed_by": ["modules", "netmhcstabandpan"]
},
"netmhcpan": {
"branch": "main",
"git_sha": "503abeb67260f060d8228221b07d743aa4180345",
"installed_by": ["modules"]
},
"netmhcpan4": {
"branch": "develop",
"git_sha": "9e23d0e98023dec8b7a9b0faa20eea2f1f9cee3f",
Expand All @@ -62,7 +57,7 @@
},
"phylowgs/createinput": {
"branch": "develop",
"git_sha": "05e49188ee9407e1b51dfb1a49d8b6133e9276bc",
"git_sha": "e8ae6eb203cb5a49f98cacd4734090c182ad5f44",
"installed_by": ["phylowgs"]
},
"phylowgs/multievolve": {
Expand All @@ -86,12 +81,12 @@
"msk": {
"neoantigen_editing": {
"branch": "develop",
"git_sha": "56a628201401866096d6307b9e8c690c5eb46ac2",
"git_sha": "3284d77f55f0ef756d9ccd0519826fd7edd7d2ec",
"installed_by": ["subworkflows"]
},
"netmhcstabandpan": {
"branch": "develop",
"git_sha": "848ad2b5cffd9a4bd15a628cfe59aba93807a252",
"git_sha": "e8ae6eb203cb5a49f98cacd4734090c182ad5f44",
"installed_by": ["subworkflows"]
},
"phylowgs": {
Expand Down
4 changes: 2 additions & 2 deletions modules/msk/neoantigenediting/computefitness/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ process NEOANTIGENEDITING_COMPUTEFITNESS {
"""
compute_fitness.py \\
--alignment ${alignment_file} \\
--input ${patient_data}

--input ${patient_data} \\
${args}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,19 +285,23 @@ def clean_data(tree):

"""

a = 22.897590714815188
k = 1
w = 0.22402192838740312

parser = argparse.ArgumentParser(prog="align_neoantigens_to_IEDB")
parser.add_argument("--alignment", help="neoantigen alignment file", required=True)
parser.add_argument("--input", help="patient_data file", required=True)

parser.add_argument("--a_param", help="weight corresponding to a", default = 22.897590714815188)
parser.add_argument("--k_param", help="weight corresponding to k", default = 1)
parser.add_argument("--w_param", help="weight corresponding to w", default = 0.22402192838740312)

args = parser.parse_args()

alignment_file = args.alignment
patient_file = args.input

a = float(args.a_param)
k = float(args.k_param)
w = float(args.w_param)


epidist = EpitopeDistance()

sample_file = patient_file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ nextflow_process {
name "Test Process NEOANTIGENEDITING_COMPUTEFITNESS"
script "../main.nf"
process "NEOANTIGENEDITING_COMPUTEFITNESS"
config "./nextflow.config"

tag "modules"
tag "modules_nfcore"
Expand All @@ -20,6 +21,12 @@ nextflow_process {
file(params.test_data_mskcc['neoantigen']['patient_data'], checkIfExists: true),
file(params.test_data_mskcc['neoantigen']['iedb_alignments'], checkIfExists: true)
]
input[0] = [
[ id:'test', single_end:false ], // meta map,
file(params.test_data_mskcc['neoantigen']['patient_data'], checkIfExists: true),
file(params.test_data_mskcc['neoantigen']['iedb_alignments'], checkIfExists: true)
]


"""
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
params {
enable_conda = false
}

process {
withName: 'NEOANTIGENEDITING_COMPUTEFITNESS' {
ext.args = '--a_param 22.897590714815188 --k_param 1 --w_param 0.22402192838740312'
}
}
4 changes: 2 additions & 2 deletions modules/msk/neoantigenutils/convertannotjson/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ process NEOANTIGENUTILS_CONVERTANNOTJSON {
tag "$meta.id"
label 'process_single'
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'docker://mskcc/neoantigen-utils-base:1.0.0':
'docker.io/mskcc/neoantigen-utils-base:1.0.0' }"
'docker://mskcc/neoantigen-utils-base:1.3.0':
'docker.io/mskcc/neoantigen-utils-base:1.3.0' }"

input:
tuple val(meta), path(annotatedJSON)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,61 @@
import json
import argparse

VERSION = 1.0
VERSION = 1.1

def process_json_file(json_file_path,output_file_path):

def process_json_file(json_file_path, output_file_path):
with open(json_file_path, "r") as json_file:
data = json.load(json_file)

# Define the TSV header
tsv_header = ["id", "mutation_id", "HLA_gene_id", "sequence", "WT_sequence", "mutated_position", "Kd", "KdWT", "R", "logC", "logA", "quality", "git_branch"]
tsv_header = [
"id",
"mutation_id",
"Gene",
"HLA_gene_id",
"sequence",
"WT_sequence",
"mutated_position",
"Kd",
"KdWT",
"R",
"logC",
"logA",
"quality",
"NMD",
"git_branch",
]

# Convert JSON to TSV
tsv_lines = []
tsv_lines.append("\t".join(tsv_header))

for neoantigen in data["neoantigens"]:
tsv_lines.append("\t".join(str(neoantigen.get(field, "")) for field in tsv_header[:-1]))
tsv_lines.append(
"\t".join(str(neoantigen.get(field, "")) for field in tsv_header[:-1])
)

tsv_output = "\n".join(tsv_lines)

# Write the TSV output to a file
with open(output_file_path, "w") as tsv_file:
tsv_file.write(tsv_output)


def main():
parser = argparse.ArgumentParser(description="Process an annotated JSON file and output TSV format.")
parser = argparse.ArgumentParser(
description="Process an annotated JSON file and output TSV format."
)
parser.add_argument("--json_file", help="Path to the annotated JSON file")
parser.add_argument("--output_file", help="Path to the output TSV file")
parser.add_argument(
"-v", "--version", action="version", version="v{}".format(VERSION)
)
args = parser.parse_args()

process_json_file(args.json_file,args.output_file)
process_json_file(args.json_file, args.output_file)


if __name__ == "__main__":
main()
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,30 @@
{
"id": "test"
},
"test_neoantigens.tsv:md5,4931fb72bba8bbeb3bc6cef19b99b01a"
"test_neoantigens.tsv:md5,38705f1ccbbeb9298037beb871e2e87c"
]
],
"1": [
"versions.yml:md5,e36ea44c5cc6130f40b1a100f7e84fb1"
"versions.yml:md5,07818f514d7f8471de49a39923d6921e"
],
"neoantigenTSV": [
[
{
"id": "test"
},
"test_neoantigens.tsv:md5,4931fb72bba8bbeb3bc6cef19b99b01a"
"test_neoantigens.tsv:md5,38705f1ccbbeb9298037beb871e2e87c"
]
],
"versions": [
"versions.yml:md5,e36ea44c5cc6130f40b1a100f7e84fb1"
"versions.yml:md5,07818f514d7f8471de49a39923d6921e"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.2"
"nf-test": "0.9.2",
"nextflow": "24.10.4"
},
"timestamp": "2024-07-24T16:49:37.133693"
"timestamp": "2025-03-03T15:54:28.541430188"
},
"neoantigenutils_convertannotjson - output(test) - tsv - stub": {
"content": [
Expand All @@ -44,7 +44,7 @@
]
],
"1": [
"versions.yml:md5,e36ea44c5cc6130f40b1a100f7e84fb1"
"versions.yml:md5,07818f514d7f8471de49a39923d6921e"
],
"neoantigenTSV": [
[
Expand All @@ -55,14 +55,14 @@
]
],
"versions": [
"versions.yml:md5,e36ea44c5cc6130f40b1a100f7e84fb1"
"versions.yml:md5,07818f514d7f8471de49a39923d6921e"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.2"
"nf-test": "0.9.2",
"nextflow": "24.10.4"
},
"timestamp": "2024-07-24T16:49:41.629164"
"timestamp": "2025-03-03T15:40:34.220309133"
}
}
4 changes: 2 additions & 2 deletions modules/msk/neoantigenutils/formatnetmhcpan/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ process NEOANTIGENUTILS_FORMATNETMHCPAN {
tag "$meta.id"
label 'process_single'
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'docker://mskcc/neoantigen-utils-base:1.0.0':
'docker.io/mskcc/neoantigen-utils-base:1.0.0' }"
'docker://mskcc/neoantigen-utils-base:1.3.0':
'docker.io/mskcc/neoantigen-utils-base:1.3.0' }"

input:
tuple val(meta), path(netmhcPanOutput)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def netMHCpan_out_reformat(netMHCoutput, mut, stab, netmhc3, prefix):
if netmhc3:
pan_prefix = ""
outfilename = "{}_netmhc{}{}.output.{}.tsv".format(
prefix, pan_prefix, stab_prefix, type_prefix
prefix, stab_prefix, pan_prefix, type_prefix
)
with open(netMHCoutput, "r") as file:
# data = file.read()
Expand Down
Loading