Question
Bioinformatics-Bash Scripting How can I grep all of the genes and their corresponding sequences that have a specific motif from a fasta.file. For this assignment,
Bioinformatics-Bash Scripting
How can I grep all of the genes and their corresponding sequences that have a specific motif from a fasta.file. For this assignment, we were given 10 motifs of interest, and a fasta file with 500 genes. In the bash script, I am using grep -n -o, but that is only giving me the line number where the motif sequence is located. I want both, the ">gene#" and its corresponding motif sequence "TTTT" to be redirected to a new file. This is what I want the output to the file to be:
for sequence TTTT I need it to look like:
cat TTTT.fasta
>gene2
TTTT
>gene 5
TTTT
>gene 100
TTTT
I want it to specify which genes have the motif sequence using grep command and redirect the output to a new file.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started