[PYTHON] Extract only complete from the result of Trinity

Not enough to write

I will leave it as a memorandum A script that retrieves only the complete array predicted by Transdocode from the Trinity result file.

compgene_finder.sh


#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
from Bio import SeqIO
import csv


fasta_in = sys.argv[1]                            #Specify the fasta file as the first argument.
for record in SeqIO.parse(fasta_in, 'fasta'): #Open fasta file Parse using SeqIO(Read one item at a time)
        id_part = record.id                       #Read the ID part of fasta
        desc_part = record.description                       #Read the ID part of fasta
        seq = record.seq                          #Read the array part of fastan
        if 'type:complete' in desc_part:
                fasta_seq = '>' +  desc_part + '\n' + seq      #Arrange in fasta format
                print(fasta_seq)                  #Output fasta to standard output

Recommended Posts

Extract only complete from the result of Trinity
Scraping the result of "Schedule-kun"
Extract only the cat part from the cat image (matting / semantic segmentation)
Extract only the sound of a specific instrument from a MIDI file and make it a separate file
Process the result of% time,% timeit
(For lawyers) Extract the behavior of Office software from .evtx files
Learning notes from the beginning of Python 1
Omit BOM from the beginning of the string
Display the result of video analysis using Cloud Video Intelligence API from Colaboratory.
The result of installing python in Anaconda
Learning notes from the beginning of Python 2
Get only the text from the Django form.
[Chocolate Planet] Extract damage reports from the comment section of the Bad Face Championship
Use PIL in Python to extract only the data you want from Exif
Get only the source code of the PyPI package with pip from the command line
Try installing only the core part of Ubuntu
Extract only the file name excluding the directory in the directory
View the result of geometry processing in Python
Change the decimal point of logging from, to.
This is the only basic review of Python ~ 1 ~
This is the only basic review of Python ~ 2 ~
Get only the address part of NIC (eth0)
This is the only basic review of Python ~ 3 ~
Finding the beginning of Abenomics from NT magnification 1
From the introduction of pyethapp to the execution of contract
The transition of baseball as seen from the data
The story of moving from Pipenv to Poetry
Extract images and tables from pdf with python to reduce the burden of reporting
The story of launching a Minecraft server from Discord
Extract the table of image files with OneDrive & Python
The wall of changing the Django service from Python 2.7 to Python 3
Used from the introduction of Node.js in WSL environment
A memorandum about the warning of the pylint output result
Calculate volume from the two-dimensional structure of a compound
Learn Nim with Python (from the beginning of the year).
I want to grep the execution result of strace
[Python] Extract the video ID from the YouTube video URL [Note]
[Python] Get the text of the law from the e-GOV Law API
Open Chrome version of LINE from the command line [Linux]
Calculation of the minimum required number of votes from turnout
Kaggle competition process from the perspective of score transitions
The idea of Tensorflow learned from potato chip manufacturing
Study from the beginning of Python Hour1: Hello World
Get the return code of the Python script from bat
Extract files from EC2 storage with the scp command
Othello ~ From the tic-tac-toe of "Implementation Deep Learning" (4) [End]
Study from the beginning of Python Hour8: Using packages
Decrease the class name of the detection result display of object detection
Output the output result of sklearn.metrics.classification_report as a CSV file
[Python] Extract only numbers from lists and character strings
Extract the band information of raster data with python
Visualize the number of complaints from life insurance companies
Extract each Location from Stargazers in the Github repository
Create a bot that only returns the result of morphological analysis with MeCab on Discord
Chapter 3 Neural Network Cut out only the good points of deep learning made from scratch
An example of a mechanism that returns a prediction by HTTP from the result of machine learning
Chapter 2 Implementation of Perceptron Cut out only the good points of deep learning made from scratch