Add a fasta1line function reformating the sequence with a line for the

header and a single line for the sequence

Former-commit-id: 619dc4f5515b0080e5696806f9325f90b983d22e
Former-commit-id: c244fdbb5c84bebf9ae17d6e15c0fd4b00914d32
This commit is contained in:
2016-04-25 11:15:14 +02:00
parent 536a451510
commit 644f154050

View File

@ -117,10 +117,17 @@ function cutseq {
# - $1 : The fasta file containing the sequences to join
function joinfasta {
$AwkCmd '(NR==1 && /^>/) {print $0} \
! /^>/ {print $0}' $1 | \
! /^>/ {print $0}' "${1}" | \
formatfasta
}
function fasta1line {
$AwkCmd '(/^>/ && seq !="") {print seq} \
/^>/ {print $0;seq=""} \
!/^>/ {seq=seq $0} \
END {print seq}' "${1}"
}
function formatfasta {
$AwkCmd 'function printfasta(seq) { \
seqlen=length(seq); \
@ -129,7 +136,7 @@ function formatfasta {
} \
/^>/ { print $0 } \
! /^>/ { seq=seq $0 } \
END { printfasta(seq)}' $1
END { printfasta(seq)}' "${1}"
}
@ -169,7 +176,7 @@ IR_DATA_DIR="${DATA_DIR}/ir" # Directory containing data related to
TRNA_DATA_DIR="${DATA_DIR}/trna" # Directory containing data related to
# tRNAs detection
CDS_DATA_DIR="${DATA_DIR}/trna" # Directory containing data related to
CDS_DATA_DIR="${DATA_DIR}/cds" # Directory containing data related to
# CDSs detection
RRNA_DATA_DIR="${DATA_DIR}/rrna" # Directory containing data related to