envmetagen / metabinkit

Set of programs to perform taxonomic binning.
GNU General Public License v3.0
2 stars 1 forks source link

makeblastdb checks #9

Closed bastianegeter closed 4 years ago

bastianegeter commented 4 years ago

Maybe going one step too far, but I like to run a test blast as part of the makeblastdb command. i.e. take the first sequence of the fasta and blast it against the newly created db to ensure it is created correctly. Also, to run the blastdbcheck command to check the blastdb and to further ensure all seqs have taxids.

from my own makeblastdb function:

if(do.checks){
  message("Running test blast")
  phylotools::dat2fasta(head(tempfasta,n=1),gsub(".fasta",".blastdbformatted.test.fasta",infasta))
  h<-blast.min.bas(gsub(".fasta",".blastdbformatted.test.fasta",infasta),refdb = gsub(".fasta","",infasta))
  message("Does new db have taxids - column V3?")
  print(data.table::fread(gsub(".fasta",".blastdbformatted.test.blast.txt",infasta)))
  system2(command = "blastdbcheck",args = c("-must_have_taxids","-db",gsub(".fasta","",infasta)))
  }
nunofonseca commented 4 years ago

Implemented -c option in metabinkit_blastgendb.