Question

In: Computer Science

In java please complete the following: A DNA sequence in FASTA format consists of a header...

In java please complete the following:

A DNA sequence in FASTA format consists of a header line starting with a “>” sign, followed by a sequence identifier (GenBank Accession number, or clone name), and one or more lines of the sequence itself. Write a Java program to first prompt the user for a sequence identifier, such as “Enter a clone name: “, and then prompt for the DNA sequence. The program should print out a FASTA format sequence to the screen. An example output is listed below:

>bi617a01
GCATGGCGTAAATTGCCCGTACGCTTAA

Solutions

Expert Solution

public static void main(String[] args) {
   boolean first = true;
   Scanner sc = new Scanner(System.in);
   System.out.println("Enter The clone name:");     
   String ss=null;
   while (sc.hasNextLine()) {
       String token = sc.nextLine();
       String token1 = sc.next();
       ss=token+""+token1;
       break;
   }
       Scanner lineScanner = new Scanner(ss);
       while (lineScanner.hasNext()) {
       String line = lineScanner.next();
   if (line.charAt(0) == '>') {
   if (first)
   first = false;
   else
   System.out.println();
   System.out.printf("%s ", line.substring(1));
   } else {
   System.out.print(line);
   }
       }
   System.out.println();
   }


Related Solutions

please complete the header file that contains a class template for ADT Queue and complete all...
please complete the header file that contains a class template for ADT Queue and complete all the member functions in the class template. Submit the header file only, but please write a source file that tests all the member functions to make sure they are working correctly. queue.h #ifndef _QUEUE #define _QUEUE #include"Node.h" template<class ItemType> class Queue { private:    Node<ItemType> *backPtr;    Node<ItemType> *frontPtr; public:    Queue(); //Default constructor    Queue(const Queue<ItemType> &aQueue);    bool isEmpty() const;    bool...
Please Transcribe and translate the normal sequence and the mutated sequence. Identify what type of DNA...
Please Transcribe and translate the normal sequence and the mutated sequence. Identify what type of DNA mutation occurred. (insertion, deletion, or substitution), and Identify what type of protein change resulted. (frameshift, missense, nonsense, or silent) 1) sequence: 3’ TAC CGA GGA ATG TAC GAC TGA ACG CTA ATT 5’. mutated sequence: 3’ AC CGA GGA ATG TAC GAC TGA ACG CTA ATT 5’. 2)  sequence: 3’ TAC UUU CCU AAU AGG GGG GAC GCU UGU AGC ACG UAA 5’ mutated Sequence:...
Which of the following is NOT a sequence of DNA that could be cut by a...
Which of the following is NOT a sequence of DNA that could be cut by a restriction enzyme? a. GAATTC                  b. ATCGAT                 c. GTAC                       d. GTTCCA e. AGATCT Why?
10. The wildtype DNA has the following sequence:                                    
10. The wildtype DNA has the following sequence:                                                                         ACGATTACGAA It has undergone mutation and it now has the sequence (mutation is in BOLD):                                                         ACGACGCACGAA answer questions a-e below in the textbox under this question a. what is this type of mutation called? b. this type of mutation results in a protein that is shorter than usual. True or False c. what mutagen caused this mutation? d. what does this mutagen do to the DNA e. can this mutation be...
A DNA sequence is. TACACCTTGGCGACGACT
A DNA sequence is. TACACCTTGGCGACGACT WHAT IS m RNA sequence is _______________________________ mutated sequence is TACACCTTGGGACGACT what is mRNA mutated. ____________________________________ What kind of mutation is this and what would be the result in terms of the amino acid sequence? (hint... use chart in notes
For the following double stranded DNA sequence, write out the mRNA sequence that will be synthesized...
For the following double stranded DNA sequence, write out the mRNA sequence that will be synthesized from the DNA. (Hint: which strand will you use to build your mRNA?) Then write out the amino acid polypeptide that will be synthesized from this sequence and correctly label the 5’ – 3’ directionality of the mRNA and amino acid fragments: Gene: 5’- A T G C T T C A A G T T G G T C C T C C...
Write down the DNA base sequence that is the complementary strand to the DNA sequence shown...
Write down the DNA base sequence that is the complementary strand to the DNA sequence shown below? (5') C G A C T T C G A G C T (3')
Write sequence of the DNA strand that would be complementary to the DNA sequence shown below....
Write sequence of the DNA strand that would be complementary to the DNA sequence shown below. Label the 3' and 5' ends ofthe new strand. 3'   T A C C G A T G G    5'
Java - Firstly, write a method, using the following header, that counts the number of prime...
Java - Firstly, write a method, using the following header, that counts the number of prime numbers between from and to (inclusive). public static int countPrimes(int from, int to) For example, countPrimes(11,19) returns 4 since 11, 13, 17 and 19 are primes. You can assume that someone has already written the following function to determine is an integer is prime or not. public static boolean isPrime(int i) // returns true if i is a prime number Secondly, write a program...
Java - Firstly, write a method, using the following header, that counts the number of prime...
Java - Firstly, write a method, using the following header, that counts the number of prime numbers between from and to (inclusive) . public static int countPrimes(int from, int to ) For example, countPrimes(11,19) returns 4 since 11, 13, 17 and 19 are primes. You can assume that someone has already written the following function to determine is an integer is prime or not. public static boolean isPrime(int i) // returns true if i is a prime number Secondly, write...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT