In the makeTxDbFromGFF(), the "chrominfo" must not start with "chr", otherwise won't pass makeTxDbFromGFF::.tidy_seqinfo() for some reason. I have to use:
chrominfo<-data.frame(chrom=gsub('^chr','',names(chrom_len)),
length=unname(chrom_len),
is_circular=is_circular)
In the forgeTxDb(), I assume "organism = genome_metadata$genome_metadata," should be "organism = genome_metadata$organism,"
In the forgeTxDb(), "close(gtf)" should be "close(in_gtf)"; also, makeTxDbFromGFF() can take raw file as input, so creating "in_gtf" seems redundant.
In the forgeTxDb(), "paste0(BSgenome, "TxDb.sqlite"))" is problematic, should use a character string to replace BSgenome.