将 paired count 和unpaired count 相加
来源:互联网 发布:python 字典删除元素 编辑:程序博客网 时间:2024/06/06 06:45
尝试 count-based 算表达量过后,因为在map这一步一直是把过滤过后的paired 和unpaired reads 一起做的,后面count的时候就要出问题。发现可以用 samtools 从 bam 里分出来,于是就分开count,最后把reads 数相加。在用DESeq什么的。
首先,记下 samtools 命令
samtools view -bf -1 all.bam > paired.bamsamtools view -bF -1 all.bam > unpaired.bam
然后是用上次那个提取1,6列的程序,现在就相加:
def readf(filename):lines = open(filename,'r').readlines()s=[]for i in lines:i=i.rstrip('\n')i_ = i.split('\t')s.append(i_[1])return ss_unpaired=readf("unpaired.txt")print(s_unpaired)f=open('paired.txt','r')file=open('out.txt','w')i=0head='Geneid\tcount\n'file.write(head)for lines in f.readlines():lines=lines.rstrip('\n')line=lines.split('\t')#print(line[0])if(i>0):line[1]=int(line[1])+int(s_unpaired[i])print(line)final=line[0]+'\t'+str(line[1])file.write(final+'\n')i+=1file.close
0 0
- 将 paired count 和unpaired count 相加
- count(*)和count(列)
- count(column) 和 count(*)和count(1)
- count(*),count(1)和count(field)区别
- 【数据库】count(*),count(1)和count(列)
- count(*),count(1)和count(field)区别
- Count
- COUNT
- count
- Count
- count
- count
- count
- count
- Count
- count
- Count
- 关于count(1)和count(*)
- 什么是类发射
- [leetcode-273]Integer to English Words(java)
- Android自学笔记之ProgressBar进度条的属性、常用方法及使用
- freemarker各种转换
- leetcode-258-Add Digits
- 将 paired count 和unpaired count 相加
- 野人学Android基础篇之初探UI控件第六课--ListView和他的adapter们(四)
- Maven的Archetype简介
- 苹果应用提交的"Missing Push Notification Entitlement"警告
- Sublime Text 3安装与使用
- Android bitmap的拷贝以及平移旋转缩放等效果
- 破解wifi
- dom4j 读取某个元素的某个属性
- iOS封装 之 直播弹幕