Skip to content

Commit

Permalink
add initial dnaapler archaea #75
Browse files Browse the repository at this point in the history
  • Loading branch information
gbouras13 committed Jul 23, 2024
1 parent 3f4e7e0 commit f31c59e
Show file tree
Hide file tree
Showing 11 changed files with 24,710 additions and 1 deletion.
74 changes: 74 additions & 0 deletions src/dnaapler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,80 @@ def chromosome(
end_dnaapler(start_time)


"""
archaea command
"""

@main_cli.command()
@click.help_option("--help", "-h")
@click.version_option(get_version(), "--version", "-V")
@click.pass_context
@common_options
@click.option(
"-e",
"--evalue",
default="1e-10",
help="e value for blastx",
show_default=True,
)
@autocomplete_options
def archaea(
ctx,
input,
output,
threads,
prefix,
evalue,
force,
autocomplete,
seed_value,
**kwargs,
):
"""Reorients your genome to begin with the archaeal COG1474 Orc1/cdc6 origin recognition complex gene"""

params = {
"--input": input,
"--output": output,
"--threads": threads,
"--force": force,
"--prefix": prefix,
"--evalue": evalue,
"--autocomplete": autocomplete,
"--seed_value": seed_value,
"--force": force,
}

# validates the directory (need to before I start dnaapler or else no log file is written)
instantiate_dirs(output, force)

# defines gene
gene = "cog1474"

# initial logging etc
start_time = begin_dnaapler(input, output, threads, gene, params)
logger.info(
f"You have chosen {autocomplete} method to reorient your sequence if the BLAST based method fails."
)

# validates fasta
validate_fasta(input)

# validate e value
check_evalue(evalue)

# run BLAST
blast_success = run_blast_based_method(
ctx, input, output, prefix, gene, evalue, threads
)

# run autocomplete if BLAST reorientation failed
run_autocomplete(
blast_success, autocomplete, ctx, input, seed_value, output, prefix
)

# end dnaapler
end_dnaapler(start_time)

"""
Plasmid command
"""
Expand Down
3,231 changes: 3,231 additions & 0 deletions src/dnaapler/db/cog1474.fasta

Large diffs are not rendered by default.

Binary file added src/dnaapler/db/cog1474_db.pdb
Binary file not shown.
Binary file added src/dnaapler/db/cog1474_db.phr
Binary file not shown.
Binary file added src/dnaapler/db/cog1474_db.pin
Binary file not shown.
22 changes: 22 additions & 0 deletions src/dnaapler/db/cog1474_db.pjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"version": "1.2",
"dbname": "cog1474_db",
"dbtype": "Protein",
"db-version": 5,
"description": "cog1474.fasta",
"number-of-letters": 158980,
"number-of-sequences": 403,
"last-updated": "2024-07-23T15:32:00",
"number-of-volumes": 1,
"bytes-total": 272156,
"bytes-to-cache": 162704,
"files": [
"cog1474_db.pdb",
"cog1474_db.phr",
"cog1474_db.pin",
"cog1474_db.pot",
"cog1474_db.psq",
"cog1474_db.ptf",
"cog1474_db.pto"
]
}
Binary file added src/dnaapler/db/cog1474_db.psq
Binary file not shown.
Binary file added src/dnaapler/db/cog1474_db.ptf
Binary file not shown.
Binary file added src/dnaapler/db/cog1474_db.pto
Binary file not shown.
4 changes: 3 additions & 1 deletion src/dnaapler/utils/cds_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def run_blast_based_method(
input (Path): Path to the input DNA sequence file in FASTA format.
output (Path): Path to the output directory where the reoriented sequence will be saved.
prefix (str): Prefix for the output file name.
gene (str): Name of the gene used for BLAST search (options: 'dnaA', 'repA', 'terL', 'custom').
gene (str): Name of the gene used for BLAST search (options: 'dnaA', 'repA', 'terL', 'custom', 'cog1474').
evalue (float): E-value threshold for BLAST search.
threads (int): Number of threads for BLAST search.
Expand All @@ -223,6 +223,8 @@ def run_blast_based_method(
db_name = "repA_db"
elif gene == "terL":
db_name = "terL_db"
elif gene == "cog1474":
db_name = "cog1474_db"

# chromosome path
# blast
Expand Down
21,380 changes: 21,380 additions & 0 deletions tests/test_data/overall_inputs/CP001742.1_archaea.fasta

Large diffs are not rendered by default.

0 comments on commit f31c59e

Please sign in to comment.