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

Java: create a program that reads in a piece of DNA sequence from a sequence file...
Java: create a program that reads in a piece of DNA sequence from a sequence file (dna.seq) (alternatively you can use the getRandomSeq(long) method of the RandomSeq class to generate a piece of DNA sequence), and then print out all the codons in three forward reading frames. Design a method called codon() that can be used to find all the codons from three reading frames. The method will take in an argument, the reading frame (1, 2, or 3), and...
Q.N.2) A portion of a specicific DNA molecule consists of the following sequence of nucleotide triplets:...
Q.N.2) A portion of a specicific DNA molecule consists of the following sequence of nucleotide triplets: TAC   GAA    CTT  CGG What is the DNA sequence codes for this terapeptide?
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'
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT