python 提取基因id对应FPKM值


给个文本文件方便吗?

 

试下下面方法:

  1. pd.read_csv()读取txt文件, 注意分隔符
  2. 用str.split()对数据进行分列清洗 , 获取基因id和Fpkm值
A01	StringTie	transcript	2550	3115	1000	-	.	gene_id "STRG.1"; transcript_id "STRG.1.1"; cov "2.904594"; FPKM "0.419933"; TPM "0.429047";
A01	StringTie	exon	2550	3115	1000	-	.	gene_id "STRG.1"; transcript_id "STRG.1.1"; exon_number "1"; cov "2.904594";
A01	StringTie	transcript	4615	5654	1000	-	.	gene_id "STRG.2"; transcript_id "STRG.2.1"; cov "21.572676"; FPKM "3.118876"; TPM "3.186572";
A01	StringTie	exon	4615	4659	1000	-	.	gene_id "STRG.2"; transcript_id "STRG.2.1"; exon_number "1"; cov "3.095425";