Skip to content

Commit

Permalink
removed most legacy conditionals
Browse files Browse the repository at this point in the history
  • Loading branch information
kaijli committed Jun 25, 2024
1 parent 70c60cd commit aee52bf
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 307 deletions.
52 changes: 18 additions & 34 deletions annotation_full.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ input {
String imgap_project_id
String database_location="/refdata/img/"
String imgap_project_type="metagenome"
String gm_license="/refdata/licenses/.gmhmmp2_key"
String? gm_license="/refdata/licenses/.gmhmmp2_key"
Int additional_threads=16
String container="microbiomedata/img-omics@sha256:d5f4306bf36a97d55a3710280b940b89d7d4aca76a343e75b0e250734bc82b71"

Expand Down Expand Up @@ -117,7 +117,6 @@ input {
container=container,
sa_execute = sa_execute,
fa_execute = fa_execute,
map_execute = make_map_file.map_execute,
map_info = make_map_file.out_log,
structural_gff = merge_outputs.structural_gff,
imgap_version = split.imgap_version,
Expand Down Expand Up @@ -176,7 +175,6 @@ input {
rfam_gff = merge_outputs.rfam_gff,
product_names_tsv = merge_outputs.product_names_tsv,
crt_crisprs = merge_outputs.crt_crisprs,
map_execute = make_map_file.map_execute,
map_file = make_map_file.map_file,
renamed_fasta = make_map_file.out_fasta
}
Expand Down Expand Up @@ -212,8 +210,8 @@ input {
File product_names_tsv = finish_ano.final_product_names_tsv
File crt_crisprs = finish_ano.final_crt_crisprs
File imgap_version = finish_ano.final_version
File? renamed_fasta = finish_ano.final_renamed_fasta
File? map_file = finish_ano.final_map_file
File renamed_fasta = finish_ano.final_renamed_fasta
File map_file = finish_ano.final_map_file
}
parameter_meta {
Expand Down Expand Up @@ -275,29 +273,21 @@ task make_map_file {
}
command <<<
find_prefix=`grep ~{proj_id} ~{input_file} | head -1`
set -euo pipefail
if [[ $find_prefix ]]
then
echo "false" > run_map.txt
ln ~{input_file} ~{prefix}_map.fasta || ln -s ~{input_file} ~{prefix}_map.fasta
else
echo "true" > run_map.txt
set -euo pipefail
fasta_sanity.py -v
fasta_sanity.py \
-p ~{proj_id} \
-l ~{min_seq_length} \
-u ~{unknown_gap_length} \
~{input_file} ~{prefix}_map.fasta
fi
>>>
output{
File? map_file = "~{prefix}_contig_names_mapping.tsv"
File map_file = "~{prefix}_contig_names_mapping.tsv"
File out_fasta = "~{prefix}_map.fasta"
File out_log = stdout()
Boolean map_execute = read_boolean("run_map.txt")
}
runtime {
memory: "120G"
Expand Down Expand Up @@ -489,7 +479,6 @@ task make_info_file {
input {
String container
String imgap_version
Boolean map_execute
File map_info
Boolean fa_execute
Boolean sa_execute
Expand Down Expand Up @@ -522,12 +511,11 @@ task make_info_file {
set -euo pipefail
echo "IMGAP Version: ~{imgap_version}" > ~{prefix}_imgap.info
#get map script version
if [[ "~{map_execute}" = true ]]
then
map_version=`grep "fasta_sanity.py" ~{map_info}`
map_version="Mapping Programs Used: $map_version"
echo $map_version >> ~{prefix}_imgap.info
fi

map_version=`grep "fasta_sanity.py" ~{map_info}`
map_version="Mapping Programs Used: $map_version"
echo $map_version >> ~{prefix}_imgap.info

#get structual annotation versions
if [[ "~{sa_execute}" = true ]]
then
Expand Down Expand Up @@ -656,9 +644,8 @@ task finish_ano {
File stats_json
File product_names_tsv
File crt_crisprs
Boolean map_execute
File? map_file
File? renamed_fasta
File map_file
File renamed_fasta
String orig_prefix="scaffold"
String sed="s/~{orig_prefix}_/~{proj}_/g"
}
Expand Down Expand Up @@ -695,12 +682,9 @@ task finish_ano {
cat ~{stats_json} | sed ~{sed} > ~{prefix}_stats.json

ln ~{ano_info_file} ~{prefix}_imgap.info || ln -s ~{ano_info_file} ~{prefix}_imgap.info
ln ~{map_file} ~{prefix}_contig_names_mapping.tsv || ln -s ~{map_file} ~{prefix}_contig_names_mapping.tsv
ln ~{renamed_fasta} ~{prefix}_contigs.fna || ln -s ~{renamed_fasta} ~{prefix}_contigs.fna

if [[ "~{map_execute}" = true ]]
then
ln ~{map_file} ~{prefix}_contig_names_mapping.tsv || ln -s ~{map_file} ~{prefix}_contig_names_mapping.tsv
ln ~{renamed_fasta} ~{prefix}_contigs.fna || ln -s ~{renamed_fasta} ~{prefix}_contigs.fna
fi
>>>

output {
Expand Down Expand Up @@ -731,8 +715,8 @@ task finish_ano {
File final_product_names_tsv = "~{prefix}_product_names.tsv"
File final_lineage_tsv = "~{prefix}_scaffold_lineage.tsv"
File final_crt_crisprs = "~{prefix}_crt.crisprs"
File? final_renamed_fasta = "~{prefix}_contigs.fna"
File? final_map_file = "~{prefix}_contig_names_mapping.tsv"
File final_renamed_fasta = "~{prefix}_contigs.fna"
File final_map_file = "~{prefix}_contig_names_mapping.tsv"
File final_tsv = "~{prefix}_stats.tsv"
File final_version = "~{prefix}_imgap.info"

Expand Down
9 changes: 1 addition & 8 deletions functional-annotation.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,24 @@ workflow f_annotate {
Int additional_threads
# File input_contigs_fasta
File input_fasta
String database_location
Boolean ko_ec_execute=true
String database_location="/refdata/img/"
String ko_ec_img_nr_db="~{database_location}"+"/IMG-NR/20230629/img_nr"
String ko_ec_md5_mapping="~{database_location}"+"/IMG-NR/20230629/md5Hash2Data.tsv"
String ko_ec_taxon_to_phylo_mapping="~{database_location}"+"/IMG-NR/20230629/taxonOId2Taxonomy.tsv"
String lastal_bin="/opt/omics/bin/lastal"
String selector_bin="/opt/omics/bin/functional_annotation/lastal_img_nr_ko_ec_gene_phylo_hit_selector.py"
Boolean smart_execute=true
Int? par_hmm_inst
Int? approx_num_proteins
String smart_db="~{database_location}"+"/SMART/01_06_2016/SMART.hmm"
String hmmsearch_bin="/opt/omics/bin/hmmsearch"
String frag_hits_filter_bin="/opt/omics/bin/functional_annotation/hmmsearch_fragmented_hits_filter.py"
Boolean cog_execute=true
String cog_db="~{database_location}"+"/COG/HMMs/2003/COG.hmm"
Boolean tigrfam_execute=true
String tigrfam_db="~{database_location}"+"/TIGRFAM/v15.0/TIGRFAM.hmm"
String hit_selector_bin="/opt/omics/bin/functional_annotation/hmmsearch_hit_selector.py"
Boolean superfam_execute=true
String superfam_db="~{database_location}"+"/SuperFamily/v1.75/supfam.hmm"
Boolean pfam_execute=true
String pfam_db="~{database_location}"+"/Pfam/Pfam-A/v34.0/Pfam-A.v34.0.hmm"
String pfam_claninfo_tsv="~{database_location}"+"/Pfam/Pfam-A/v34.0/Pfam-A.clans.tsv"
String pfam_clan_filter="/opt/omics/bin/functional_annotation/pfam_clan_filter.py"
Boolean cath_funfam_execute=true
String cath_funfam_db="~{database_location}"+"/Cath-FunFam/v4.2.0/funfam.hmm"
# Boolean signalp_execute=true
# String signalp_gram_stain="GRAM_STAIN"
Expand Down
213 changes: 0 additions & 213 deletions prodigal.wdl

This file was deleted.

Loading

0 comments on commit aee52bf

Please sign in to comment.