Bioinf one liners
Grab first n sequences in fasta
awk -v n=1000 '/^>/{if(N>n)exit;++N;} {print;}' Horizontal_sequences.fasta	# n seqs
awk '/^>/{if(N)exit;++N;} {print;}' Horizontal_sequences.fasta	# only 1
Fasta to 1-line-fasta	
awk '/^>/ {printf("\n%s\n",$0);next; } { printf("%s",$0);}  END {printf("\n");}' < file.fa

Rename xenoseq header: 
for r in {1..10}; do for t in 1 2 3 4 10 16 20 24; do cat Rep${r}_T${t}_Unique_Contigs/unique_contigs.fasta | awk '{if(/>/) {print $0"_xenoseq_"(++i)} else print}'; done; done;
Delete files older than n days (+1)
find job* -mtime +1 -exec rm {} \;
Remove spaces from fasta header:
sed 's, ,_,g' -i FASTA_file
Length of fasta-sequences;
awk '{/>/&&++a||b+=length()}END{print b/a}’
sCancel by name
qstat -u vandijk | grep Xenoseq |  awk '{print $1}' | xargs -n 1 scancel
Grab sequence by IDS in id.txt
awk -F'>' 'NR==FNR{ids[$0]; next} NF>1{f=($2 in ids)} f' id.txt seq.fasta
Grab sequence by SEARCHTERM in header
awk 'BEGIN {RS=">"} /NODE_8_/ {print ">"$0}' Unique_Contigs_Xenoseq/Rep10_T10_Unique_Contigs/unique_contigs.fn
Merging bins (pathway analysis thingy)
for bin in *; do if [ "$bin" == "bin.1.fa" ]; then echo "skip"; else cat bin.1.fa $bin > combin.1.$bin; fi; done;

gh@ploen ghp_ZOHqqwYY2rx0612dF6n3kBSNyoyBilH6Vz3vKmNa