Question
Write a bash script that will expect on the command line a single argument which is the name of a file containing multiple DNA strings,
Write a bash script that will expect on the command line a single argument which is the name of a file containing multiple DNA strings, each on a single line with no white space characters of any kind except for the terminating newline character at the end of the line.
Each line is just a sequence of the letters a, c, g, and t. This script will print each line in which the 4th 3-letter sequence is repeated twice later in the line at starting positions that are multiples of three apart.
For example, the string below, which is broken into groups of three letters for ease or reading
acg ttt ggg ccc agc tct ccg ccc tca cac aca ccc cgg ggt
satises this requirement, since ccc is the 4th three-letter sequence and it reoccurs twice at positions that are multiples of three apart, whereas this one does not:
acg ttt ggg ccc agc tct ccg gcc cca cac aca ccc cgg ggt
because, although ccc occurs twice later in the line, the rst reoccurrence is not a multiple of three positions from the rst one.
Error checking: This script must check that it is given a lename on the command line that can be read and issue a usage statement if there is an error of this type.
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