Skip to main content
Removed UUoC (useless use of cat); Also, there's no need for calling perl multiple times, you can just do it in a single call.
Source Link
terdon
  • 10.6k
  • 5
  • 23
  • 48

You can use these commands:

 
perl -pe 's/>(.*)/>\1\t/g; s/\n//g; s/>/\n>/g' sequences.fa | grep -v '^$'

Explanation:

  1. View your FASTA file
  2. Append a tab to every header line
  3. Join all lines
  4. Split the single obtained line by the '>' character
  5. Remove the empty line (the first line is empty due to the fact that '>' is the first character of the FASTA file)
  1. Append a tab to every header line
  2. Join all lines
  3. Split the single obtained line by the '>' character
  4. Remove the empty line (the first line is empty due to the fact that '>' is the first character of the FASTA file)

You can use these commands:

 

Explanation:

  1. View your FASTA file
  2. Append a tab to every header line
  3. Join all lines
  4. Split the single obtained line by the '>' character
  5. Remove the empty line (the first line is empty due to the fact that '>' is the first character of the FASTA file)

You can use these commands:

perl -pe 's/>(.*)/>\1\t/g; s/\n//g; s/>/\n>/g' sequences.fa | grep -v '^$'

Explanation:

  1. Append a tab to every header line
  2. Join all lines
  3. Split the single obtained line by the '>' character
  4. Remove the empty line (the first line is empty due to the fact that '>' is the first character of the FASTA file)
Source Link
Karel Břinda
  • 1.9k
  • 10
  • 19

You can use these commands:

Explanation:

  1. View your FASTA file
  2. Append a tab to every header line
  3. Join all lines
  4. Split the single obtained line by the '>' character
  5. Remove the empty line (the first line is empty due to the fact that '>' is the first character of the FASTA file)