RNA的.fasta数据转换为数字数据
2017-04-22 22:16
323 查看
特征转换:.fasta->.numerical
将.fasta格式的数据转换为数字格式的数据特征转换fasta-numerical
fasta格式1
RNA_m5c数据集
手动将fasta数据集转换为csv格式
使用Anaconda_Spyder_python实现数据转换
.fasta格式1
在生物信息学中,FASTA格式(又称为Pearson格式),是一种基于文本用于表示核苷酸序列或氨基酸序列的格式。在这种格式中碱基对或氨基酸用单个字母来编码,且允许在序列前添加序列名及注释。— [百度百科]RNA_m5c数据集
Supporting Information S1. The benchmark dataset consists of a positive dataset and a negative dataset. The former contains 120 true m5C site containing sequences with the m5C site in the center, while the latter contains 120 false m5C site containing sequences. Each of these segments is 41-bp long.m5c_P.fasta
I. 120 true m5C site containing sequences
P_1
CGCCUCCCACGCGGGAGACCCGGGUUCAAUUCCCGGCCAAU
P_2
CCGGGUUCAAUUCCCGGCCACUGCACGUGGUUGUUUUUCAC
P_3
GGCCGUGGGUGUGUAGAGGCCUUGGUGGUGCAGUGGUAGAA
m5c_N.fasta
II. 120 false m5C site containing sequences
N_1
GGGAGUGGGAACAGGAUUUGCAAGACUCCUAGUACCUAAAU
N_2
GAAAUGGCCUCAUUUGAUAACUAGUAGGUUUUACACAGUGU
N_3
GGGCAGCCUCCUUCUUGUCUCUGUUGUUGAGGAGUGGAAUG
手动将.fasta数据集转换为.csv格式
只保留.fasta数据集中的RNA序列,并且添加标签“serial”,方便进行下一步数据转换,生成m5c_N.csv和m5c_P.csv两个文件
使用Anaconda_Spyder_python实现数据转换
import pandas as pd import csv m5c_N_data=pd.read_csv('.\\m5c_N.csv') m5c_P_data=pd.read_csv('.\\m5c_P.csv') csvfile=file('.\\data.csv','wb') writer=csv.writer(csvfile) data=[] for i in range(120): temp=[] for j in range(41): if m5c_N_data['serial'][i][j]=='A': temp.append(0) elif m5c_N_data['serial'][i][j]=='C': temp.append(1) elif m5c_N_data['serial'][i][j]=='G': temp.append(2) else: temp.append(3) temp.append(0) data.append(temp) for i in range(120): temp=[] for j in range(41): if m5c_P_data['serial'][i][j]=='A': temp.append(0) elif m5c_P_data['serial'][i][j]=='C': temp.append(1) elif m5c_P_data['serial'][i][j]=='G': temp.append(2) else: temp.append(3) temp.append(1) data.append(temp) writer.writerows(data) csvfile.close()
http://baike.baidu.com/item/fasta%E6%A0%BC%E5%BC%8F ↩
相关文章推荐
- python 基础-----数字,字符串,if while 循环 数据类型的转换简单介绍
- 语言小知识-处理数据时 Byte[] 尽量转换为 int[] 防止数字大小越界,变为负数
- 基本数据型态转换成 String,String 转换成 数字的基本数据型态
- python读取文件,数据读入为字符型数字,转换成数值型
- fastjson把Date类型数据转换成一长串数字
- gridview --导出execl 方法及身份证号灯数据类型被转换为数字导致数据错误。及导出数据方法。
- 昨天面试的一道编程题 将人民币大写转换成数字,并且保证数据不能超过一亿
- Oracle数据删除恢复和数字与字符串之间的转换
- PHP数据类型转换(字符转数字,数字转字符)
- 由基本数据型态转换成 String,由 String 转换成数字的基本数据型态
- 用Sockets接收和转换数字和字符串数据
- PHP数据类型转换(字符转数字,数字转字符)
- 数据清洗小记(2):全角数字转换半角数字
- PHP数据类型转换(字符转数字,数字转字符)
- PHP数据类型转换(字符转数字,数字转字符)
- 基本数据型态转换成 String,String 转换成 数字的基本数据型态
- 将整形数据转换为反转数字字符串输出
- excel VBA 将文本数值转换为数字格式(单元格中数据左上角是绿三角,鼠标点上有叹号标示)
- PHP数据类型转换(字符转数字,数字转字符)
- 数据清洗小记:全角数字转换半角数字