Skip to content

Instantly share code, notes, and snippets.

@IgorFobia
Last active April 26, 2016 12:06
Show Gist options
  • Save IgorFobia/6078848 to your computer and use it in GitHub Desktop.
Save IgorFobia/6078848 to your computer and use it in GitHub Desktop.
Concatenate the sequences of a multi-FASTA file and make a new FASTA file with the new sequence
#!/bin/bash
# Concatenate the sequences of a multi-FASTA file and make a new FASTA file with the new sequence
INPUT_FILE=$1
OUTPUT_FILE=$2
(echo ">concantenated"; grep -i '^[ACGTURYKMSWBDHVNX\-]*$' $INPUT_FILE | tr -d '\n' | fold -w 60; echo) > $OUTPUT_FILE
@aassie
Copy link

aassie commented Apr 26, 2016

Nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment