Thank you. It does not seem to be that. I changed my script a bit. Now it looks like shown below:
mart <- biomaRt::useMart("protists_mart", host= "https://protists.ensembl.org", "pfalciparum_eg_gene")
t2g <- biomaRt::getBM(attributes = c("ensembl_transcript_id", "ensembl_gene_id", "external_gene_name"), mart = mart)
#t2g <- biomaRt::getBM(attributes = c("ensembl_transcript_id", "ensembl_gene_id"), mart = mart)
t2g <- dplyr::rename( t2g, gene_symbol = external_gene_name)
accessions <- list.dirs(full.names=FALSE)[-1]
kallisto.dir<-paste0(accessions)
tsv_files<-file.path(kallisto.dir,"abundance.tsv") #can also be abundance.tsv
names(kallisto.files)<- accessions
tx.kallisto <- tximport(kallisto.files, type = "kallisto", tx2gene = t2g)
If I use the script as shown above then for the counts in the tx.kallisto object I just get one number. If I comment the second line out and use the 3rd line for the getBM attributes I do get a file with the ensembl gene IDs. It seems to be something with the external gene name causing the problem.