ANIb #311
Replies: 3 comments
-
It also seems like there is some (possibly redundant) code in Parts of lines 150–173: # Create output directories. We create the main parent directory (args.outdir), but
# also subdirectories for the BLAST databases,
logger.debug("Creating output directory %s", args.outdir)
try:
os.makedirs(args.outdir, exist_ok=True)
except IOError:
logger.error(
f"Could not create output directory {args.outdir} (exiting)", exc_info=True
)
raise SystemError(1)
fragdir = Path(str(args.outdir)) / "fragments"
blastdbdir = Path(str(args.outdir)) / "blastdbs"
logger.debug("\t...creating subdirectories")
os.makedirs(fragdir, exist_ok=True)
os.makedirs(blastdbdir, exist_ok=True)
# Create a new sequence fragment file and a new BLAST+ database for each input genome,
# and add this data to the database as a row in BlastDB
logger.info("Creating input sequence fragment files")
for genome in genomes:
fragpath, fraglengths = fragment_fasta_file(
Path(str(genome.path)), Path(str(fragdir)), args.fragsize
)
print(fragpath, len(fraglengths)) seem very similar to parts of lines 233–243: # Split the input genome files into contiguous fragments of the specified size,
# as described in Goris et al. We create a new directory to hold sequence
# fragments, away from the main genomes
logger.info("Splitting input genome files into %snt fragments...", args.fragsize)
fragdir = Path(args.outdir) / "fragments"
os.makedirs(fragdir, exist_ok=True)
fragfiles, fraglens = anib.fragment_fasta_files(
[Path(str(_.path)) for _ in genomes],
Path(args.outdir) / "fragments",
args.fragsize,
) Are both necessary, or is the code after the (first) |
Beta Was this translation helpful? Give feedback.
-
Yes - that looks like accidental duplication. It wouldn't have caused a bug/error, but there's no reason to try creating that directory twice. |
Beta Was this translation helpful? Give feedback.
-
And you're correct - I approached the |
Beta Was this translation helpful? Give feedback.
-
@widdowquinn I'm trying to make sense of the work that has already been done on this. The file,
anib.py
seems to contain code applicable both for runningblastn
andblastall
; is that accurate? My guess is that it might be largely copied over from version 2's implementation. I'm going to attempt to separate the two, but if you had something else in mind, let me know.Beta Was this translation helpful? Give feedback.
All reactions