栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

linux基础操作

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

linux基础操作

#请统计人类基因注释文件(gencode.v34.chr.annotation.gff3.gz)中所有基因类型的数量。不限于linux命令或者python程序,或者其他方法,请简述思路并写出具体的命令/程序代码。#
gzip -d gencode.v34.chr.annotation.gff3.gz #解压gff文件压缩包
less -S gencode.v34.chr.annotation.gff3 #查看注释gff文件
less -S  gencode.v34.chr.annotation.gff3 |cut -f9  |tr ";" "n" |grep gene_type | sort |uniq |wc -l  #查看基因类型总个数
less -S  gencode.v34.chr.annotation.gff3 |cut -f9  |tr ";" "n" |grep gene_type |sort |uniq -c   #查看每种类型及个数

#假如你已经登录系统,但不清楚当前目录在哪里,如何显示当前目录?
pwd                                                         

#如何回到student目录(/home/student)
cd /home/student                                                     

#假如你位于目录/home/student,如何查询该目录下gencode开头的文件有哪些?
ls  -a  gencode*  
                                           
#/home/student目录下,如何查看gencode.v32lift37.annotation.gff3的内容,并单行显示。
less -S  gencode.v32lift37.annotation.gff3                                               

#/home/student目录下,如何查看gencode.v32lift37.annotation.gff3一共有多少个基因(gene、transcript、exon)
cat  gencode.v32lift37.annotation.gff3 |grep -w gene |wc -l   (基因)
cat  gencode.v34.chr.annotation.gff3 |grep -w transcript |wc -l(转录本)                                              
cat  gencode.v34.chr.annotation.gff3 |grep -w exon |wc -l   (外显子)                                              

#/home/student目录下,如何查看gencode.v32lift37.annotation.gff3中,染色体1有多少个基因?
cat  gencode.v32lift37.annotation.gff3 |grep -w chr1 | grep -w gene |wc -l                                                   

#/home/student目录下,如何查看gencode.v32lift37.annotation.gff3中有多少protein_coding基因
cat gencode.v32lift37.annotation.gff3 |grep -w  protein_coding  |wc -l                                                        

#/home/student目录下,如何查看gencode.v32lift37.annotation.gff3中,一共有多少基因类型?
 less -S  gencode.v32lift37.annotation.gff3 |cut -f9  |tr ";" "n" |grep gene_type | sort |uniq |wc -l                                                        

#/home/student目录下,如何查看gencode.v32lift37.annotation.gff3每种基因类型各有多少个?
less -S  gencode.v32lift37.annotation.gff3 |cut -f9  |tr ";" "n" |grep gene_type |sort |uniq -c                                                   

#home/student目录下,如何统计gencode.v32lift37.annotation.gff3中基因转录本的数量分布(1-n个转录本基因各有多少个?),基因最多有多少个转录本?
cat  gencode.v32lift37.annotation.gff3 |awk '/(genet|transcriptt)/'  |cut -f3 |uniq -c |grep transcript |sort |uniq -c   最多有: 239                     

 

 

 ​​​​​​​

 

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/303178.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号