Question

I have a FASTA-format file containing my assembled transcripts called asm.fasta. My instructions ...

I have a FASTA-format file containing my assembled transcripts called asm.fasta. My instructions are to create a python script that will leave my file containing only the assembled transcripts that are 300 base pairs or longer.

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

You want to parse the FASTA sequence into python,you can do it this way:

def fasta_reader(filename):
  from Bio.SeqIO.FastaIO import FastaIterator
  with open(filename) as handle:
    for record in FastaIterator(handle):
      yield record

for entry in fasta_reader("file.fasta"):
  print strentry.id) #This is header of fasta entry
  print str(entry.seq) #This is sequence of specific fasta entry
Add a comment
Know the answer?
Add Answer to:
I have a FASTA-format file containing my assembled transcripts called asm.fasta. My instructions ...
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
  • My program crashes on the line (print('\nThe maximum value from the file is {}'.format(max(i)))) with the...

    My program crashes on the line (print('\nThe maximum value from the file is {}'.format(max(i)))) with the error message TypeError: "int" object not iterable. The purpose of this program is to create an process binary files. Can you tell me what's going wrong? Thanks! ( *'s indicate indentation) from sys import argv from pickle import dump from random import randint from pickle import load if (argv[1] == 'c'): ****output_file = open(argv[2], 'wb') ****for i in range(int(argv[3])): ********dump(randint(int(argv[4]), int(argv[5])), output_file) ****output_file.close() ****print('{}...

  • Make File you should create a Makefile containing targets for all the exercises; by default, the...

    Make File you should create a Makefile containing targets for all the exercises; by default, the Makefile should compile all the files, and the output of each of them should be an executable file named i. Further, when the make is called with a number, your Makefile should compile only that exercise. Examples: •make 1 compiles only 1.c into the executable file 1 •make compiles all C files •make clean removes all generated executable files OBS( I Have different programs...

  • I have a text file and want to rank entities by occurrences and output to a text file in the foll...

    I have a text file and want to rank entities by occurrences and output to a text file in the following format: e.g. Bob TAB person TAB 120 Scotland TAB location TAB 105 George TAB person TAB 83 After this I want to rank the co-occurrence (in a sentence) of the top 10 entity pairs and write to a text file: Bob TAB George TAB 20 Scotland TAB Bob TAB 15 etc... How do I do this in python?

  • I have a text file and want to rank entities by occurrences and output to a...

    I have a text file and want to rank entities by occurrences and output to a text file in the following format: e.g. Bob TAB person TAB 120 Scotland TAB location TAB 105 George TAB person TAB 83 After this I want to rank the co-occurrence (in a sentence) of the top 10 entity pairs and write to a text file: Bob TAB George TAB 20 Scotland TAB Bob TAB 15 etc... How do I do this in python?

  • Please solve. How do I create my own text file? Where do I save it so...

    Please solve. How do I create my own text file? Where do I save it so that it is recognized by python? Do I have to import it into my code? the prompt: Write a program that inputs a text file. The program should print the unique words in the file in alphabetical order. An example file along with the correct output is shown below: example.txt the quick brown fox jumps over the lazy dog Enter the input file name:...

  • hi, WILL IT WORK IF I HAVE 2 THINGS IN MY .htaccess file (in my root...

    hi, WILL IT WORK IF I HAVE 2 THINGS IN MY .htaccess file (in my root folder) or do i need to include a extra script BECAUSE I NEED THE FIRST IMAGE FOR MY WEBISTE TO BE SECURE(https) AND I NEED THE SECOND IMAGE FOR MY WEBSITE FILES EXTENSIONS TO BE HIDDEN from my url .html(https://www.yourwebsitename.com/aboutus) PLEASE PROVIDE IF NEEDED , WILL RATE YOU GOOD .htaccess X 1 Options +MultiViews 2 RewriteEngine On 3 RewriteCond %{ SERVER PORT} 80 4...

  • Please answer all part of the question (3.2) I have a sam file called “sequences.sam” and...

    Please answer all part of the question (3.2) I have a sam file called “sequences.sam” and a genomic feature file called “features.bed”. I would like to annotate all the sequences in the sam file with the bed file (overlapping features). Can you write down the commands needed using samtools and bedtools? (3.3) Can you obtain at least two mRNA isoforms of TP53 from NCBI or other online resources? Generate a bed file containing both, color them differently and visualize them...

  • 5.Create two files also called file file1 and file2 in testdir_2 Use the ls -lR to show you created the directories 6. Change the permission of the files in the directories below and show their permi...

    5.Create two files also called file file1 and file2 in testdir_2 Use the ls -lR to show you created the directories 6. Change the permission of the files in the directories below and show their permissions testdir/testdir_1/file1 where owner has read and execute permissions testdir/testdir_1/file2 where where owner has read, write and execute permissions. Group has read only permissions 7. Create a directory called newdir/newdir_1/newdir_2 copy the file testdir/testdir_1/file1 to this directory Change the permisions of the file to owner,...

  • JavaScript expert, I need your help : My program doesn't work. I have the following program,...

    JavaScript expert, I need your help : My program doesn't work. I have the following program, it is simple web page: Create an object called person with name = John, age = 50. Then, access the object to display "John is 50 years old”. I have written some code here. Hint: Create an object with the var keyword, followed by a name and an "=" sign. Put the properties and values inside the {}; signs Note: Use getElementById() and innerHTML...

  • in python in the simplest way I have a file “a.txt” under the directory /temp/, the...

    in python in the simplest way I have a file “a.txt” under the directory /temp/, the file contains some company names, the format is like that: IBM APPLE cisco Microsoft …… Each line contains only one company name. Among these company names, some are capitalized such as IBM, APPLE, some are not, such as cisco. Write a program to read this file a.txt and convert all names to uppercase and save them to the file name “b.txt” in the same...

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