I want to change all n in the sequence into -, but I don't know how to make my bash script not change the n that show up in sequence names. I'm not experienced with sed or regex to make sure my bash script reads only the lines that do not start with >, as that indicates the header.
Example file:
>Name_with_nnn
nnnatgcnnnatttg
>Name2_with_nnn
atgggnnnnGGtnnn
At the same time I want to convert all lowercase letters into uppercase, only in the sequence lines. I don't even know how to begin using sed, I find it really tricky to understand.
Expected output:
>Name_with_nnn
---ATGC---ATTTG
>Name2_with_nnn
ATGGG----GGT---
So after I created my sequence files I tried to continue my script with:
while IFS= read -r line
do
if [[ $line == ">"* ]]
then
echo "Ignoring header line: $line"
else
echo "Converting to uppercase and then N-to-gaps"
# sed or tr?? do call $line or do I call $OUTFILE? so confused..
fi
done