Question

Using Perl Program: Write a program that will generate a DNA sequence (at random) of size...

Using Perl Program: Write a program that will generate a DNA sequence (at random) of size 1000 bp. The sequence should contain all four nucleotides (A, G, C and T).

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Hi there!

Below is attached the required perl code for your question. Please go through the entire code.

Code:

 $str = "RANDOM DNA SEQUENCE GENERATOR"; print "$str\n"; @nb = ('A', 'C', 'G', 'T'); for($a = 0; $a < 1000; $a = $a + 1) { $i = int rand @nb; $j = int rand @nb; if($i != $j){ $elem = $nb[$i] . '-' . $nb[$j]; if(!($elem_prev eq $elem)){ push(@seq, $elem); } else{ $a = $a - 1; } } else{ $a = $a - 1; } $elem_prev = $elem; } print join("\n", @seq[0..999]), "\n";

Please go through the the entire code and let me know if there's any problem with the code. I shall explain you if you need further explanation. Any small changes shall and will be entertained. Please do not give a thumbs doiwn if you do not like my answer because later on people like us suffer a lot for that. And like always please give a thumbs up for my answer if you liked it, as this means a lot to me.

Take care.

Thanks & regards,

Your subject expert

Add a comment
Know the answer?
Add Answer to:
Using Perl Program: Write a program that will generate a DNA sequence (at random) of size...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a program in C to generate random numbers. The program recieves 4 items on activation...

    Write a program in C to generate random numbers. The program recieves 4 items on activation through argv: 1. Name of the data file 2. Number of items for program to generate 3. Range of numbers 4. Seed of the random number generator Example run: ./rand datafile.txt 20 1000 3127 Program must convert all numbers to ints using atoi(), must save all parameters into variables, opens the data file to write the random numbers into it, program loops to generate...

  • Use the provided DNA sequence to generate an amino acid sequence

    > Use the provided DNA sequence to generate an amino acid sequence > Replication: use base pairing rules (A-T, C-G) to create a new strand of DNA > Transcription: use the new strand of DNA to make a strand of RNA; don't forget that RNA uses U instead  of T > Translation: use the genetic code to determine the amino acid sequence

  • Please develop a Java program to read in a piece of DNA sequence from a FASTA format sequence fil...

    Please develop a Java program to read in a piece of DNA sequence from a FASTA format sequence file (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...

  • Perl Write a program to calculate the reverse complement of a strand of DNA. Do not...

    Perl Write a program to calculate the reverse complement of a strand of DNA. Do not # use the s/// or the tr functions. Use the substr function, and examine each base one at # a time in the original while you build up the reverse complement. (Hint: you might # find it easier to examine the original right to left, rather than left to right, although # either is possible.)

  • 1. The following DNA sequence was discovered in a metagenomic analysis of a soil sample. It...

    1. The following DNA sequence was discovered in a metagenomic analysis of a soil sample. It is 249 bp long, and is suspected to be a serine protease inhibitor ATGAGCAGCGGCGGCCTGCTGCTGCTGCTGGGCCTGCTGACCTTTTGCGCGGAACTGACC CCGGTGAGCAGCCGCAAACGCCATCCGTATTGCAACCTGCCGCCGGATCCGGGCCCGTGC CATGATAACAAATTTGCGTTTTATCATCATCCGGCGAGCAACAAATGCAAAGAATTTGTG TATGGCGGCTGCGGCGGCAACGATAACCGCTTTAAAACCCGCAACAAATGCCAGTGCACC TGCAGCGGC a) Which sequencing method would you use to sequence a gene in this size range, and why? (Name of technique and 1-2 sentence explanation.) b) What technique would you use to amplify the DNA, in order to make more of it for future experiments? (What is...

  • Write a complete C program that generate the following sequence of numbers in two ways. First,...

    Write a complete C program that generate the following sequence of numbers in two ways. First, the sequence of numbers should be made using a WHILE LOOP, then a DO-WHILE LOOP. 19, 15, 11, 7, 3, -1, -5, -9

  • Problem 2. Basic statistics. (10 pts.) A DNA sequence S was generated by a series of...

    Problem 2. Basic statistics. (10 pts.) A DNA sequence S was generated by a series of L independent throws of a four-faced die, whose faces ‘A’, ‘C’, ‘G’, ‘T’ have probabilities πA, πC, πG, and πT respectively. You don't know these probabilities of course, and only have the sequence S to go by. How will you estimate the probabilities πA, πC, πG, and πT from sequence S ? (Show your reasoning as well as formulas for the estimates.) Problem 3....

  • Replication, Transcription, and Translation >> Use the provided DNA sequence to generate an amino acid sequence...

    Replication, Transcription, and Translation >> Use the provided DNA sequence to generate an amino acid sequence > Replication: use base pairing rules (A-T, C-G) to create a new strand of DNA Transcription: use the new strand of DNA to make a strand of RNA; don't forget that RNA uses U instead of T > Translation: use the genetic code to determine the amino acid sequence w BEUTE ZERBS 21 Second letter WAU) Tyr Urddon Stop UGI UAG Stop UGG Osclone...

  • How to do the following in R: Write a function to generate a random sample of size n from the Gam...

    How to do the following in R: Write a function to generate a random sample of size n from the Gamma(α,1) distribution by the acceptance-rejection method. Generate a random sample of size 1000 from the Gamma(3,1) distribution. (Hint: you may use g(x) ∼ Exp(λ = 1/α) as your proposal distribution, where λ is the rate parameter. Figure out the appropriate constant c).

  • python/idle 1. Write a program that counts the number of A’s in a DNA sequence. The...

    python/idle 1. Write a program that counts the number of A’s in a DNA sequence. The input is one sequence in FASTA format in a file called ‘dna.txt’. For example, if the file contains: >human ACCGT then the output of the program should be 1. Your program should work for any sequence and not just the one in the example.

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT