Skip to content

Instantly share code, notes, and snippets.

@Tabea-K
Last active January 11, 2019 15:36
Show Gist options
  • Save Tabea-K/2f0ff146b7a126137a1bb349370feb31 to your computer and use it in GitHub Desktop.
Save Tabea-K/2f0ff146b7a126137a1bb349370feb31 to your computer and use it in GitHub Desktop.

Die Datei seq.fasta muss immer auf dem Desktop liegen!

header entfernen

um die header Zeilen zu entfernen:

grep -v ">" ~/Desktop/seq.fasta > ~/Desktop/seq_ohne_header.fasta

multi line --> single line

um eine multi line fasta in single line umzuwandeln:

awk '/^>/ {printf("\n%s\n",$0);next; } { printf("%s",$0);} END {printf("\n");}'  ~/Desktop/seq.fasta  > ~/Desktop/seq_singleline.fasta 

fasta --> tab

um fasta in tab-separiert zu verwandeln, d.h. der Sequenzname ist in Spalte 1, die Sequenz in Spalte 2:

seq.fasta:
>seq1
actg

wird zu:

seq_singleline.fasta:
seq1  actg
awk 'BEGIN{RS=">";OFS="\t"}NR>1{print "#"$1,$2}'  ~/Desktop/seq.fasta  > ~/Desktop/seq_singleline.fasta 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment