Thank you fhsantanna,
faslen does the same thing what this does
awk '/^>/{if (l!="") print l; print; l=0; next}{l+=length($0)}END{print l}' unique.fasta
But, I need to get the length of listed fasta headers only.
• 0 views
•
link
What have you tried? There are definitely solutions for this on the forum already.
Dear healey, The below command can list out the base length of each fasta sequences of the file,
But, I do not know, how to print the specified header's length listed in another txt file. Moreover, how to print the length in another excel sheet.
You will have to provide sample data.
Suppose, I have a multi fasta sequences in org1.fasta as given below,
I need to count the length of following header's listed in id.txt as given below,
And the results(length) to be printed at 3rd coloumn (Total length) of another csv file org.csv as shown below,
what is
hit_lengthIDandhit_lengthcolumns are the existing data of csv file. I need to print the length at 3rd column as I specified with in * symbol.just add
|paste - -unique.fastastdout
If you need
hit_lengthas the 2nd column there, then use a combination of GNU utilitiespasteandcutcol3
Combine the files together
This assumes that the order is the same in your results example and in the unique.fasta file