UniqueKMER icon indicating copy to clipboard operation
UniqueKMER copied to clipboard

[Feature request] give a header to each fasta

Open Louis-MG opened this issue 1 year ago • 0 comments

I found myself using your tool to obtain more hindsight into kmer presence and absence in genomes, specifically for kmers unique to certain genomes. Because the output of UniqueKmer is in the following form:

>sequence1
kmer1
kmer2
kmer3

tools will count them as one continuous sequence kmer1kmer2kmer3 which is unintended and will even create kmers that do not exist in the original genome.

Could you add an option to give a header to each kmer ? it would then look like this :

>sequence1:kmer:1
kmer1
>sequence1:kmer:2
kmer2
>sequence1:kmer:3
kmer3

I wrote a command line with awk for that but it would be convenient to have it as an option:

awk -i inplace '{if (/>/) {line=$0; sum=0} else {sum+=1; KMER=$0; print line ":kmer:" sum "\n" KMER} }' unique_kmers.fasta

Louis-MG avatar Apr 05 '23 17:04 Louis-MG