Entering edit mode
2.4 years ago
sunilthorat
▴
30
I have multiple fasta files like:
>TestSample1/India/Jan/2021
CAACTTTCGATCTCTTGTAGATCTGTTCTCTAAACGAACTTTAAAATCTGTGTGGCTGTC ACTCGGCTGCATGCTTAGTGCACTCACGCAGTATAATTAATAACTAATTACTGTCGTTGA
>TestSample2/India/Jan/2021
CAACTTTCGATCTCTTGTAGATCTGTTCTCTAAACGAACTTTAAAATCTGTGTGGCTGTC ACTCGGCTGCATGCTTAGTGCACTCACGCAGTATAATTAATAACTAATTACTGTCGTTGA
I want to rename the header like this:
>ABCD_0001
CAACTTTCGATCTCTTGTAGATCTGTTCTCTAAACGAACTTTAAAATCTGTGTGGCTGTC ACTCGGCTGCATGCTTAGTGCACTCACGCAGTATAATTAATAACTAATTACTGTCGTTGA
>ABCD_0001
CAACTTTCGATCTCTTGTAGATCTGTTCTCTAAACGAACTTTAAAATCTGTGTGGCTGTC ACTCGGCTGCATGCTTAGTGCACTCACGCAGTATAATTAATAACTAATTACTGTCGTTGA
I used this code which didnt worked, It says - You are not permitted to execute this command. Contact the systems administrator for further assistance.
ls *.fas | rush 'cat {} | seqkit replace -p ".+" -r "{^.fas}_{nr}" > {.}.fas'
Both the sequences have same header /ID. That would be confusing. There is also a gap (empty space) in sequences, which is not expected. Try this: