Skip to content

Commit

Permalink
support DNAbin in fasta for trans_func
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiLiubio committed Sep 10, 2024
1 parent 14c2b49 commit 45c141f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion R/trans_func.R
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,12 @@ trans_func <- R6Class(classname = "trans_func",
if(inherits(self$rep_fasta, "DNAStringSet")){
Biostrings::writeXStringSet(x = self$rep_fasta, filepath = rep_fasta_path)
}else{
stop("Unknown fasta format! Must be either list (from read.fasta of seqinr package) or DNAStringSet (from readDNAStringSet of Biostrings package)!")
if(inherits(self$rep_fasta, "DNAbin")){
ape::write.FASTA(self$rep_fasta, file = rep_fasta_path)
}else{
stop("Unknown fasta format! Must be one of DNAStringSet (from readDNAStringSet function of Biostrings package), ",
"list (from read.fasta function of seqinr package), and DNAbin (from read.FASTA function of ape package)!")
}
}
}

Expand Down

0 comments on commit 45c141f

Please sign in to comment.