Skip to content

Commit

Permalink
Rename files to have mtgrasp prefix (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
lcoombe authored Apr 3, 2024
1 parent f026f87 commit 0404a78
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion mtgrasp.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,5 +178,5 @@


if delete:
subprocess.run(shlex.split(f'bash {script_dir}/cleanup.sh {out_dir}'),
subprocess.run(shlex.split(f'bash {script_dir}/mtgrasp_cleanup.sh {out_dir}'),
check=True)
14 changes: 7 additions & 7 deletions mtgrasp.smk
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ rule blast:
# check if a blast database exists
if not os.path.exists(f'{script_dir}/blast_db/{db_name}'):
shell("mkdir -p {script_dir}/blast_db/{db_name} && cd {script_dir}/blast_db/{db_name} && makeblastdb -in {params.ref_fasta} -dbtype nucl -out {db_name}")
shell("export BLASTDB={script_dir}/blast_db/{db_name} && blast_best-hit.py {input} {db_name} > {output}")
shell("export BLASTDB={script_dir}/blast_db/{db_name} && mtgrasp_blast_best-hit.py {input} {db_name} > {output}")
else:
shell("export BLASTDB={script_dir}/blast_db/{db_name} && blast_best-hit.py {input} {db_name} > {output}")
shell("export BLASTDB={script_dir}/blast_db/{db_name} && mtgrasp_blast_best-hit.py {input} {db_name} > {output}")
check_blast_tsv(f'{output}')

rule create_lists:
Expand All @@ -193,8 +193,8 @@ rule create_lists:
benchmark:
current_dir + "{library}/benchmark/k{k}_kc{kc}.create_lists.benchmark.txt"
shell:
"extract_tsv_value.py {input} {output.ref_list} ref ; "
"extract_tsv_value.py {input} {output.query_list} query"
"mtgrasp_extract_tsv_value.py {input} {output.ref_list} ref ; "
"mtgrasp_extract_tsv_value.py {input} {output.query_list} query"


rule extract_seq:
Expand All @@ -214,7 +214,7 @@ rule extract_seq:
shell:
"seqtk subseq {input.assemblies} {input.query} > {output.query_out} ; "
"seqtk subseq {params.ref_fasta} {input.ref} > {output.ref_out} ;"
" mkdir -p {params.ref_outdir} && create_references_for_ntjoin.py {output.ref_out} {params.ref_outdir} {params.ref_config}"
" mkdir -p {params.ref_outdir} && mtgrasp_create_references_for_ntjoin.py {output.ref_out} {params.ref_outdir} {params.ref_config}"



Expand Down Expand Up @@ -267,7 +267,7 @@ rule pre_polishing:
# If multiple contigs are found, both ntJoin and Sealer are needed
else:
print("Multiple contigs found, ntJoin scaffolding starts")
shell("""run_ntjoin.sh {params.workdir} {target} {params.ref_config} {log_ntjoin} {params.threads}""")
shell("""mtgrasp_run_ntjoin.sh {params.workdir} {target} {params.ref_config} {log_ntjoin} {params.threads}""")
# check gaps need to be filled or not post-ntJoin
if check_gaps(params.ntjoin_out) == 0:
print("---No Gaps Found After ntJoin, Gap Filling Not Needed---")
Expand Down Expand Up @@ -350,7 +350,7 @@ rule end_recovery:
# end recover
bf = bf_sealer(params.r1, params.r2, wildcards.library, params.threads, params.sealer_fpr,params.k)
k = k_string_converter(params.k)
shell("end_recover.py {input} {bf} {params.r1} {params.r2} {params.outdir} {params.threads} {params.p} {params.mismatch_allowed} {k}")
shell("mtgrasp_end_recover.py {input} {bf} {params.r1} {params.r2} {params.outdir} {params.threads} {params.p} {params.mismatch_allowed} {k}")
else:
print("Error: input file is empty.")
exit(1)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
# calculate the flank size
flank_size = int((len(str(record.seq))-10)/2)

cmd = f"add_flanks.py {fake_gap_filled} {assembly} {flank_size} {output}"
cmd = f"mtgrasp_add_flanks.py {fake_gap_filled} {assembly} {flank_size} {output}"
args = shlex.split(cmd)
subprocess.call(args)
# if the gap was not filled, copy the original assembly to the output
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions end_recover.py → mtgrasp_end_recover.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,15 @@ def create_fake_fastq_read(seq, end):

create_fake_fastq_read(end_seq, 'end')
create_fake_fastq_read(start_seq, 'start')
cmd = f'abyss_mergepairs.sh {out_dir} end_sequence.fastq start_sequence.fastq {mismatch_allowed}'
cmd = f'mtgrasp_abyss_mergepairs.sh {out_dir} end_sequence.fastq start_sequence.fastq {mismatch_allowed}'
cmd_shlex = shlex.split(cmd)
subprocess.call(cmd_shlex)
# check if {outdir}/out_merged.fastq is not empty
if os.stat(f"{out_dir}/out_merged.fastq").st_size != 0:
print("abyss_mergepairs merged the ends")
else:
fh_out = open(f'{out_dir}/fake_gap_unfilled.fa', 'w')
print("abys_mergepairs failed to merge the ends")
print("abyss_mergepairs failed to merge the ends")
print("Creating fake gap")
end_bp = []
start_bp = []
Expand Down Expand Up @@ -179,7 +179,7 @@ def create_fake_fastq_read(seq, end):
cmd_shlex = shlex.split(cmd)
subprocess.call(cmd_shlex)
print("Start adding flanks back to the original assembly")
cmd = f'check_filled_add_flanks.py {out_dir}/fake_gap_filled_log.txt {out_dir}/fake_gap_filled_scaffold.fa {assembly} {out_dir}/flank_added_assembly.fa {out_dir}/fake_gap_unfilled.fa'
cmd = f'mtgrasp_check_filled_add_flanks.py {out_dir}/fake_gap_filled_log.txt {out_dir}/fake_gap_filled_scaffold.fa {assembly} {out_dir}/flank_added_assembly.fa {out_dir}/fake_gap_unfilled.fa'
cmd_shlex = shlex.split(cmd)
subprocess.call(cmd_shlex)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 0404a78

Please sign in to comment.