dandelion.base.preprocessing.format_fasta
- dandelion.base.preprocessing.format_fasta(fasta, prefix=None, suffix=None, sep=None, remove_trailing_hyphen_number=True, high_confidence_filtering=False, out_dir=None, filename_prefix=None)[source]
Add prefix to the headers/contig ids in input fasta and annotation file.
- Parameters:
fasta (Path | str) – path to fasta file.
prefix (str | None, optional) – prefix to append to the headers/contig ids.
suffix (str | None, optional) – suffix to append to the headers/contig ids.
sep (str | None, optional) – separator after prefix or before suffix to append to the headers/contig ids.
remove_trailing_hyphen_number (bool, optional) – whether or not to remove the trailing hyphen number e.g. ‘-1’ from the cell/contig barcodes.
high_confidence_filtering (bool, optional) – whether ot not to filter to only high confidence contigs.
out_dir (str | None, optional) – path to output location. None defaults to ‘dandelion’.
filename_prefix (str | None, optional) – prefix of file name preceding ‘_contig’. None defaults to ‘all’.
- Raises:
FileNotFoundError – if path to fasta file is unknown.