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:
@ -117,10 +117,17 @@ function cutseq {
|
|||||||
# - $1 : The fasta file containing the sequences to join
|
# - $1 : The fasta file containing the sequences to join
|
||||||
function joinfasta {
|
function joinfasta {
|
||||||
$AwkCmd '(NR==1 && /^>/) {print $0} \
|
$AwkCmd '(NR==1 && /^>/) {print $0} \
|
||||||
! /^>/ {print $0}' $1 | \
|
! /^>/ {print $0}' "${1}" | \
|
||||||
formatfasta
|
formatfasta
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function fasta1line {
|
||||||
|
$AwkCmd '(/^>/ && seq !="") {print seq} \
|
||||||
|
/^>/ {print $0;seq=""} \
|
||||||
|
!/^>/ {seq=seq $0} \
|
||||||
|
END {print seq}' "${1}"
|
||||||
|
}
|
||||||
|
|
||||||
function formatfasta {
|
function formatfasta {
|
||||||
$AwkCmd 'function printfasta(seq) { \
|
$AwkCmd 'function printfasta(seq) { \
|
||||||
seqlen=length(seq); \
|
seqlen=length(seq); \
|
||||||
@ -129,7 +136,7 @@ function formatfasta {
|
|||||||
} \
|
} \
|
||||||
/^>/ { print $0 } \
|
/^>/ { print $0 } \
|
||||||
! /^>/ { seq=seq $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
|
TRNA_DATA_DIR="${DATA_DIR}/trna" # Directory containing data related to
|
||||||
# tRNAs detection
|
# 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
|
# CDSs detection
|
||||||
|
|
||||||
RRNA_DATA_DIR="${DATA_DIR}/rrna" # Directory containing data related to
|
RRNA_DATA_DIR="${DATA_DIR}/rrna" # Directory containing data related to
|
||||||
|
Reference in New Issue
Block a user