Skip to content

Commit

Permalink
reports-update
Browse files Browse the repository at this point in the history
  • Loading branch information
ziadbkh committed Jul 1, 2024
1 parent d6b0fff commit d200e82
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 12 deletions.
17 changes: 17 additions & 0 deletions assets/alphafold_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,23 @@ <h3> Download </h3>
})
}

const loadModel_n = () => {
reps = Object.keys(state.representations);
if (reps.length) {
state.representations = {};
} else {
reps = [DEFAULT_REPRESENTATION];
}

// Load PDB entry
return stage.loadFile( uri(state.model) ).then( (o) => {
state.modelObject = o;
reps.forEach( (r) => addModelRepresentation(r) );
stage.setSpin(state.spin);
o.autoView();
setLoading(0);
})
}
// Representations ---------------------------------------------------------

const toggleModelRepresentation = (rep) => {
Expand Down
11 changes: 11 additions & 0 deletions bin/generat_plots_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,21 +207,29 @@ def generate_plots(msa_path, plddt_paths, name, out_dir):
alphfold_template = open(args.html_template, "r").read()
alphfold_template = alphfold_template.replace(f"*sample_name_here*", args.name)

alphfold_template2 = open(args.html_template, "r").read()
alphfold_template2 = alphfold_template2.replace(f"*sample_name_here*", args.name)


i = 0
for structure in structures:
alphfold_template = alphfold_template.replace(f"*_data_ranked_{i}.pdb*", open(structure, "r").read().replace("\n", "\\n"))
alphfold_template2 = alphfold_template2.replace(f"*_data_ranked_{i}.pdb*", structure)
i += 1

if True:
if not args.msa.endswith("NO_FILE"):
with open(f"{args.output_dir}/{args.name + ('_' if args.name else '')}seq_coverage.png", "rb") as in_file:
alphfold_template = alphfold_template.replace("seq_coverage.png", f"data:image/png;base64,{base64.b64encode(in_file.read()).decode('utf-8')}")
alphfold_template2 = alphfold_template2.replace("seq_coverage.png", f"{args.name + ('_' if args.name else '')}seq_coverage.png")
else:
alphfold_template = alphfold_template.replace("seq_coverage.png","")
alphfold_template2 = alphfold_template2.replace("seq_coverage.png","")

for i in range(0, len(args.plddt)):
with open(f"{args.output_dir}/{args.name + ('_' if args.name else '')}coverage_LDDT_{i}.png", "rb") as in_file:
alphfold_template = alphfold_template.replace(f"coverage_LDDT_{i}.png", f"data:image/png;base64,{base64.b64encode(in_file.read()).decode('utf-8')}")
alphfold_template2 = alphfold_template2.replace(f"coverage_LDDT_{i}.png", f"{args.name + ('_' if args.name else '')}coverage_LDDT_{i}.png")


"""
Expand All @@ -235,3 +243,6 @@ def generate_plots(msa_path, plddt_paths, name, out_dir):
"""
with open(f"{args.output_dir}/{args.name}_alphafold.html", "w") as out_file:
out_file.write(alphfold_template)

with open(f"{args.output_dir}/{args.name}_alphafold2.html", "w") as out_file:
out_file.write(alphfold_template2)
2 changes: 1 addition & 1 deletion conf/dbs.config
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ params {
esm2_t36_3B_UR50D_contact_regression = 'https://dl.fbaipublicfiles.com/fair-esm/regression/esm2_t36_3B_UR50D-contact-regression.pt'

// Esmfold paths
esmfold_params_path = "${params.esmfold_db}/*"
//esmfold_params_path = "${params.esmfold_db}/*"
}
20 changes: 13 additions & 7 deletions conf/gadi.config
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,28 @@


if (params.use_gpu) { singularity.runOptions = '--nv' }

singularity.cacheDir = "/g/data/if89/singularity_cache/"
singularity.autoMounts = true

params {
mode = 'alphafold2'
alphafold2_mode = 'split_msa_prediction'
input = 'https://raw.githubusercontent.com/nf-core/test-datasets/proteinfold/testdata/samplesheet/v1.0/samplesheet.csv'
alphafold2_db = '/g/data/if89/alphafold2/standard/'
alphafold2_db = '/g/data/if89/protienfold_dbs/alphafold2_dbs/'
use_dgxa100 = false
esmfold_params_path = '/g/data/if89/esm-fold/checkpoints'
esmfold_params_path = '/g/data/if89/protienfold_dbs/esmfold_dbs/checkpoints'
colabfold_db = "/g/data/if89/protienfold_dbs/colabfold_dbs"
colabfold_server = 'local'
colabfold_model_preset = 'alphafold2_ptm'

}

process {
storage = "gdata/if89+scratch/${params.project}+gdata/${params.project}"

if (params.use_gpu) {
withName: 'RUN_ALPHAFOLD2_PRED|RUN_ALPHAFOLD2' {
withName: 'RUN_ALPHAFOLD2_PRED|RUN_ALPHAFOLD2|RUN_ESMFOLD' {
if (params.use_dgxa100){
queue = "dgxa100"
cpus = 16
Expand All @@ -39,9 +45,9 @@ process {
}
}

withName: 'RUN_ESMFOLD' {
queue = "copyq"
cpus = 1
time = 10.h
withName: 'MMSEQS_COLABFOLDSEARCH' {
memory = 300.GB
time = 16.h
}

}
1 change: 0 additions & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ params {
input = null
mode = 'alphafold2' // {alphafold2, colabfold, esmfold}
use_gpu = false

// Alphafold2 parameters
alphafold2_mode = "standard"
max_template_date = "2020-05-14"
Expand Down
23 changes: 22 additions & 1 deletion nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"description": "The output directory where the results will be saved. You have to use absolute paths to storage on Cloud infrastructure.",
"fa_icon": "fas fa-folder-open"
},
"mode": {
"mode": {
"type": "string",
"default": "alphafold2",
"description": "Specifies the mode in which the pipeline will be run",
Expand Down Expand Up @@ -194,6 +194,27 @@
}
}
},
"gadi_config_options": {
"title": "Institutional config options",
"type": "object",
"fa_icon": "fas fa-university",
"description": "Configurations for running on GADI at NCI.",
"help_text": ".",
"properties": {
"use_dgxa100": {
"type": "boolean",
"default": false,
"description": "If true uses the DGXA 100 GPU nodes",
"fa_icon": "fas fa-battery-full"
},
"project": {
"type": "string",
"description": "Thge project code on GADI.",
"default": "",
"fa_icon": "fas fa-users-cog"
}
}
},
"institutional_config_options": {
"title": "Institutional config options",
"type": "object",
Expand Down
2 changes: 2 additions & 0 deletions tower.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ reports:
display: "Auto-created samplesheet with collated metadata and FASTQ paths"
"*_alphafold.html":
display: "Predected structures"
"*_alphafold2.html":
display: "Predected structures 2"
4 changes: 2 additions & 2 deletions workflows/colabfold.nf
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ workflow COLABFOLD {
Channel
.fromSamplesheet("input")
.set { ch_fasta }

ch_fasta.view()
if (params.colabfold_server == 'webserver') {
//
// MODULE: Run colabfold
Expand Down Expand Up @@ -91,7 +91,7 @@ workflow COLABFOLD {
//
// MODULE: Run mmseqs
//
if (params.colabfold_model_preset != 'AlphaFold2-ptm') {
if (params.colabfold_model_preset != 'alphafold2_ptm') {
MULTIFASTA_TO_CSV(
ch_fasta
)
Expand Down
1 change: 1 addition & 0 deletions workflows/esmfold.nf
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ workflow ESMFOLD {
//
// Create input channel from input file provided through params.input
//

Channel
.fromSamplesheet("input")
.set { ch_fasta }
Expand Down

0 comments on commit d200e82

Please sign in to comment.